kopia lustrzana https://github.com/windytan/slowrx
style, int types, formatting
rodzic
a4e2864e45
commit
8cd3929007
|
@ -48,7 +48,9 @@ void ensure_dir_exists(std::string dir) {
|
|||
}
|
||||
}
|
||||
|
||||
template<class T> CirBuffer<T>::CirBuffer(int size) : m_data(size * 2), m_head(0), m_tail(0), m_fill_count(0), m_len(size) {
|
||||
template<class T> CirBuffer<T>::CirBuffer(int size) :
|
||||
m_data(size * 2), m_head(0), m_tail(0), m_fill_count(0), m_len(size) {
|
||||
|
||||
assert(size > 0);
|
||||
}
|
||||
|
||||
|
|
|
@ -220,7 +220,7 @@ double DSP::calcVideoLevel (SSTVMode mode, bool is_adaptive) {
|
|||
else win_type = bestWindowFor(mode);
|
||||
|
||||
double freq = calcPeakFreq(FREQ_BLACK, FREQ_WHITE, win_type);
|
||||
return fclipToByte((freq - FREQ_BLACK) / (FREQ_WHITE - FREQ_BLACK));
|
||||
return fclip((freq - FREQ_BLACK) / (FREQ_WHITE - FREQ_BLACK));
|
||||
}
|
||||
|
||||
// return: refined peak x position (idx_peak-1 .. idx_peak+1)
|
||||
|
@ -452,7 +452,6 @@ std::vector<double> peaks (const Wave& wave, int n) {
|
|||
return result;
|
||||
}
|
||||
|
||||
|
||||
std::vector<double> derivPeaks (const Wave& wave, int n) {
|
||||
std::vector<double> result = peaks(deriv(wave), n);
|
||||
for (int i=0; i<(int)result.size(); i++) {
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#ifndef DSP_H_
|
||||
#define DSP_H_
|
||||
|
||||
#include "common.h"
|
||||
#include "input.h"
|
||||
#include <mutex>
|
||||
#include <thread>
|
||||
#include "fftw3.h"
|
||||
#include "common.h"
|
||||
#include "input.h"
|
||||
|
||||
// moment length only affects length of global delay, I/O interval,
|
||||
// and maximum window size.
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#ifndef GUI_H_
|
||||
#define GUI_H_
|
||||
|
||||
#include <gtkmm.h>
|
||||
#include "common.h"
|
||||
#include "listener.h"
|
||||
#include <gtkmm.h>
|
||||
|
||||
class GUI {
|
||||
|
||||
|
|
|
@ -145,7 +145,7 @@ int Input::PaCallback(const void *input, void *output,
|
|||
float* in = (float*)input;
|
||||
|
||||
|
||||
for (unsigned i = 0; i<READ_CHUNK_LEN; i++)
|
||||
for (int i = 0; i<READ_CHUNK_LEN; i++)
|
||||
m_read_buffer[i] = in[i * m_num_chans];
|
||||
|
||||
m_cirbuf.append(m_read_buffer, framesread);
|
||||
|
@ -158,7 +158,7 @@ void Input::readMoreFromFile() {
|
|||
|
||||
std::lock_guard<std::mutex> guard(m_buffer_mutex);
|
||||
|
||||
unsigned long framesread = 0;
|
||||
int framesread = 0;
|
||||
sf_count_t fr = m_file.readf(m_read_buffer.data(), READ_CHUNK_LEN);
|
||||
if (fr < READ_CHUNK_LEN) {
|
||||
m_is_open = false;
|
||||
|
@ -185,7 +185,7 @@ void Input::readMoreFromStdin() {
|
|||
|
||||
std::lock_guard<std::mutex> guard(m_buffer_mutex);
|
||||
|
||||
unsigned long framesread = 0;
|
||||
int framesread = 0;
|
||||
ssize_t fr = fread(m_read_buffer_s16.data(), sizeof(uint16_t), READ_CHUNK_LEN, stdin);
|
||||
if (fr < READ_CHUNK_LEN) {
|
||||
m_is_open = false;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#ifndef MODESPEC_H_
|
||||
#define MODESPEC_H_
|
||||
|
||||
#include <string>
|
||||
|
||||
enum SSTVMode {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#include "common.h"
|
||||
#include "dsp.h"
|
||||
#include "picture.h"
|
||||
#include "dsp.h"
|
||||
#include "gui.h"
|
||||
|
||||
Picture::Picture(SSTVMode mode) :
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#include <getopt.h>
|
||||
#include "common.h"
|
||||
#include "gui.h"
|
||||
#include "dsp.h"
|
||||
#include <getopt.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
/*
|
||||
|
|
Ładowanie…
Reference in New Issue