mirror of
https://github.com/JvanKatwijk/dabradio
synced 2025-10-05 15:52:42 +02:00
setscan/nextchannel
This commit is contained in:
@@ -63,7 +63,7 @@ if(DEFINED RTLSDR)
|
||||
endif ()
|
||||
|
||||
|
||||
#add_definitions (-DTHREADED_DECODING) # uncomment for use for an RPI
|
||||
#add_definitions (-DTHREADED_DECODING -DTHREADED_BACKEND) # uncomment for use for an RPI
|
||||
#
|
||||
########################################################################
|
||||
|
||||
|
@@ -10,7 +10,7 @@ Table of Contents
|
||||
* [Features](#features)
|
||||
* [Installation](#features)
|
||||
* [Windows](#windows)
|
||||
* [Ubuntu Linux](#ubuntu-linux)
|
||||
* [Linux: Ubuntu/x64 and Stretch RPI2/3](#ubuntu-linux)
|
||||
- [Configuring using the dabradio.pro file](#configuring-using-the-dabradio-file)
|
||||
- [Configuring using CMake](#configuring-using-cmake)
|
||||
- [Qt](#qt)
|
||||
@@ -92,7 +92,8 @@ If you are not familar with compiling then please continue reading by jumping to
|
||||
|
||||
Ubuntu 16.04 (and on) as well as Debian/Stretch on the RPI2 and 3 have good support for Qt5 (note that contrary to Qt-DAB
|
||||
no use is made of the qwt library).
|
||||
For generating an executable under Ubuntu (16.04 or newer) or on the RPI 2/3 running under Stretch, you can put the following commands into a script.
|
||||
For generating an executable under Ubuntu (16.04 or newer) or on
|
||||
the RPI 2/3 running under Stretch, THE FOLLOWING COMMANDS ARE IN A SCRIPT: build-script. It was tested on RPI2/3 running stretch.
|
||||
(For Ubuntu 14.04 look into the package manager for Qt4 packages).
|
||||
|
||||
1. Fetch the required components
|
||||
|
30
build-script
Normal file
30
build-script
Normal file
@@ -0,0 +1,30 @@
|
||||
sudo apt-get update
|
||||
sudo apt-get install qt5-qmake build-essential g++ git cmake
|
||||
sudo apt-get install libsndfile1-dev qt5-default libfftw3-dev portaudio19-dev
|
||||
sudo apt-get install libfaad-dev zlib1g-dev rtl-sdr libusb-1.0-0-dev mesa-common-dev
|
||||
sudo apt-get install libgl1-mesa-dev libqt5opengl5-dev libsamplerate0-dev
|
||||
sudo apt-get install qtbase5-dev
|
||||
|
||||
sudo apt-get install librtlsdr-dev
|
||||
|
||||
sudo apt-get install build-essential cmake libusb-1.0-0-dev pkg-config
|
||||
wget https://github.com/airspy/host/archive/master.zip
|
||||
unzip master.zip
|
||||
cd airspyone_host-master
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ../ -DINSTALL_UDEV_RULES=ON
|
||||
make
|
||||
sudo make install
|
||||
sudo ldconfig
|
||||
cd ../
|
||||
rm -rf build
|
||||
cd ..
|
||||
git clone https://github.com/JvanKatwijk/dabradio.git
|
||||
cd dabradio
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DRTLSDR=ON -DAIRSPY=ON
|
||||
make
|
||||
|
||||
|
@@ -1,37 +0,0 @@
|
||||
#include <windows.h>
|
||||
|
||||
IDI_ICON1 ICON DISCARDABLE "/usr/shared/sdr-j-development/systems/newradio/dabradio.ico"
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 0,0,0,0
|
||||
PRODUCTVERSION 0,0,0,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS VS_FF_DEBUG
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS VOS__WINDOWS32
|
||||
FILETYPE VFT_DLL
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "\0"
|
||||
VALUE "FileDescription", "\0"
|
||||
VALUE "FileVersion", "0.0.0.0\0"
|
||||
VALUE "LegalCopyright", "\0"
|
||||
VALUE "OriginalFilename", "dabradio-1.0.exe\0"
|
||||
VALUE "ProductName", "dabradio-1.0\0"
|
||||
VALUE "ProductVersion", "0.0.0.0\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x0409, 1200
|
||||
END
|
||||
END
|
||||
/* End of Version info */
|
||||
|
61
radio.cpp
61
radio.cpp
@@ -189,7 +189,11 @@ int gain;
|
||||
RadioInterface::~RadioInterface (void) {
|
||||
fprintf (stderr, "radioInterface is deleted\n");
|
||||
}
|
||||
|
||||
//
|
||||
// A little tricky, there are two signals that may trigger nextChannel
|
||||
// The "no dab is here" signal, which should arrive within
|
||||
// a second or so after starting the decoding,
|
||||
// or a timeout
|
||||
void RadioInterface:: startScanning (void) {
|
||||
connect (&signalTimer, SIGNAL (timeout (void)),
|
||||
this, SLOT (nextChannel (void)));
|
||||
@@ -210,8 +214,6 @@ void RadioInterface:: startScanning (void) {
|
||||
channelNumber ++;
|
||||
}
|
||||
|
||||
if (channelNumber >= theBand -> channels ())
|
||||
return;
|
||||
QString text = "scanning ch ";
|
||||
text. append (theBand -> channel (channelNumber. load ()));
|
||||
set_ensembleName (text);
|
||||
@@ -230,6 +232,10 @@ void RadioInterface:: startScanning (void) {
|
||||
}
|
||||
|
||||
void RadioInterface::nextChannel (void) {
|
||||
disconnect (&signalTimer, SIGNAL (timeout (void)),
|
||||
this, SLOT (nextChannel (void)));
|
||||
disconnect (my_dabProcessor, SIGNAL (No_Signal_Found (void)),
|
||||
this, SLOT (nextChannel (void)));
|
||||
signalTimer. stop ();
|
||||
my_dabProcessor -> stop ();
|
||||
channelNumber++;
|
||||
@@ -237,36 +243,31 @@ void RadioInterface::nextChannel (void) {
|
||||
QString channel = theBand -> channel (channelNumber);
|
||||
if (dabSettings -> value (channel, 1). toInt () > 0) {
|
||||
dabSettings -> setValue (channel, -1);
|
||||
break;
|
||||
int tunedFrequency =
|
||||
theBand -> Frequency (channelNumber);
|
||||
QString text = "scanning ch ";
|
||||
text. append (theBand -> channel (channelNumber));
|
||||
set_ensembleName (text);
|
||||
connect (&signalTimer, SIGNAL (timeout (void)),
|
||||
this, SLOT (nextChannel (void)));
|
||||
connect (my_dabProcessor, SIGNAL (No_Signal_Found (void)),
|
||||
this, SLOT (nextChannel (void)));
|
||||
my_dabProcessor -> start (tunedFrequency, true);
|
||||
signalTimer. start (5000);
|
||||
return;
|
||||
}
|
||||
channelNumber ++;
|
||||
}
|
||||
if (channelNumber < theBand -> channels ()) {
|
||||
if (channelNumber >= theBand -> channels ())
|
||||
return;
|
||||
int tunedFrequency =
|
||||
theBand -> Frequency (channelNumber);
|
||||
QString text = "scanning ch ";
|
||||
text. append (theBand -> channel (channelNumber));
|
||||
set_ensembleName (text);
|
||||
my_dabProcessor -> start (tunedFrequency, true);
|
||||
signalTimer. start (5000);
|
||||
}
|
||||
else {
|
||||
scanning = false;
|
||||
set_ensembleName ("end of scan");
|
||||
serviceLabel -> setText ("select a services");
|
||||
serviceLabel -> setStyleSheet ("QLabel {background-color : green}");
|
||||
disconnect (&signalTimer, SIGNAL (timeout (void)),
|
||||
this, SLOT (nextChannel (void)));
|
||||
disconnect (my_dabProcessor, SIGNAL (No_Signal_Found (void)),
|
||||
this, SLOT (nextChannel (void)));
|
||||
connect (ensembleDisplay,
|
||||
SIGNAL (newService (const QString &, const QString &)),
|
||||
this, SLOT (selectService (const QString &, const QString &)));
|
||||
connect (resetButton, SIGNAL (clicked (void)),
|
||||
this, SLOT (reset (void)));
|
||||
}
|
||||
|
||||
scanning = false;
|
||||
set_ensembleName ("end of scan");
|
||||
serviceLabel -> setText ("select a services");
|
||||
serviceLabel -> setStyleSheet ("QLabel {background-color : green}");
|
||||
connect (ensembleDisplay,
|
||||
SIGNAL (newService (const QString &, const QString &)),
|
||||
this, SLOT (selectService (const QString &, const QString &)));
|
||||
connect (resetButton, SIGNAL (clicked (void)),
|
||||
this, SLOT (reset (void)));
|
||||
}
|
||||
|
||||
void RadioInterface::reset (void) {
|
||||
|
Reference in New Issue
Block a user