master
Hannes Matuschek 12 years ago
parent 5a8334b91f
commit 7f737fc040

@ -1,8 +1,6 @@
IF(SDR_WITH_QT5 AND SDR_WITH_FFTW AND SDR_WITH_PORTAUDIO) IF(SDR_WITH_QT5 AND SDR_WITH_FFTW AND SDR_WITH_PORTAUDIO)
add_executable(sdr_spec sdr_spec.cc) add_executable(sdr_spec sdr_spec.cc)
target_link_libraries(sdr_spec ${LIBS} ${QT_LIBRARIES} libsdr libsdr-gui ) target_link_libraries(sdr_spec ${LIBS} ${QT_LIBRARIES} libsdr libsdr-gui )
add_executable(sdr_qrss sdr_qrss.cc)
target_link_libraries(sdr_qrss ${LIBS} ${QT_LIBRARIES} libsdr libsdr-gui )
ENDIF(SDR_WITH_QT5 AND SDR_WITH_FFTW AND SDR_WITH_PORTAUDIO) ENDIF(SDR_WITH_QT5 AND SDR_WITH_FFTW AND SDR_WITH_PORTAUDIO)
IF(SDR_WITH_PORTAUDIO) IF(SDR_WITH_PORTAUDIO)

@ -1,60 +0,0 @@
#include "sdr.hh"
#include "rtlsource.hh"
#include "baseband.hh"
#include "utils.hh"
#include "gui/gui.hh"
#include <signal.h>
#include "portaudio.hh"
#include <QApplication>
#include <QMainWindow>
#include <QThread>
using namespace sdr;
static void __sigint_handler(int signo) {
// On SIGINT -> stop queue properly
Queue::get().stop();
}
#define F_SAMPLE 11000.0
#define B_SIZE 16384
int main(int argc, char *argv[])
{
Queue &queue = Queue::get();
// Register handler:
signal(SIGINT, __sigint_handler);
PortAudio::init();
QApplication app(argc, argv);
QMainWindow *win = new QMainWindow();
gui::Spectrum *spec = new gui::Spectrum(F_SAMPLE/B_SIZE, 1024, 8);
gui::WaterFallView *spec_view = new gui::WaterFallView(spec);
win->setCentralWidget(spec_view);
win->setMinimumSize(640, 240);
win->show();
// Assemble processing chain
PortSource< int16_t > src(F_SAMPLE, 2048);
AGC< int16_t > agc;
src.connect(&agc);
agc.connect(spec);
queue.addIdle(&src, &PortSource< int16_t >::next);
queue.start();
app.exec();
queue.stop();
queue.wait();
PortAudio::terminate();
return 0;
}
Loading…
Cancel
Save