1
0
mirror of https://github.com/JvanKatwijk/dab-cmdline synced 2025-10-05 23:52:50 +02:00

cleaning up

This commit is contained in:
jan van Katwijk
2019-01-24 15:17:49 +01:00
parent cf1e2b1341
commit 5bfe488c64
98 changed files with 330 additions and 9659 deletions

View File

@@ -2,7 +2,6 @@
DAB COMMAND LINE and DAB LIBRARY
---------------------------------------------------------------------
Introduction
---------------------------------------------------------------------
@@ -25,12 +24,12 @@ Note that the library depends on a device, but does not include that device.
The main program is responsible for ensuring that something is available
to deliver input samples and something is available for handling the output.
THE EXAMPLES ARE NOT INTENDED TO BE FULL SOLUTIONS, BUT MERELY THERE TO GIVE YOU AN
IDEA HOW TO USE THE LIBRARY OR ITS SOURCES.
THE EXAMPLES ARE NOT INTENDED TO BE FULL SOLUTIONS, BUT MERELY THERE
TO GIVE YOU AN IDEA HOW TO USE THE LIBRARY OR ITS SOURCES.
FEEL FREE TO ADAPT OR CORRECT.
Invocation of the example programs, with some parameters specified, is
somthing like
something like
dab-sdrplay-x -M 1 -B "BAND III" -C 12C -P "Radio 4" -G 80 -A default
@@ -45,7 +44,7 @@ The Library code will be set to interpret the input as being of Mode 1.
![example 3 with sdrplay input](/example-3.png?raw=true)
The examples 1 to 6 are basically simple variations on a single theme:
The examples 1 to 7 are basically simple variations on a single theme:
- example 1 is the example where the main program is linked to
a precompiled shared library,
@@ -75,8 +74,9 @@ The examples 1 to 6 are basically simple variations on a single theme:
- example 6 is an experimental version where control is
through an IP port.
- example 7 is an experimental version where stdin is used as input device
(and the command line parameters are adapted to that)
- example 7 is an experimental version where stdin is
used as input device (and the command line parameters are
adapted to that)
- in a separate project a variant of the DAB library is used to create
a DAB server program, running as a service on an RPI 2/3 under Stretch and
@@ -86,17 +86,16 @@ The examples 1 to 6 are basically simple variations on a single theme:
A DAB scanner
-------------------------------------------------------------------------------
Next to these examples, a simple dab-scanner was made, an example program that just
scans all channels of the given band (BAND III by default) and collects and
emits data about the ensembles and services encountered. Output can be sent
to a file - ASCII - that can be interpreted by Libre Office Calc or similar programs.
Next to these examples, a simple dab-scanner was made, an example program
that just scans all channels of the given band (BAND III by default)
and collects and emits data about the ensembles and services encountered.
Output can be sent to a file - ASCII - that can be interpreted
by Libre Office Calc or similar programs.
![dab scanner with sdrplay input](/dab-scanner/dab-scanner.png?raw=true)
----------------------------------------------------------------------------
Building an executable
----------------------------------------------------------------------------

View File

@@ -222,16 +222,5 @@ int32_t dab_getSId (void *, const char*);
// and the other way around, mapping the service identifier to a name
std::string dab_getserviceName (void *, int32_t);
}
//
// Additions, suggested by Hayati
void dab_getCoordinates (void *, int16_t mainId, int16_t subId,
float *latitude, float *longitude,
bool *success,
int16_t *pMainId = nullptr,
int16_t *pSubId = nullptr,
int16_t *pTD = nullptr);
uint8_t dab_getExtendedCountryCode (void *, bool *success);
uint8_t dab_getInternationalTabId (void *, bool *success);
#endif

View File

@@ -217,7 +217,6 @@ endif ()
../library/includes/backend/data/mot
../library/includes/backend/data/journaline
../library/includes/support
../library/includes/support/viterbi_768
/usr/include/
)
@@ -257,7 +256,7 @@ endif ()
../library/includes/backend/data/mot/mot-handler.h
../library/includes/backend/data/mot/mot-dir.h
../library/includes/backend/data/mot/mot-object.h
../library/includes/support/viterbi_768/viterbi-768.h
../library/includes/support/viterbi_handler.h
../library/includes/support/protTables.h
../library/includes/support/protection.h
../library/includes/support/uep-protection.h
@@ -302,8 +301,7 @@ endif ()
../library/src/backend/data/mot/mot-handler.cpp
../library/src/backend/data/mot/mot-dir.cpp
../library/src/backend/data/mot/mot-object.cpp
../library/src/support/viterbi_768/viterbi-768.cpp
../library/src/support/viterbi_768/spiral-no-sse.c
../library/src/support/viterbi_handler.cpp
../library/src/support/protTables.cpp
../library/src/support/protection.cpp
../library/src/support/eep-protection.cpp

View File

@@ -46,7 +46,7 @@ struct timeval tv;
//
rawFiles::rawFiles (std::string f, bool repeater) {
fileName = f;
(void) repeater;
this -> repeater = repeater;
_I_Buffer = new RingBuffer<std::complex<float>>(__BUFFERSIZE);
filePointer = fopen (f. c_str (), "rb");
if (filePointer == NULL) {
@@ -66,6 +66,7 @@ struct timeval tv;
device_eof_callback_t eofHandler,
void * userData) {
fileName = f;
this -> repeater = false;
_I_Buffer = new RingBuffer<std::complex<float>>(__BUFFERSIZE);
filePointer = fopen (f. c_str (), "rb");
if (filePointer == NULL) {
@@ -143,7 +144,7 @@ bool eofReached = false;
nextStop += period;
t = readBuffer (bi, bufferSize);
if (t <= bufferSize) {
if (t < bufferSize) {
for (i = 0; i < bufferSize; i ++)
bi [i] = 0;
t = bufferSize;
@@ -151,11 +152,18 @@ bool eofReached = false;
}
_I_Buffer -> putDataIntoBuffer (bi, t);
if (eofReached) {
if (eofReached && repeater) {
fseek (filePointer, currPos, SEEK_SET);
eofReached = false;
if (eofHandler != nullptr)
eofHandler (userData);
}
else
if (eofReached && eofHandler != nullptr) {
eofReached = false;
eofHandler (userData);
}
else
break;
if (nextStop - getMyTime () > 0)
usleep (nextStop - getMyTime ());
}

View File

@@ -32,7 +32,7 @@ typedef void (*device_eof_callback_t)(void * userData);
*/
class rawFiles: public deviceHandler {
public:
rawFiles (std::string, bool);
rawFiles (std::string, bool repeater = true);
rawFiles (std::string,
double fileOffset,
device_eof_callback_t eofHandler,
@@ -47,6 +47,7 @@ private:
std::string fileName;
double fileOffset;
device_eof_callback_t eofHandler;
bool repeater;
void *userData;
virtual void run (void);
RingBuffer<std::complex<float>> *_I_Buffer;

View File

@@ -170,11 +170,17 @@ bool eofReached = false;
t = bufferSize;
}
_I_Buffer -> putDataIntoBuffer (bi, bufferSize);
if (eofReached) {
if (eofHandler != nullptr)
eofHandler (userData);
if (eofReached && this -> repeater) {
sf_seek (filePointer, (sf_count_t)0, SEEK_SET);
eofReached = false;
}
else
if (eofReached && (eofHandler != nullptr)) {
eofHandler (userData);
eofReached = false;
}
else
break;
if (nextStop - getMyTime () > 0)
usleep (nextStop - getMyTime ());
}

View File

@@ -4,19 +4,19 @@
* Jan van Katwijk (J.vanKatwijk@gmail.com)
* Lazy Chair Computing
*
* This file is part of the Qt-DAB program
* Qt-DAB is free software; you can redistribute it and/or modify
* This file is part of the DAB library
* DAB library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* Qt-DAB is distributed in the hope that it will be useful,
* DAB library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Qt-DAB; if not, write to the Free Software
* along with DAB library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __WAV_FILES__

View File

@@ -1,425 +0,0 @@
cmake_minimum_required( VERSION 2.8.11 )
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11 -flto")
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -flto")
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set (CMAKE_INSTALL_PREFIX "/usr/local/bin" CACHE PATH "default install path" FORCE )
endif()
#set (CMAKE_INSTALL_PREFIX /usr/local/bin)
if(MINGW)
add_definitions ( -municode)
endif()
########################################################################
# select the release build type by default to get optimization flags
########################################################################
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
message(STATUS "Build type not specified: defaulting to release.")
endif(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "")
### make sure our local CMake Modules path comes first
list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake/Modules)
######################################################################
#
########################################################################
OPTION(RTLSDR "Input: RTLSDR" OFF)
OPTION(AIRSPY "Input: AirSpy" OFF)
OPTION(SDRPLAY "Input: SDRPlay" OFF)
OPTION(WAVFILES "Input: WAVFILES" OFF)
OPTION(RAWFILES "Input: RAWFILES" OFF)
OPTION(RTL_TCP "Input: RTL_TCP" OFF)
if ( (NOT RTLSDR) AND (NOT AIRSPY) AND (NOT SDRPLAY) AND (NOT WAVFILES) AND (NOT RAWFILES) AND (NOT RTL_TCP) )
message("None of the Input Options selected. Using default RTLSDR")
set(RTLSDR ON)
endif ()
set (objectName "")
if(AIRSPY)
if (objectName STREQUAL "")
set(AIRSPY ON)
set(objectName dab-airspy)
else()
message("Ignoring 2nd input option AIRSPY")
endif()
endif ()
if(SDRPLAY)
if (objectName STREQUAL "")
set(SDRPLAY ON)
set(objectName dab-sdrplay)
else()
message("Ignoring 2nd input option SDRPLAY")
endif()
endif ()
if(RTLSDR)
if (objectName STREQUAL "")
set(RTLSDR ON)
set(objectName dab-rtlsdr)
else()
message("Ignoring 2nd input option RTLSDR")
endif()
endif ()
if(WAVFILES)
if (objectName STREQUAL "")
set(WAVFILES ON)
set(objectName dab-files)
else()
message("Ignoring 2nd input option WAVFILES")
endif()
endif ()
if(RAWFILES)
if (objectName STREQUAL "")
set(RAWFILES ON)
set(objectName dab-raw)
else()
message("Ignoring 2nd input option RAWFILES")
endif()
endif ()
if(RTL_TCP)
if (objectName STREQUAL "")
set(RTL_TCP ON)
set(objectName dab-rtl_tcp)
else()
message("Ignoring 2nd input option RTL_TCP")
endif()
endif ()
if (objectName STREQUAL "")
set (objectName dab_cmdline)
endif ()
if (DEFINED_SERVER)
add_definitions(-DHAVE_SERVER)
endif ()
#########################################################################
find_package (PkgConfig)
find_package(FFTW3f)
if (NOT FFTW3F_FOUND)
message(FATAL_ERROR "please install FFTW3")
endif ()
find_package(Faad)
if (NOT FAAD_FOUND )
message(FATAL_ERROR "please install libfaad")
endif ()
find_package(zlib)
if (NOT ZLIB_FOUND)
message(FATAL_ERROR "please install libz")
endif ()
list(APPEND extraLibs ${ZLIB_LIBRARY})
find_library (PTHREADS pthread)
if (NOT(PTHREADS))
message (FATAL_ERROR "please install libpthread")
else (NOT(PTHREADS))
set (extraLibs ${extraLibs} ${PTHREADS})
endif (NOT(PTHREADS))
#########################################################################
find_package (PkgConfig)
##########################################################################
# The devices
#
if (RTL_TCP)
include_directories (
../devices/rtl_tcp
)
set ($(objectName)_HDRS
${${objectName}_HDRS}
../devices/rtl_tcp/rtl_tcp-client.h
)
set (${objectName}_SRCS
${${objectName}_SRCS}
../devices/rtl_tcp/rtl_tcp-client.cpp
)
add_definitions (-DHAVE_RTL_TCP)
endif (RTL_TCP)
if (SDRPLAY)
find_path (SDRPLAYLIB_INCLUDE_DIR
NAMES mirsdrapi-rsp.h
PATHS
/usr/local/include/
)
include_directories (${SDRPLAYLIB_INCLUDE_DIR})
find_library (SDRPLAYLIB mirsdrapi-rsp)
if(NOT(SDRPLAYLIB))
message(FATAL_ERROR "please install -lmirsdrapi-rsp")
else(NOT(SDRPLAYLIB))
list (APPEND extraLibs ${SDRPLAYLIB})
endif(NOT(SDRPLAYLIB))
include_directories (
../devices/sdrplay-handler
)
set ($(objectName)_HDRS
${${objectName}_HDRS}
../devices/sdrplay-handler/sdrplay-handler.h
)
set (${objectName}_SRCS
${${objectName}_SRCS}
../devices/sdrplay-handler/sdrplay-handler.cpp
)
add_definitions (-DHAVE_SDRPLAY)
endif (SDRPLAY)
if (AIRSPY)
find_package(LibAIRSPY)
if (NOT LIBAIRSPY_FOUND)
message(FATAL_ERROR "please install airspy library")
endif ()
### include_directories (${AIRSPYLIB_INCLUDE_DIR})
include_directories (
../devices/airspy-handler
)
set ($(objectName)_HDRS
${${objectName}_HDRS}
../devices/airspy-handler/airspy-handler.h
)
set (${objectName}_SRCS
${${objectName}_SRCS}
../devices/airspy-handler/airspy-handler.cpp
)
add_definitions (-DHAVE_AIRSPY)
endif (AIRSPY)
if (RTLSDR)
find_package(LibRTLSDR)
if (NOT LIBRTLSDR_FOUND)
message(FATAL_ERROR "please install librtlsdr")
endif ()
###include_directories (${RTLSDR_INCLUDE_DIR})
include_directories (
../devices/rtlsdr-handler/
)
set (${objectName}_HDRS
${${objectName}_HDRS}
../devices/rtlsdr-handler/rtlsdr-handler.h
)
set (${objectName}_SRCS
${${objectName}_SRCS}
../devices/rtlsdr-handler/rtlsdr-handler.cpp
)
add_definitions (-DHAVE_RTLSDR)
endif()
if (WAVFILES)
include_directories (
../devices/wavfiles/
)
set (${objectName}_HDRS
${${objectName}_HDRS}
../devices/wavfiles/wavfiles.h
)
set (${objectName}_SRCS
${${objectName}_SRCS}
../devices/wavfiles/wavfiles.cpp
)
find_package(LibSndFile)
if (NOT LIBSNDFILE_FOUND)
message(FATAL_ERROR "please install libsndfile")
endif ()
list(APPEND extraLibs ${LIBSNDFILE_LIBRARY})
add_definitions (-DHAVE_WAVFILES)
endif()
if (RAWFILES)
include_directories (
../devices/rawfiles/
)
set (${objectName}_HDRS
${${objectName}_HDRS}
../devices/rawfiles/rawfiles.h
)
set (${objectName}_SRCS
${${objectName}_SRCS}
../devices/rawfiles/rawfiles.cpp
)
add_definitions (-DHAVE_RAWFILES)
endif()
#######################################################################
#
# Here we really start
include_directories (
${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
.
./
./server-thread
../
../library
../library/includes
../library/includes/ofdm
../library/includes/backend
../library/includes/backend/audio
../library/includes/backend/data
../library/includes/backend/data/mot
../library/includes/backend/data/journaline
../library/includes/support
../library/includes/support/viterbi_768
/usr/include/
)
set (${objectName}_HDRS
${${objectName}_HDRS}
./ringbuffer.h
./band-handler.h
./dab_tables.h
./server-thread/tcp-server.h
../dab-api.h
../devices/device-handler.h
../library/includes/dab-constants.h
../library/includes/dab-processor.h
../library/includes/ofdm/phasereference.h
../library/includes/ofdm/phasetable.h
../library/includes/ofdm/freq-interleaver.h
../library/includes/ofdm/timesyncer.h
../library/includes/ofdm/fic-handler.h
../library/includes/ofdm/fib-processor.cpp
../library/includes/ofdm/sample-reader.h
../library/includes/backend/firecode-checker.h
../library/includes/backend/backend-base.h
../library/includes/backend/charsets.h
../library/includes/backend/galois.h
../library/includes/backend/reed-solomon.h
../library/includes/backend/msc-handler.h
../library/includes/backend/virtual-backend.h
../library/includes/backend/audio-backend.h
../library/includes/backend/data-backend.h
../library/includes/backend/audio/faad-decoder.h
../library/includes/backend/audio/mp4processor.h
../library/includes/backend/audio/mp2processor.h
../library/includes/backend/data/virtual-datahandler.h
../library/includes/backend/data/tdc-datahandler.h
../library/includes/backend/data/pad-handler.h
../library/includes/backend/data/data-processor.h
../library/includes/backend/data/mot/mot-handler.h
../library/includes/backend/data/mot/mot-dir.h
../library/includes/backend/data/mot/mot-object.h
../library/includes/support/viterbi_768/viterbi-768.h
../library/includes/support/protTables.h
../library/includes/support/protection.h
../library/includes/support/uep-protection.h
../library/includes/support/eep-protection.h
../library/includes/support/fft_handler.h
../library/includes/support/dab-params.h
../library/includes/support/tii_table.h
)
set (${objectName}_SRCS
${${objectName}_SRCS}
./main.cpp
./band-handler.cpp
./dab_tables.cpp
./server-thread/tcp-server.cpp
../devices/device-handler.cpp
../library/dab-api.cpp
../library/src/dab-processor.cpp
../library/src/ofdm/ofdm-decoder.cpp
../library/src/ofdm/phasereference.cpp
../library/src/ofdm/phasetable.cpp
../library/src/ofdm/freq-interleaver.cpp
../library/src/ofdm/timesyncer.cpp
../library/src/ofdm/sample-reader.cpp
../library/src/ofdm/fib-processor.cpp
../library/src/ofdm/fic-handler.cpp
../library/src/backend/firecode-checker.cpp
../library/src/backend/backend-base.cpp
../library/src/backend/charsets.cpp
../library/src/backend/galois.cpp
../library/src/backend/reed-solomon.cpp
../library/src/backend/msc-handler.cpp
../library/src/backend/virtual-backend.cpp
../library/src/backend/audio-backend.cpp
../library/src/backend/data-backend.cpp
../library/src/backend/audio/mp4processor.cpp
../library/src/backend/audio/mp2processor.cpp
../library/src/backend/data/virtual-datahandler.cpp
../library/src/backend/data/tdc-datahandler.cpp
../library/src/backend/data/pad-handler.cpp
../library/src/backend/data/data-processor.cpp
../library/src/backend/data/mot/mot-handler.cpp
../library/src/backend/data/mot/mot-dir.cpp
../library/src/backend/data/mot/mot-object.cpp
../library/src/support/viterbi_768/viterbi-768.cpp
../library/src/support/viterbi_768/spiral-no-sse.c
../library/src/support/protTables.cpp
../library/src/support/protection.cpp
../library/src/support/eep-protection.cpp
../library/src/support/uep-protection.cpp
../library/src/support/fft_handler.cpp
../library/src/support/dab-params.cpp
../library/src/support/tii_table.cpp
)
#
include_directories (
${FFTW_INCLUDE_DIRS}
${FAAD_INCLUDE_DIRS}
${SNDFILES_INCLUDE_DIRS}
)
#####################################################################
add_executable (${objectName}
${${objectName}_SRCS}
)
target_link_libraries (${objectName}
${FFTW3F_LIBRARIES}
${extraLibs}
${FAAD_LIBRARIES}
${CMAKE_DL_LIBS}
)
INSTALL (TARGETS ${objectName} DESTINATION .)
########################################################################
# Create uninstall target
########################################################################
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)

View File

@@ -1,34 +0,0 @@
Example 3
Example 3 is an example program, not using the library, but binding directly
to the functions implementing the dab decoding.
All callbacks are defined, most of them with an empty body.
In this version, we send the audio output directly to stdout rather than -
using portaudio - sending it to the soundcard.
See the file main.cpp for the command line options
Feel free to improve the program
Points to note:
bytesOut is a new callback function, a function that is called
from the tdc handler (and later may be from others as well)
The data parameter is a packet with a 4 byte header
byte 0 is 0xFF
byte 1 is 0x00
byte 2 is 0xFF
byte 3 is 0x00
byte 4 is the high byte of the 16 bit size
byte 5 is the low byte of the 16 bit size
byte 6 is 0x00
byte 7 is 0 for packet type 0, 0xFF for packet type 1
Note that the lenngth is the length of the data part, so not taking the
header into account
The bytesOut function puts the data into a simple TCP server that can be
read from port 8888 (depending on the configuration).

View File

@@ -1,121 +0,0 @@
#
/*
* Copyright (C) 2013, 2014, 2015, 2016, 2017
* Jan van Katwijk (J.vanKatwijk@gmail.com)
* Lazy Chair Computing
*
* This file is part of the DAB library
*
* DAB library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* DAB library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DAB library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "band-handler.h"
struct dabFrequencies {
const char *key;
int fKHz;
};
static
struct dabFrequencies bandIII_frequencies [] = {
{"5A", 174928},
{"5B", 176640},
{"5C", 178352},
{"5D", 180064},
{"6A", 181936},
{"6B", 183648},
{"6C", 185360},
{"6D", 187072},
{"7A", 188928},
{"7B", 190640},
{"7C", 192352},
{"7D", 194064},
{"8A", 195936},
{"8B", 197648},
{"8C", 199360},
{"8D", 201072},
{"9A", 202928},
{"9B", 204640},
{"9C", 206352},
{"9D", 208064},
{"10A", 209936},
{"10B", 211648},
{"10C", 213360},
{"10D", 215072},
{"11A", 216928},
{"11B", 218640},
{"11C", 220352},
{"11D", 222064},
{"12A", 223936},
{"12B", 225648},
{"12C", 227360},
{"12D", 229072},
{"13A", 230748},
{"13B", 232496},
{"13C", 234208},
{"13D", 235776},
{"13E", 237488},
{"13F", 239200},
{NULL, 0}
};
static
struct dabFrequencies Lband_frequencies [] = {
{"LA", 1452960},
{"LB", 1454672},
{"LC", 1456384},
{"LD", 1458096},
{"LE", 1459808},
{"LF", 1461520},
{"LG", 1463232},
{"LH", 1464944},
{"LI", 1466656},
{"LJ", 1468368},
{"LK", 1470080},
{"LL", 1471792},
{"LM", 1473504},
{"LN", 1475216},
{"LO", 1476928},
{"LP", 1478640},
{NULL, 0}
};
bandHandler::bandHandler (void) {}
bandHandler::~bandHandler (void) {}
// find the frequency for a given channel in a given band
int32_t bandHandler::Frequency (uint8_t dabBand, std::string Channel) {
int32_t tunedFrequency = 0;
struct dabFrequencies *finger;
int i;
if (dabBand == BAND_III)
finger = bandIII_frequencies;
else
finger = Lband_frequencies;
for (i = 0; finger [i]. key != NULL; i ++) {
if (finger [i]. key == Channel) {
tunedFrequency = finger [i]. fKHz * 1000;
break;
}
}
if (tunedFrequency == 0)
tunedFrequency = finger [0]. fKHz * 1000;
return tunedFrequency;
}

View File

@@ -1,41 +0,0 @@
#
/*
* Copyright (C) 2013, 2014, 2015, 2016, 2017
* Jan van Katwijk (J.vanKatwijk@gmail.com)
* Lazy Chair Computing
*
* This file is part of the Qt-DAB program
* Qt-DAB is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* Qt-DAB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Qt-DAB; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __BANDHANDLER__
#define __BANDHANDLER__
#include <stdint.h>
#include <string>
//
// a simple convenience class
//
#define BAND_III 0100
#define L_BAND 0101
class bandHandler {
public:
bandHandler (void);
~bandHandler (void);
int32_t Frequency (uint8_t band, std::string Channel);
};
#endif

View File

@@ -1,13 +0,0 @@
QMAKE_DEFAULT_INCDIRS = \
/usr/include/c++/6.4.1 \
/usr/include/c++/6.4.1/x86_64-redhat-linux \
/usr/include/c++/6.4.1/backward \
/usr/lib/gcc/x86_64-redhat-linux/6.4.1/include \
/usr/local/include \
/usr/include
QMAKE_DEFAULT_LIBDIRS = \
/usr/lib/gcc/x86_64-redhat-linux/6.4.1 \
/usr/lib64 \
/lib64 \
/usr/lib \
/lib

Binary file not shown.

View File

@@ -1,596 +0,0 @@
#############################################################################
# Makefile for building: Client
# Generated by qmake (3.0) (Qt 5.7.1)
# Project: client.pro
# Template: app
# Command: /usr/bin/qmake-qt5 -o Makefile client.pro
#############################################################################
MAKEFILE = Makefile
####### Compiler, tools and options
CC = gcc
CXX = g++
DEFINES = -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB
CFLAGS = -pipe -O2 -Wall -W -D_REENTRANT -fPIC $(DEFINES)
CXXFLAGS = -pipe -O2 -Wall -W -D_REENTRANT -fPIC $(DEFINES)
INCPATH = -I. -I. -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtNetwork -isystem /usr/include/qt5/QtCore -I. -I. -I/usr/lib64/qt5/mkspecs/linux-g++
QMAKE = /usr/bin/qmake-qt5
DEL_FILE = rm -f
CHK_DIR_EXISTS= test -d
MKDIR = mkdir -p
COPY = cp -f
COPY_FILE = cp -f
COPY_DIR = cp -f -R
INSTALL_FILE = install -m 644 -p
INSTALL_PROGRAM = install -m 755 -p
INSTALL_DIR = cp -f -R
DEL_FILE = rm -f
SYMLINK = ln -f -s
DEL_DIR = rmdir
MOVE = mv -f
TAR = tar -cf
COMPRESS = gzip -9f
DISTNAME = Client1.0.0
DISTDIR = /usr/shared/sdr-j-development/systems/dab-cmdline/example-2/client/.tmp/Client1.0.0
LINK = g++
LFLAGS = -Wl,-O1
LIBS = $(SUBLIBS) -lQt5Widgets -lQt5Gui -lQt5Network -lQt5Core -lGL -lpthread
AR = ar cqs
RANLIB =
SED = sed
STRIP = strip
####### Output directory
OBJECTS_DIR = ./
####### Files
SOURCES = client.cpp \
main.cpp moc_client.cpp
OBJECTS = client.o \
main.o \
moc_client.o
DIST = /usr/lib64/qt5/mkspecs/features/spec_pre.prf \
/usr/lib64/qt5/mkspecs/common/unix.conf \
/usr/lib64/qt5/mkspecs/common/linux.conf \
/usr/lib64/qt5/mkspecs/common/sanitize.conf \
/usr/lib64/qt5/mkspecs/common/gcc-base.conf \
/usr/lib64/qt5/mkspecs/common/gcc-base-unix.conf \
/usr/lib64/qt5/mkspecs/common/g++-base.conf \
/usr/lib64/qt5/mkspecs/common/g++-unix.conf \
/usr/lib64/qt5/mkspecs/qconfig.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dcore.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dcore_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dextras.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dextras_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dinput.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dinput_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dlogic.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dlogic_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquick.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquick_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickextras.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickextras_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickinput.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickinput_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickrender.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickrender_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3drender.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3drender_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_bluetooth.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_bluetooth_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_clucene_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_concurrent.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_concurrent_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_core.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_core_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_dbus.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_dbus_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_designer.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_designer_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_designercomponents_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_eglfs_device_lib_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_eglfs_kms_support_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_enginio.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_enginio_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_gui.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_gui_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_help.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_help_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_location.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_location_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_multimedia.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_multimedia_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_multimediawidgets.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_multimediawidgets_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_network.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_network_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_nfc.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_nfc_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_opengl.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_opengl_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_openglextensions.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_openglextensions_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_packetprotocol_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_platformsupport_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_positioning.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_positioning_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_printsupport.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_printsupport_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_qml.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_qml_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_qmldebug_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_qmldevtools_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_qmltest.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_qmltest_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_qtmultimediaquicktools_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_quick.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_quick_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_quickparticles_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_quickwidgets.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_quickwidgets_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_script.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_script_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_scripttools.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_scripttools_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_sensors.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_sensors_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_serialport.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_serialport_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_sql.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_sql_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_svg.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_svg_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_testlib.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_testlib_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_uiplugin.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_uitools.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_uitools_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_waylandclient.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_waylandclient_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_waylandcompositor.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_waylandcompositor_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_webchannel.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_webchannel_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_webkit.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_webkitwidgets.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_websockets.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_websockets_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_widgets.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_widgets_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_x11extras.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_x11extras_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_xcb_qpa_lib_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_xml.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_xml_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_xmlpatterns.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_xmlpatterns_private.pri \
/usr/lib64/qt5/mkspecs/features/qt_functions.prf \
/usr/lib64/qt5/mkspecs/features/qt_config.prf \
/usr/lib64/qt5/mkspecs/linux-g++/qmake.conf \
/usr/lib64/qt5/mkspecs/features/spec_post.prf \
.qmake.stash \
/usr/lib64/qt5/mkspecs/features/exclusive_builds.prf \
/usr/lib64/qt5/mkspecs/features/toolchain.prf \
/usr/lib64/qt5/mkspecs/features/default_pre.prf \
/usr/lib64/qt5/mkspecs/features/resolve_config.prf \
/usr/lib64/qt5/mkspecs/features/default_post.prf \
/usr/lib64/qt5/mkspecs/features/warn_on.prf \
/usr/lib64/qt5/mkspecs/features/qt.prf \
/usr/lib64/qt5/mkspecs/features/resources.prf \
/usr/lib64/qt5/mkspecs/features/moc.prf \
/usr/lib64/qt5/mkspecs/features/unix/opengl.prf \
/usr/lib64/qt5/mkspecs/features/uic.prf \
/usr/lib64/qt5/mkspecs/features/unix/thread.prf \
/usr/lib64/qt5/mkspecs/features/file_copies.prf \
/usr/lib64/qt5/mkspecs/features/testcase_targets.prf \
/usr/lib64/qt5/mkspecs/features/exceptions.prf \
/usr/lib64/qt5/mkspecs/features/yacc.prf \
/usr/lib64/qt5/mkspecs/features/lex.prf \
client.pro client.h \
constants.h client.cpp \
main.cpp
QMAKE_TARGET = Client
DESTDIR =
TARGET = Client
first: all
####### Build rules
$(TARGET): ui_widget.h $(OBJECTS)
$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
Makefile: client.pro /usr/lib64/qt5/mkspecs/linux-g++/qmake.conf /usr/lib64/qt5/mkspecs/features/spec_pre.prf \
/usr/lib64/qt5/mkspecs/common/unix.conf \
/usr/lib64/qt5/mkspecs/common/linux.conf \
/usr/lib64/qt5/mkspecs/common/sanitize.conf \
/usr/lib64/qt5/mkspecs/common/gcc-base.conf \
/usr/lib64/qt5/mkspecs/common/gcc-base-unix.conf \
/usr/lib64/qt5/mkspecs/common/g++-base.conf \
/usr/lib64/qt5/mkspecs/common/g++-unix.conf \
/usr/lib64/qt5/mkspecs/qconfig.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dcore.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dcore_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dextras.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dextras_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dinput.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dinput_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dlogic.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dlogic_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquick.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquick_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickextras.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickextras_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickinput.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickinput_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickrender.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickrender_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3drender.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3drender_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_bluetooth.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_bluetooth_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_clucene_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_concurrent.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_concurrent_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_core.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_core_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_dbus.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_dbus_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_designer.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_designer_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_designercomponents_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_eglfs_device_lib_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_eglfs_kms_support_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_enginio.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_enginio_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_gui.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_gui_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_help.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_help_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_location.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_location_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_multimedia.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_multimedia_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_multimediawidgets.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_multimediawidgets_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_network.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_network_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_nfc.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_nfc_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_opengl.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_opengl_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_openglextensions.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_openglextensions_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_packetprotocol_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_platformsupport_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_positioning.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_positioning_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_printsupport.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_printsupport_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_qml.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_qml_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_qmldebug_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_qmldevtools_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_qmltest.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_qmltest_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_qtmultimediaquicktools_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_quick.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_quick_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_quickparticles_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_quickwidgets.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_quickwidgets_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_script.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_script_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_scripttools.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_scripttools_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_sensors.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_sensors_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_serialport.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_serialport_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_sql.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_sql_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_svg.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_svg_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_testlib.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_testlib_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_uiplugin.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_uitools.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_uitools_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_waylandclient.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_waylandclient_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_waylandcompositor.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_waylandcompositor_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_webchannel.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_webchannel_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_webkit.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_webkitwidgets.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_websockets.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_websockets_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_widgets.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_widgets_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_x11extras.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_x11extras_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_xcb_qpa_lib_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_xml.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_xml_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_xmlpatterns.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_xmlpatterns_private.pri \
/usr/lib64/qt5/mkspecs/features/qt_functions.prf \
/usr/lib64/qt5/mkspecs/features/qt_config.prf \
/usr/lib64/qt5/mkspecs/linux-g++/qmake.conf \
/usr/lib64/qt5/mkspecs/features/spec_post.prf \
.qmake.stash \
/usr/lib64/qt5/mkspecs/features/exclusive_builds.prf \
/usr/lib64/qt5/mkspecs/features/toolchain.prf \
/usr/lib64/qt5/mkspecs/features/default_pre.prf \
/usr/lib64/qt5/mkspecs/features/resolve_config.prf \
/usr/lib64/qt5/mkspecs/features/default_post.prf \
/usr/lib64/qt5/mkspecs/features/warn_on.prf \
/usr/lib64/qt5/mkspecs/features/qt.prf \
/usr/lib64/qt5/mkspecs/features/resources.prf \
/usr/lib64/qt5/mkspecs/features/moc.prf \
/usr/lib64/qt5/mkspecs/features/unix/opengl.prf \
/usr/lib64/qt5/mkspecs/features/uic.prf \
/usr/lib64/qt5/mkspecs/features/unix/thread.prf \
/usr/lib64/qt5/mkspecs/features/file_copies.prf \
/usr/lib64/qt5/mkspecs/features/testcase_targets.prf \
/usr/lib64/qt5/mkspecs/features/exceptions.prf \
/usr/lib64/qt5/mkspecs/features/yacc.prf \
/usr/lib64/qt5/mkspecs/features/lex.prf \
client.pro \
/usr/lib64/libQt5Widgets.prl \
/usr/lib64/libQt5Gui.prl \
/usr/lib64/libQt5Network.prl \
/usr/lib64/libQt5Core.prl
$(QMAKE) -o Makefile client.pro
/usr/lib64/qt5/mkspecs/features/spec_pre.prf:
/usr/lib64/qt5/mkspecs/common/unix.conf:
/usr/lib64/qt5/mkspecs/common/linux.conf:
/usr/lib64/qt5/mkspecs/common/sanitize.conf:
/usr/lib64/qt5/mkspecs/common/gcc-base.conf:
/usr/lib64/qt5/mkspecs/common/gcc-base-unix.conf:
/usr/lib64/qt5/mkspecs/common/g++-base.conf:
/usr/lib64/qt5/mkspecs/common/g++-unix.conf:
/usr/lib64/qt5/mkspecs/qconfig.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dcore.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dcore_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dextras.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dextras_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dinput.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dinput_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dlogic.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dlogic_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquick.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquick_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickextras.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickextras_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickinput.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickinput_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickrender.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickrender_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_3drender.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_3drender_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_bluetooth.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_bluetooth_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_clucene_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_concurrent.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_concurrent_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_core.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_core_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_dbus.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_dbus_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_designer.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_designer_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_designercomponents_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_eglfs_device_lib_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_eglfs_kms_support_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_enginio.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_enginio_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_gui.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_gui_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_help.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_help_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_location.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_location_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_multimedia.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_multimedia_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_multimediawidgets.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_multimediawidgets_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_network.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_network_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_nfc.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_nfc_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_opengl.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_opengl_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_openglextensions.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_openglextensions_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_packetprotocol_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_platformsupport_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_positioning.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_positioning_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_printsupport.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_printsupport_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_qml.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_qml_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_qmldebug_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_qmldevtools_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_qmltest.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_qmltest_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_qtmultimediaquicktools_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_quick.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_quick_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_quickparticles_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_quickwidgets.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_quickwidgets_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_script.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_script_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_scripttools.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_scripttools_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_sensors.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_sensors_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_serialport.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_serialport_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_sql.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_sql_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_svg.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_svg_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_testlib.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_testlib_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_uiplugin.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_uitools.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_uitools_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_waylandclient.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_waylandclient_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_waylandcompositor.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_waylandcompositor_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_webchannel.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_webchannel_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_webkit.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_webkitwidgets.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_websockets.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_websockets_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_widgets.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_widgets_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_x11extras.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_x11extras_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_xcb_qpa_lib_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_xml.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_xml_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_xmlpatterns.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_xmlpatterns_private.pri:
/usr/lib64/qt5/mkspecs/features/qt_functions.prf:
/usr/lib64/qt5/mkspecs/features/qt_config.prf:
/usr/lib64/qt5/mkspecs/linux-g++/qmake.conf:
/usr/lib64/qt5/mkspecs/features/spec_post.prf:
.qmake.stash:
/usr/lib64/qt5/mkspecs/features/exclusive_builds.prf:
/usr/lib64/qt5/mkspecs/features/toolchain.prf:
/usr/lib64/qt5/mkspecs/features/default_pre.prf:
/usr/lib64/qt5/mkspecs/features/resolve_config.prf:
/usr/lib64/qt5/mkspecs/features/default_post.prf:
/usr/lib64/qt5/mkspecs/features/warn_on.prf:
/usr/lib64/qt5/mkspecs/features/qt.prf:
/usr/lib64/qt5/mkspecs/features/resources.prf:
/usr/lib64/qt5/mkspecs/features/moc.prf:
/usr/lib64/qt5/mkspecs/features/unix/opengl.prf:
/usr/lib64/qt5/mkspecs/features/uic.prf:
/usr/lib64/qt5/mkspecs/features/unix/thread.prf:
/usr/lib64/qt5/mkspecs/features/file_copies.prf:
/usr/lib64/qt5/mkspecs/features/testcase_targets.prf:
/usr/lib64/qt5/mkspecs/features/exceptions.prf:
/usr/lib64/qt5/mkspecs/features/yacc.prf:
/usr/lib64/qt5/mkspecs/features/lex.prf:
client.pro:
/usr/lib64/libQt5Widgets.prl:
/usr/lib64/libQt5Gui.prl:
/usr/lib64/libQt5Network.prl:
/usr/lib64/libQt5Core.prl:
qmake: FORCE
@$(QMAKE) -o Makefile client.pro
qmake_all: FORCE
all: Makefile $(TARGET)
dist: distdir FORCE
(cd `dirname $(DISTDIR)` && $(TAR) $(DISTNAME).tar $(DISTNAME) && $(COMPRESS) $(DISTNAME).tar) && $(MOVE) `dirname $(DISTDIR)`/$(DISTNAME).tar.gz . && $(DEL_FILE) -r $(DISTDIR)
distdir: FORCE
@test -d $(DISTDIR) || mkdir -p $(DISTDIR)
$(COPY_FILE) --parents $(DIST) $(DISTDIR)/
$(COPY_FILE) --parents /usr/lib64/qt5/mkspecs/features/data/dummy.cpp $(DISTDIR)/
$(COPY_FILE) --parents client.h constants.h $(DISTDIR)/
$(COPY_FILE) --parents client.cpp main.cpp $(DISTDIR)/
$(COPY_FILE) --parents widget.ui $(DISTDIR)/
clean: compiler_clean
-$(DEL_FILE) $(OBJECTS)
-$(DEL_FILE) *~ core *.core
distclean: clean
-$(DEL_FILE) $(TARGET)
-$(DEL_FILE) .qmake.stash
-$(DEL_FILE) Makefile
####### Sub-libraries
mocclean: compiler_moc_header_clean compiler_moc_source_clean
mocables: compiler_moc_header_make_all compiler_moc_source_make_all
check: first
benchmark: first
compiler_rcc_make_all:
compiler_rcc_clean:
compiler_moc_predefs_make_all: moc_predefs.h
compiler_moc_predefs_clean:
-$(DEL_FILE) moc_predefs.h
moc_predefs.h: /usr/lib64/qt5/mkspecs/features/data/dummy.cpp
g++ -pipe -O2 -Wall -W -dM -E -o moc_predefs.h /usr/lib64/qt5/mkspecs/features/data/dummy.cpp
compiler_moc_header_make_all: moc_client.cpp
compiler_moc_header_clean:
-$(DEL_FILE) moc_client.cpp
moc_client.cpp: constants.h \
ui_widget.h \
header-test.h \
client.h \
moc_predefs.h \
/usr/lib64/qt5/bin/moc
/usr/lib64/qt5/bin/moc $(DEFINES) --include ./moc_predefs.h -I/usr/lib64/qt5/mkspecs/linux-g++ -I/usr/shared/sdr-j-development/systems/dab-cmdline/example-2/client -I/usr/shared/sdr-j-development/systems/dab-cmdline/example-2/client -I/usr/include/qt5 -I/usr/include/qt5/QtWidgets -I/usr/include/qt5/QtGui -I/usr/include/qt5/QtNetwork -I/usr/include/qt5/QtCore -I/usr/include/c++/6.4.1 -I/usr/include/c++/6.4.1/x86_64-redhat-linux -I/usr/include/c++/6.4.1/backward -I/usr/lib/gcc/x86_64-redhat-linux/6.4.1/include -I/usr/local/include -I/usr/include client.h -o moc_client.cpp
compiler_moc_source_make_all:
compiler_moc_source_clean:
compiler_uic_make_all: ui_widget.h
compiler_uic_clean:
-$(DEL_FILE) ui_widget.h
ui_widget.h: widget.ui \
/usr/lib64/qt5/bin/uic
/usr/lib64/qt5/bin/uic widget.ui -o ui_widget.h
compiler_yacc_decl_make_all:
compiler_yacc_decl_clean:
compiler_yacc_impl_make_all:
compiler_yacc_impl_clean:
compiler_lex_make_all:
compiler_lex_clean:
compiler_clean: compiler_moc_predefs_clean compiler_moc_header_clean compiler_uic_clean
####### Compile
client.o: client.cpp client.h \
constants.h \
ui_widget.h \
header-test.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o client.o client.cpp
main.o: main.cpp client.h \
constants.h \
ui_widget.h \
header-test.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp
moc_client.o: moc_client.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_client.o moc_client.cpp
####### Install
install: FORCE
uninstall: FORCE
FORCE:

View File

@@ -1,3 +0,0 @@
Very simple client, for use with the tcpServer that emits the tdc data.

View File

@@ -1,274 +0,0 @@
#
/*
* Copyright (C) 2015
* Jan van Katwijk (J.vanKatwijk@gmail.com)
* Lazy Chair Computing
*
* This file is part of the SDR-J.
* Many of the ideas as implemented in SDR-J are derived from
* other work, made available through the GNU general Public License.
* All copyrights of the original authors are recognized.
*
* SDR-J is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* SDR-J is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SDR-J; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Communication via network to a DAB receiver to
* show the tdc data
*/
#include <QSettings>
#include <QLabel>
#include <QMessageBox>
#include <QtNetwork>
#include <QTcpSocket>
#include <QHostAddress>
#include "client.h"
//
#define swap(a) (((a) << 8) | ((a) >> 8))
//---------------------------------------------------------------------------
uint16_t usCalculCRC (uint8_t *buf, int lg) {
uint16_t crc;
uint count;
crc = 0xFFFF;
for (count= 0; count < lg; count++) {
crc = (uint16_t) (swap (crc) ^ (uint16_t)buf [count]);
crc ^= ((uint8_t)crc) >> 4;
crc = (uint16_t)
(crc ^ (swap((uint8_t)(crc)) << 4) ^ ((uint8_t)(crc) << 5));
}
return ((uint16_t)(crc ^ 0xFFFF));
}
static inline
bool check_crc_bytes (uint8_t *msg, int16_t len) {
int i, j;
uint16_t accumulator = 0xFFFF;
uint16_t crc;
uint16_t genpoly = 0x1021;
for (i = 0; i < len; i ++) {
int16_t data = msg [i] << 8;
for (j = 8; j > 0; j--) {
if ((data ^ accumulator) & 0x8000)
accumulator = ((accumulator << 1) ^ genpoly) & 0xFFFF;
else
accumulator = (accumulator << 1) & 0xFFFF;
data = (data << 1) & 0xFFFF;
}
}
//
// ok, now check with the crc that is contained
// in the au
crc = ~((msg [len] << 8) | msg [len + 1]) & 0xFFFF;
return (crc ^ accumulator) == 0;
}
Client::Client (QWidget *parent):QDialog (parent) {
int16_t i;
setupUi (this);
connected = false;
connect (connectButton, SIGNAL (clicked (void)),
this, SLOT (wantConnect (void)));
connect (terminateButton, SIGNAL (clicked (void)),
this, SLOT (terminate (void)));
state -> setText ("waiting to start");
connectionTimer = new QTimer ();
connectionTimer -> setInterval (1000);
connect (connectionTimer, SIGNAL (timeout (void)),
this, SLOT (timerTick (void)));
}
//
Client::~Client (void) {
connected = false;
}
//
void Client::wantConnect (void) {
QString ipAddress;
int16_t i;
QList<QHostAddress> ipAddressesList = QNetworkInterface::allAddresses();
if (connected)
return;
// use the first non-localhost IPv4 address
for (i = 0; i < ipAddressesList.size(); ++i) {
if (ipAddressesList.at (i) != QHostAddress::LocalHost &&
ipAddressesList. at (i). toIPv4Address ()) {
ipAddress = ipAddressesList. at(i). toString();
break;
}
}
// if we did not find one, use IPv4 localhost
if (ipAddress. isEmpty())
ipAddress = QHostAddress (QHostAddress::LocalHost).toString ();
hostLineEdit -> setText (ipAddress);
hostLineEdit -> setInputMask ("000.000.000.000");
// Setting default IP address
state -> setText ("Give IP address, return");
connect (hostLineEdit, SIGNAL (returnPressed (void)),
this, SLOT (setConnection (void)));
}
// if / when a return is pressed in the line edit,
// a signal appears and we are able to collect the
// inserted text. The format is the IP-V4 format.
// Using this text, we try to connect,
void Client::setConnection (void) {
QString s = hostLineEdit -> text ();
QHostAddress theAddress = QHostAddress (s);
int32_t basePort;
basePort = 8888;
disconnect (hostLineEdit, SIGNAL (returnPressed (void)),
this, SLOT (setConnection (void)));
//
// The streamer will provide us with the raw data
streamer. connectToHost (theAddress, basePort);
if (!streamer. waitForConnected (2000)) {
QMessageBox::warning (this, tr ("client"),
tr ("setting up stream failed\n"));
return;
}
connected = true;
state -> setText ("Connected");
connect (&streamer, SIGNAL (readyRead (void)),
this, SLOT (readData (void)));
connectionTimer -> start (1000);
}
// These functions are typical for network use
void Client::readData (void) {
QByteArray d;
int16_t i;
d. resize (4 * 512);
while (streamer. bytesAvailable () > 4 * 512) {
streamer. read (d. data (), d. size ());
for (i = 0; i < d. size (); i ++)
handle ((uint8_t)(d [i]));
}
}
#define SEARCH_HEADER 0
#define HEADER_FOUND 1
int searchState = SEARCH_HEADER;
void Client::handle (uint8_t d) {
int16_t i;
if (searchState == SEARCH_HEADER) {
headertester. shift (d);
if (headertester. hasHeader ()) {
toRead = headertester. length ();
dataLength = toRead;
dataBuffer = new uint8_t [toRead];
dataIndex = 0;
frameType = headertester. frametype ();
searchState = HEADER_FOUND;
headertester. reset ();
}
return;
}
toRead --;
dataBuffer [dataIndex ++] = d;
if (toRead == 0) {
searchState = SEARCH_HEADER;
if (frameType == 0)
handleFrameType_0 (dataBuffer, dataLength);
else
handleFrameType_1 (dataBuffer, dataLength);
delete[] dataBuffer;
}
}
void Client::terminate (void) {
if (connected) {
streamer. close ();
}
accept ();
}
void Client::timerTick (void) {
if (streamer. state () == QAbstractSocket::UnconnectedState) {
state -> setText ("not connected");
connected = false;
connectionTimer -> stop ();
}
}
void Client::handleFrameType_0 (uint8_t *dataBuffer, int16_t Length) {
fprintf (stderr, "number of services %d\n", dataBuffer [0]);
}
void Client::handleFrameType_1 (uint8_t *dataBuffer, int16_t Length) {
fprintf (stderr, "type 1 %x %x %x %x\n",
dataBuffer [0],
dataBuffer [1], dataBuffer [2], dataBuffer [3]);
if (dataBuffer [3] == 0) { // encryption 0
int16_t index = 4;
while (index < Length) {
int16_t i;
uint8_t sCi = dataBuffer [index];
uint16_t segLen = (dataBuffer [index + 1] << 8) |
dataBuffer [index + 2];
uint16_t crc = (dataBuffer [index + 3] << 8) |
dataBuffer [index + 4];
uint8_t testVector [18];
testVector [0] = sCi;
testVector [1] = dataBuffer [index + 1];
testVector [2] = dataBuffer [index + 2];
for (i = 0; i < 13; i ++)
testVector [i + 3] = dataBuffer [index + i + 5];
testVector [16] = dataBuffer [index + 3];
testVector [17] = dataBuffer [index + 4];
if (usCalculCRC (testVector, 16) == crc)
fprintf (stderr,
"sCi = %o, segLen = %d (index = %d, Length = %d)\n",
sCi, segLen, index, Length);
else {
fprintf (stderr, "failing crc\n");
}
index += segLen + 5;
}
}
else
fprintf (stderr, "encryption not zero\n");
}
bool Client::serviceComponentFrameheaderCRC (uint8_t *data,
int16_t offset,
int16_t maxL) {
uint8_t testVector [18];
int16_t i;
int16_t length = (data [offset + 1] << 8) | data [offset + 2];
int16_t size = length < 13 ? length : 13;
uint16_t crc;
if (length < 0)
return false; // assumed garbage
crc = (data [offset + 3] << 8) | data [offset + 4]; // the crc
testVector [0] = data [offset + 0];
testVector [1] = data [offset + 1];
testVector [2] = data [offset + 2];
for (i = 0; i < size; i ++)
testVector [3 + i] = data [offset + 5 + i];
return usCalculCRC (testVector, 3 + size) == crc;
}

View File

@@ -1,76 +0,0 @@
#
/*
* Copyright (C) 2015
* Jan van Katwijk (J.vanKatwijk@gmail.com)
* Lazy Chair Computing
*
* This file is part of the SDR-J.
* Many of the ideas as implemented in SDR-J are derived from
* other work, made available through the GNU general Public License.
* All copyrights of the original authors are recognized.
*
* SDR-J is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* SDR-J is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SDR-J; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Communication via network to a DAB receiver to
* show the tdc data
*/
#ifndef __TDC_CLIENT__
#define __TDC_CLIENT__
#include "constants.h"
#include <QDialog>
#include <QSettings>
#include <QLabel>
#include <QMessageBox>
#include <QTcpSocket>
#include <QHostAddress>
#include <QTimer>
#include "ui_widget.h"
#include "header-test.h"
//
class Client:public QDialog, public Ui_widget {
Q_OBJECT
public:
Client (QWidget *parent = NULL);
~Client (void);
bool connected;
private slots:
void wantConnect (void);
void setConnection (void);
void readData (void);
void handle (uint8_t);
void terminate (void);
void timerTick (void);
private:
void handleFrameType_0 (uint8_t *, int16_t);
void handleFrameType_1 (uint8_t *, int16_t);
bool serviceComponentFrameheaderCRC (uint8_t *data,
int16_t offset,
int16_t maxL);
QTcpSocket streamer;
QTimer *connectionTimer;
headerTest headertester;
int16_t toRead;
int16_t dataLength;
uint8_t *dataBuffer;
uint8_t frameType;
int16_t dataIndex;
};
#endif

View File

@@ -1,18 +0,0 @@
#
TEMPLATE = app
CONFIG += console
QT += core gui network widgets
INCLUDEPATH += .
HEADERS = ./client.h \
./constants.h
SOURCES = ./client.cpp main.cpp
TARGET = Client
FORMS += ./widget.ui
unix{
DESTDIR = .
}

View File

@@ -1,81 +0,0 @@
#
/*
* Copyright (C) 2011, 2012, 2013
* Jan van Katwijk (J.vanKatwijk@gmail.com)
* Lazy Chair Computing
*
* This file is part of the SDR-J
* Many of the ideas as implemented in SDR-J are derived from
* other work, made available through the GNU general Public License.
* All copyrights of the original authors are recognized.
*
* SDR-J is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* SDR-J is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SDR-J; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#
#ifndef __SOUND_CONSTANTS
#define __SOUND_CONSTANTS
#include <math.h>
#include <complex>
#include <stdint.h>
#include <unistd.h>
#include <limits>
#include "stdlib.h"
using namespace std;
#include <malloc.h>
#ifdef __MINGW32__
#include "windows.h"
#else
#include "alloca.h"
#endif
/*
*/
typedef float DSPFLOAT;
typedef std::complex<DSPFLOAT> DSPCOMPLEX;
#define MINIMUM(x, y) ((x) < (y) ? x : y)
#define MAXIMUM(x, y) ((x) > (y) ? x : y)
// common, simple but useful, functions
static inline
bool isIndeterminate (DSPFLOAT x) {
return x != x;
}
static inline
bool isInfinite (double x) {
return x == numeric_limits<DSPFLOAT>::infinity ();
}
//
static inline
DSPCOMPLEX cmul (DSPCOMPLEX x, float y) {
return DSPCOMPLEX (real (x) * y, imag (x) * y);
}
static inline
DSPCOMPLEX cdiv (DSPCOMPLEX x, float y) {
return DSPCOMPLEX (real (x) / y, imag (x) / y);
}
static inline
float get_db (DSPFLOAT x) {
return 20 * log10 ((x + 1) / (float)(256 * 65536));
}
#endif

View File

@@ -1,102 +0,0 @@
#
/*
* Copyright (C) 2017
* Jan van Katwijk (J.vanKatwijk@gmail.com)
* Lazy Chair Computing
*
* This file is part of the SDR-J
* Many of the ideas as implemented in SDR-J are derived from
* other work, made available through the GNU general Public License.
* All copyrights of the original authors are recognized.
*
* SDR-J is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* SDR-J is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SDR-J; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*
* Simple checker for te package header
*/
#ifndef __HEADER_TEST__
#define __HEADER_TEST__
#include <stdint.h>
#include <stdio.h>
class headerTest {
private:
uint8_t b [8];
int16_t counter;
public:
headerTest (void) {
counter = 0;
}
~headerTest (void) {
}
void shift (uint8_t d) {
if ((counter == 0) && (d == 0xFF)) {
b [counter ++] = 0xFF;
return;
}
if ((counter == 1) && (d == 0x00)) {
b [counter ++] = 0x00;
return;
}
if ((counter == 2) && (d == 0xFF)) {
b [counter ++] = 0xFF;
return;
}
if ((counter == 3) && (d == 0x00)) {
b [counter ++] = 0x00;
return;
}
if (counter == 4) {
b [counter ++] = d;
return;
}
if (counter == 5) {
b [counter ++] = d;
return;
}
if ((counter == 6) && (d == 0x00)) {
b [counter ++] = d;
return;
}
if ((counter == 7) && ((d == 0x00) || (d = 0xFF))) {
b [counter ++] = d;
fprintf (stderr, "header detected, %o %o %o (%d)\n",
b [4], b [5], b [7],
(b [4] << 8) | (b [5] & 0xFF));
return;
}
counter = 0;
}
void reset (void) {
counter = 0;
}
bool hasHeader (void) {
return counter == 8;
}
uint8_t frametype (void) {
return b [7];
}
int16_t length () {
return (b [4] << 8) | b [5];
}
};
#endif

View File

@@ -1,51 +0,0 @@
#
/*
* Copyright (C) 2008, 2009, 2010, 2011, 2012
* Jan van Katwijk (J.vanKatwijk@gmail.com)
* Lazy Chair programming
*
* This file is part of the SDR-J.
* Many of the ideas as implemented in SDR-J are derived from
* other work, made available through the GNU general Public License.
* All copyrights of the original authors are recognized.
*
* SDR-J is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* SDR-J is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SDR-J; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Main program
*/
#include <QApplication>
#include <QDir>
#include "client.h"
#ifdef __MINGW32__
#include "windows.h"
#endif
int main (int argc, char **argv) {
Client *myClient;
QApplication a (argc, argv);
myClient = new Client ();
myClient -> show ();
a. exec ();
/*
* done:
*/
fflush (stdout);
fflush (stderr);
qDebug ("It is done\n");
}

View File

@@ -1,320 +0,0 @@
#
/*
* $Id: pa_ringbuffer.c 1738 2011-08-18 11:47:28Z rossb $
* Portable Audio I/O Library
* Ring Buffer utility.
*
* Author: Phil Burk, http://www.softsynth.com
* modified for SMP safety on Mac OS X by Bjorn Roche
* modified for SMP safety on Linux by Leland Lucius
* also, allowed for const where possible
* modified for multiple-byte-sized data elements by Sven Fischer
*
* Note that this is safe only for a single-thread reader and a
* single-thread writer.
*
* This program uses the PortAudio Portable Audio Library.
* For more information see: http://www.portaudio.com
* Copyright (c) 1999-2000 Ross Bencina and Phil Burk
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files
* (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*
*
* Copyright (C) 2008, 2009, 2010
* Jan van Katwijk (J.vanKatwijk@gmail.com)
* Lazy Chair Computing
*
* The ringbuffer here is a rewrite of the ringbuffer used in the PA code
* All rights remain with their owners
* This file is part of the SDR-J.
* Many of the ideas as implemented in SDR-J are derived from
* other work, made available through the GNU general Public License.
* All copyrights of the original authors are recognized.
*
* SDR-J is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* SDR-J is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SDR-J; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __RINGBUFFER
#define __RINGBUFFER
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>
/*
* a simple ringbuffer, lockfree, however only for a
* single reader and a single writer.
* Mostly used for getting samples from or to the soundcard
*/
#if defined(__APPLE__)
# include <libkern/OSAtomic.h>
/* Here are the memory barrier functions. Mac OS X only provides
full memory barriers, so the three types of barriers are the same,
however, these barriers are superior to compiler-based ones. */
# define PaUtil_FullMemoryBarrier() OSMemoryBarrier()
# define PaUtil_ReadMemoryBarrier() OSMemoryBarrier()
# define PaUtil_WriteMemoryBarrier() OSMemoryBarrier()
#elif defined(__GNUC__)
/* GCC >= 4.1 has built-in intrinsics. We'll use those */
# if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)
# define PaUtil_FullMemoryBarrier() __sync_synchronize()
# define PaUtil_ReadMemoryBarrier() __sync_synchronize()
# define PaUtil_WriteMemoryBarrier() __sync_synchronize()
/* as a fallback, GCC understands volatile asm and "memory" to mean it
* should not reorder memory read/writes */
# elif defined( __PPC__ )
# define PaUtil_FullMemoryBarrier() asm volatile("sync":::"memory")
# define PaUtil_ReadMemoryBarrier() asm volatile("sync":::"memory")
# define PaUtil_WriteMemoryBarrier() asm volatile("sync":::"memory")
# elif defined( __i386__ ) || defined( __i486__ ) || defined( __i586__ ) || defined( __i686__ ) || defined( __x86_64__ )
# define PaUtil_FullMemoryBarrier() asm volatile("mfence":::"memory")
# define PaUtil_ReadMemoryBarrier() asm volatile("lfence":::"memory")
# define PaUtil_WriteMemoryBarrier() asm volatile("sfence":::"memory")
# else
# ifdef ALLOW_SMP_DANGERS
# warning Memory barriers not defined on this system or system unknown
# warning For SMP safety, you should fix this.
# define PaUtil_FullMemoryBarrier()
# define PaUtil_ReadMemoryBarrier()
# define PaUtil_WriteMemoryBarrier()
# else
# error Memory barriers are not defined on this system. You can still compile by defining ALLOW_SMP_DANGERS, but SMP safety will not be guaranteed.
# endif
# endif
#else
# ifdef ALLOW_SMP_DANGERS
# warning Memory barriers not defined on this system or system unknown
# warning For SMP safety, you should fix this.
# define PaUtil_FullMemoryBarrier()
# define PaUtil_ReadMemoryBarrier()
# define PaUtil_WriteMemoryBarrier()
# else
# error Memory barriers are not defined on this system. You can still compile by defining ALLOW_SMP_DANGERS, but SMP safety will not be guaranteed.
# endif
#endif
template <class elementtype>
class RingBuffer {
private:
uint32_t bufferSize;
volatile uint32_t writeIndex;
volatile uint32_t readIndex;
uint32_t bigMask;
uint32_t smallMask;
char *buffer;
public:
RingBuffer (uint32_t elementCount) {
if (((elementCount - 1) & elementCount) != 0)
elementCount = 4 * 16384; /* default */
bufferSize = elementCount;
buffer = new char [2 * bufferSize * sizeof (elementtype)];
writeIndex = 0;
readIndex = 0;
smallMask = (elementCount)- 1;
bigMask = (elementCount * 2) - 1;
}
~RingBuffer () {
delete[] buffer;
}
/*
* functions for checking available data for reading and space
* for writing
*/
uint32_t GetRingBufferReadAvailable (void) {
return (writeIndex - readIndex) & bigMask;
}
//int32_t ReadSpace (void){
// return GetRingBufferReadAvailable ();
//}
uint32_t GetRingBufferWriteAvailable (void) {
return bufferSize - GetRingBufferReadAvailable ();
}
int32_t WriteSpace (void) {
return GetRingBufferWriteAvailable ();
}
void FlushRingBuffer () {
writeIndex = 0;
readIndex = 0;
}
/* ensure that previous writes are seen before we update the write index
(write after write)
*/
int32_t AdvanceRingBufferWriteIndex (int32_t elementCount) {
PaUtil_WriteMemoryBarrier();
return writeIndex = (writeIndex + elementCount) & bigMask;
}
/* ensure that previous reads (copies out of the ring buffer) are
* always completed before updating (writing) the read index.
* (write-after-read) => full barrier
*/
int32_t AdvanceRingBufferReadIndex (int32_t elementCount) {
PaUtil_FullMemoryBarrier();
return readIndex = (readIndex + elementCount) & bigMask;
}
/***************************************************************************
** Get address of region(s) to which we can write data.
** If the region is contiguous, size2 will be zero.
** If non-contiguous, size2 will be the size of second region.
** Returns room available to be written or elementCount, whichever is smaller.
*/
int32_t GetRingBufferWriteRegions (uint32_t elementCount,
void **dataPtr1, int32_t *sizePtr1,
void **dataPtr2, int32_t *sizePtr2 ) {
uint32_t index;
uint32_t available = GetRingBufferWriteAvailable ();
if (elementCount > available)
elementCount = available;
/* Check to see if write is not contiguous. */
index = writeIndex & smallMask;
if ((index + elementCount) > bufferSize ) {
/* Write data in two blocks that wrap the buffer. */
int32_t firstHalf = bufferSize - index;
*dataPtr1 = &buffer[index * sizeof(elementtype)];
*sizePtr1 = firstHalf;
*dataPtr2 = &buffer [0];
*sizePtr2 = elementCount - firstHalf;
}
else { // fits
*dataPtr1 = &buffer [index * sizeof(elementtype)];
*sizePtr1 = elementCount;
*dataPtr2 = NULL;
*sizePtr2 = 0;
}
if (available > 0)
PaUtil_FullMemoryBarrier(); /* (write-after-read) => full barrier */
return elementCount;
}
/***************************************************************************
** Get address of region(s) from which we can read data.
** If the region is contiguous, size2 will be zero.
** If non-contiguous, size2 will be the size of second region.
** Returns room available to be read or elementCount, whichever is smaller.
*/
int32_t GetRingBufferReadRegions (uint32_t elementCount,
void **dataPtr1, int32_t *sizePtr1,
void **dataPtr2, int32_t *sizePtr2) {
uint32_t index;
uint32_t available = GetRingBufferReadAvailable (); /* doesn't use memory barrier */
if (elementCount > available)
elementCount = available;
/* Check to see if read is not contiguous. */
index = readIndex & smallMask;
if ((index + elementCount) > bufferSize) {
/* Write data in two blocks that wrap the buffer. */
int32_t firstHalf = bufferSize - index;
*dataPtr1 = &buffer [index * sizeof(elementtype)];
*sizePtr1 = firstHalf;
*dataPtr2 = &buffer [0];
*sizePtr2 = elementCount - firstHalf;
}
else {
*dataPtr1 = &buffer [index * sizeof(elementtype)];
*sizePtr1 = elementCount;
*dataPtr2 = NULL;
*sizePtr2 = 0;
}
if (available)
PaUtil_ReadMemoryBarrier(); /* (read-after-read) => read barrier */
return elementCount;
}
int32_t putDataIntoBuffer (const void *data, int32_t elementCount) {
int32_t size1, size2, numWritten;
void *data1;
void *data2;
numWritten = GetRingBufferWriteRegions (elementCount,
&data1, &size1,
&data2, &size2 );
if (size2 > 0) {
memcpy (data1, data, size1 * sizeof(elementtype));
data = ((char *)data) + size1 * sizeof(elementtype);
memcpy (data2, data, size2 * sizeof(elementtype));
}
else
memcpy (data1, data, size1 * sizeof(elementtype));
AdvanceRingBufferWriteIndex (numWritten );
return numWritten;
}
int32_t getDataFromBuffer (void *data, int32_t elementCount ) {
int32_t size1, size2, numRead;
void *data1;
void *data2;
numRead = GetRingBufferReadRegions (elementCount,
&data1, &size1,
&data2, &size2 );
if (size2 > 0) {
memcpy (data, data1, size1 * sizeof(elementtype));
data = ((char *)data) + size1 * sizeof(elementtype);
memcpy (data, data2, size2 * sizeof(elementtype));
}
else
memcpy (data, data1, size1 * sizeof(elementtype));
AdvanceRingBufferReadIndex (numRead );
return numRead;
}
int32_t skipDataInBuffer (uint32_t n_values) {
// ensure that we have the correct read and write indices
PaUtil_FullMemoryBarrier ();
if (n_values > GetRingBufferReadAvailable ())
n_values = GetRingBufferReadAvailable ();
AdvanceRingBufferReadIndex (n_values);
return n_values;
}
};
#endif

View File

@@ -1,68 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>widget</class>
<widget class="QDialog" name="widget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>230</width>
<height>195</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<widget class="QPushButton" name="connectButton">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>131</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>connect</string>
</property>
</widget>
<widget class="QLineEdit" name="hostLineEdit">
<property name="geometry">
<rect>
<x>10</x>
<y>30</y>
<width>131</width>
<height>21</height>
</rect>
</property>
</widget>
<widget class="QLabel" name="state">
<property name="geometry">
<rect>
<x>10</x>
<y>130</y>
<width>131</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="terminateButton">
<property name="geometry">
<rect>
<x>150</x>
<y>10</y>
<width>71</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>quit</string>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>

View File

@@ -1,41 +0,0 @@
# http://tim.klingt.org/code/projects/supernova/repository/revisions/d336dd6f400e381bcfd720e96139656de0c53b6a/entry/cmake_modules/FindFFTW3f.cmake
# Modified to use pkg config and use standard var names
# Find single-precision (float) version of FFTW3
INCLUDE(FindPkgConfig)
PKG_CHECK_MODULES(PC_FFTW3F "fftw3f >= 3.0")
FIND_PATH(
FFTW3F_INCLUDE_DIRS
NAMES fftw3.h
HINTS $ENV{FFTW3_DIR}/include
${PC_FFTW3F_INCLUDE_DIR}
PATHS /usr/local/include
/usr/include
)
FIND_LIBRARY(
FFTW3F_LIBRARIES
NAMES fftw3f libfftw3f
HINTS $ENV{FFTW3_DIR}/lib
${PC_FFTW3F_LIBDIR}
PATHS /usr/local/lib
/usr/lib
/usr/lib64
)
FIND_LIBRARY(
FFTW3F_THREADS_LIBRARIES
NAMES fftw3f_threads libfftw3f_threads
HINTS $ENV{FFTW3_DIR}/lib
${PC_FFTW3F_LIBDIR}
PATHS /usr/local/lib
/usr/lib
/usr/lib64
)
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(FFTW3F DEFAULT_MSG FFTW3F_LIBRARIES FFTW3F_INCLUDE_DIRS)
MARK_AS_ADVANCED(FFTW3F_LIBRARIES FFTW3F_INCLUDE_DIRS FFTW3F_THREADS_LIBRARIES)

View File

@@ -1,34 +0,0 @@
# Try to find FAAD library and include path.
# Once done this will define
#
# FAAD_INCLUDE_DIRS - where to find faad.h, etc.
# FAAD_LIBRARIES - List of libraries when using libfaad.
# FAAD_FOUND - True if libfaad found.
find_path(FAAD_INCLUDE_DIR faad.h DOC "The directory where faad.h resides")
find_library(FAAD_LIBRARY NAMES faad DOC "The libfaad library")
if(FAAD_INCLUDE_DIR AND FAAD_LIBRARY)
set(FAAD_FOUND 1)
set(FAAD_LIBRARIES ${FAAD_LIBRARY})
set(FAAD_INCLUDE_DIRS ${FAAD_INCLUDE_DIR})
else(FAAD_INCLUDE_DIR AND FAAD_LIBRARY)
set(FAAD_FOUND 0)
set(FAAD_LIBRARIES)
set(FAAD_INCLUDE_DIRS)
endif(FAAD_INCLUDE_DIR AND FAAD_LIBRARY)
mark_as_advanced(FAAD_INCLUDE_DIR)
mark_as_advanced(FAAD_LIBRARY)
mark_as_advanced(FAAD_FOUND)
if(NOT FAAD_FOUND)
set(FAAD_DIR_MESSAGE "libfaad was not found. Make sure FAAD_LIBRARY and FAAD_INCLUDE_DIR are set.")
if(NOT FAAD_FIND_QUIETLY)
message(STATUS "${FAAD_DIR_MESSAGE}")
else(NOT FAAD_FIND_QUIETLY)
if(FAAD_FIND_REQUIRED)
message(FATAL_ERROR "${FAAD_DIR_MESSAGE}")
endif(FAAD_FIND_REQUIRED)
endif(NOT FAAD_FIND_QUIETLY)
endif(NOT FAAD_FOUND)

View File

@@ -1,28 +0,0 @@
if(NOT LIBAIRSPY_FOUND)
pkg_check_modules (LIBAIRSPY_PKG libairspy)
find_path(LIBAIRSPY_INCLUDE_DIR NAMES libairspy/airspy.h
PATHS
${LIBAIRSPY_PKG_INCLUDE_DIRS}
/usr/include
/usr/local/include
)
find_library(LIBAIRSPY_LIBRARIES NAMES airspy
PATHS
${LIBAIRSPY_PKG_LIBRARY_DIRS}
/usr/lib
/usr/local/lib
)
if(LIBAIRSPY_INCLUDE_DIR AND LIBAIRSPY_LIBRARIES)
set(LIBAIRSPY_FOUND TRUE CACHE INTERNAL "libairspy found")
message(STATUS "Found libairspy: ${LIBAIRSPY_INCLUDE_DIR}, ${LIBAIRSPY_LIBRARIES}")
else(LIBAIRSPY_INCLUDE_DIR AND LIBAIRSPY_LIBRARIES)
set(LIBAIRSPY_FOUND FALSE CACHE INTERNAL "libairspy found")
message(STATUS "libairspy not found.")
endif(LIBAIRSPY_INCLUDE_DIR AND LIBAIRSPY_LIBRARIES)
mark_as_advanced(LIBAIRSPY_INCLUDE_DIR LIBAIRSPY_LIBRARIES)
endif(NOT LIBAIRSPY_FOUND)

View File

@@ -1,28 +0,0 @@
if(NOT LIBRTLSDR_FOUND)
pkg_check_modules (LIBRTLSDR_PKG librtlsdr)
find_path(LIBRTLSDR_INCLUDE_DIR NAMES rtl-sdr.h
PATHS
${LIBRTLSDR_PKG_INCLUDE_DIRS}
/usr/include
/usr/local/include
)
find_library(LIBRTLSDR_LIBRARIES NAMES rtlsdr
PATHS
${LIBRTLSDR_PKG_LIBRARY_DIRS}
/usr/lib
/usr/local/lib
)
if(LIBRTLSDR_INCLUDE_DIR AND LIBRTLSDR_LIBRARIES)
set(LIBRTLSDR_FOUND TRUE CACHE INTERNAL "librtlsdr found")
message(STATUS "Found librtlsdr: ${LIBRTLSDR_INCLUDE_DIR}, ${LIBRTLSDR_LIBRARIES}")
else(LIBRTLSDR_INCLUDE_DIR AND LIBRTLSDR_LIBRARIES)
set(LIBRTLSDR_FOUND FALSE CACHE INTERNAL "librtlsdr found")
message(STATUS "librtlsdr not found.")
endif(LIBRTLSDR_INCLUDE_DIR AND LIBRTLSDR_LIBRARIES)
mark_as_advanced(LIBRTLSDR_INCLUDE_DIR LIBRTLSDR_LIBRARIES)
endif(NOT LIBRTLSDR_FOUND)

View File

@@ -1,20 +0,0 @@
# Find libsamplerate
FIND_PATH(LIBSAMPLERATE_INCLUDE_DIR samplerate.h)
SET(LIBSAMPLERATE_NAMES ${LIBSAMPLERATE_NAMES} samplerate libsamplerate)
FIND_LIBRARY(LIBSAMPLERATE_LIBRARY NAMES ${LIBSAMPLERATE_NAMES} PATH)
IF (LIBSAMPLERATE_INCLUDE_DIR AND LIBSAMPLERATE_LIBRARY)
SET(LIBSAMPLERATE_FOUND TRUE)
ENDIF (LIBSAMPLERATE_INCLUDE_DIR AND LIBSAMPLERATE_LIBRARY)
IF (LIBSAMPLERATE_FOUND)
IF (NOT LibSampleRate_FIND_QUIETLY)
MESSAGE (STATUS "Found LibSampleRate: ${LIBSNDFILE_LIBRARY}")
ENDIF (NOT LibSampleRate_FIND_QUIETLY)
ELSE (LIBSAMPLERATE_FOUND)
IF (LibSampleRate_FIND_REQUIRED)
MESSAGE (FATAL_ERROR "Could not find samplerate")
ENDIF (LibSampleRate_FIND_REQUIRED)
ENDIF (LIBSAMPLERATE_FOUND)

View File

@@ -1,20 +0,0 @@
# Find libsndfile
FIND_PATH(LIBSNDFILE_INCLUDE_DIR sndfile.h)
SET(LIBSNDFILE_NAMES ${LIBSNDFILE_NAMES} sndfile libsndfile)
FIND_LIBRARY(LIBSNDFILE_LIBRARY NAMES ${LIBSNDFILE_NAMES} PATH)
IF (LIBSNDFILE_INCLUDE_DIR AND LIBSNDFILE_LIBRARY)
SET(LIBSNDFILE_FOUND TRUE)
ENDIF (LIBSNDFILE_INCLUDE_DIR AND LIBSNDFILE_LIBRARY)
IF (LIBSNDFILE_FOUND)
IF (NOT LibSndFile_FIND_QUIETLY)
MESSAGE (STATUS "Found LibSndFile: ${LIBSNDFILE_LIBRARY}")
ENDIF (NOT LibSndFile_FIND_QUIETLY)
ELSE (LIBSNDFILE_FOUND)
IF (LibSndFile_FIND_REQUIRED)
MESSAGE (FATAL_ERROR "Could not find sndfile")
ENDIF (LibSndFile_FIND_REQUIRED)
ENDIF (LIBSNDFILE_FOUND)

View File

@@ -1,52 +0,0 @@
# - Try to find Portaudio
# Once done this will define
#
# PORTAUDIO_FOUND - system has Portaudio
# PORTAUDIO_INCLUDE_DIRS - the Portaudio include directory
# PORTAUDIO_LIBRARIES - Link these to use Portaudio
include(FindPkgConfig)
pkg_check_modules(PC_PORTAUDIO portaudio-2.0)
find_path(PORTAUDIO_INCLUDE_DIRS
NAMES
portaudio.h
PATHS
/usr/local/include
/usr/include
HINTS
${PC_PORTAUDIO_INCLUDEDIR}
)
find_library(PORTAUDIO_LIBRARIES
NAMES
portaudio
PATHS
/usr/local/lib
/usr/lib
/usr/lib64
HINTS
${PC_PORTAUDIO_LIBDIR}
)
mark_as_advanced(PORTAUDIO_INCLUDE_DIRS PORTAUDIO_LIBRARIES)
# Found PORTAUDIO, but it may be version 18 which is not acceptable.
if(EXISTS ${PORTAUDIO_INCLUDE_DIRS}/portaudio.h)
include(CheckCXXSourceCompiles)
set(CMAKE_REQUIRED_INCLUDES_SAVED ${CMAKE_REQUIRED_INCLUDES})
set(CMAKE_REQUIRED_INCLUDES ${PORTAUDIO_INCLUDE_DIRS})
CHECK_CXX_SOURCE_COMPILES(
"#include <portaudio.h>\nPaDeviceIndex pa_find_device_by_name(const char *name); int main () {return 0;}"
PORTAUDIO2_FOUND)
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVED})
unset(CMAKE_REQUIRED_INCLUDES_SAVED)
if(PORTAUDIO2_FOUND)
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PORTAUDIO DEFAULT_MSG PORTAUDIO_INCLUDE_DIRS PORTAUDIO_LIBRARIES)
else(PORTAUDIO2_FOUND)
message(STATUS
" portaudio.h not compatible (requires API 2.0)")
set(PORTAUDIO_FOUND FALSE)
endif(PORTAUDIO2_FOUND)
endif()

View File

@@ -1,64 +0,0 @@
# - try to find Qwt libraries and include files
# QWT_INCLUDE_DIR where to find qwt_global.h, etc.
# QWT_LIBRARIES libraries to link against
# QWT_FOUND If false, do not try to use Qwt
# qwt_global.h holds a string with the QWT version;
# test to make sure it's at least 5.2
find_path(QWT_INCLUDE_DIRS
NAMES qwt_global.h
HINTS
${CMAKE_INSTALL_PREFIX}/include/qwt
PATHS
/usr/local/include/qwt-qt4
/usr/local/include/qwt
/usr/include/qwt6
/usr/include/qwt-qt4
/usr/include/qwt-qt4
/usr/include/qwt
/usr/include/qwt5
/usr/include/qwt6-qt5
/opt/local/include/qwt
/sw/include/qwt
/usr/local/lib/qwt.framework/Headers
)
find_library (QWT_LIBRARIES
NAMES qwt6 qwt6-qt5 qwt-qt5 qwt6-qt4 qwt qwt-qt4
HINTS
${CMAKE_INSTALL_PREFIX}/lib
${CMAKE_INSTALL_PREFIX}/lib64
PATHS
/usr/local/lib
/usr/lib
/opt/local/lib
/sw/lib
/usr/local/lib/qwt.framework
)
set(QWT_FOUND FALSE)
if(QWT_INCLUDE_DIRS)
file(STRINGS "${QWT_INCLUDE_DIRS}/qwt_global.h"
QWT_STRING_VERSION REGEX "QWT_VERSION_STR")
set(QWT_WRONG_VERSION True)
set(QWT_VERSION "No Version")
string(REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" QWT_VERSION ${QWT_STRING_VERSION})
string(COMPARE LESS ${QWT_VERSION} "5.2.0" QWT_WRONG_VERSION)
string(COMPARE GREATER ${QWT_VERSION} "6.2.0" QWT_WRONG_VERSION)
message(STATUS "QWT Version: ${QWT_VERSION}")
if(NOT QWT_WRONG_VERSION)
set(QWT_FOUND TRUE)
else(NOT QWT_WRONG_VERSION)
message(STATUS "QWT Version must be >= 5.2 and <= 6.2.0, Found ${QWT_VERSION}")
endif(NOT QWT_WRONG_VERSION)
endif(QWT_INCLUDE_DIRS)
if(QWT_FOUND)
# handle the QUIETLY and REQUIRED arguments and set QWT_FOUND to TRUE if
# all listed variables are TRUE
include ( FindPackageHandleStandardArgs )
find_package_handle_standard_args( Qwt DEFAULT_MSG QWT_LIBRARIES QWT_INCLUDE_DIRS )
MARK_AS_ADVANCED(QWT_LIBRARIES QWT_INCLUDE_DIRS)
endif(QWT_FOUND)

View File

@@ -1,20 +0,0 @@
# Find zlib
FIND_PATH(ZLIB_INCLUDE_DIR zlib.h)
SET(ZLIB_NAMES ${ZLIB_NAMES} libz z)
FIND_LIBRARY(ZLIB_LIBRARY NAMES ${ZLIB_NAMES} PATH)
IF (ZLIB_INCLUDE_DIR AND ZLIB_LIBRARY)
SET(ZLIB_FOUND TRUE)
ENDIF (ZLIB_INCLUDE_DIR AND ZLIB_LIBRARY)
IF (ZLIB_FOUND)
IF (NOT zlib_FIND_QUIETLY)
MESSAGE (STATUS "Found zlib: ${ZLIBFILE_LIBRARY}")
ENDIF (NOT zlib_FIND_QUIETLY)
ELSE (ZLIB_FOUND)
IF (zlib_FIND_REQUIRED)
MESSAGE (FATAL_ERROR "Could not find zlib")
ENDIF (zlib_FIND_REQUIRED)
ENDIF (ZLIB_FOUND)

View File

@@ -1,21 +0,0 @@
if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
string(REGEX REPLACE "\n" ";" files "${files}")
foreach(file ${files})
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
exec_program(
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
OUTPUT_VARIABLE rm_out
RETURN_VALUE rm_retval
)
if(NOT "${rm_retval}" STREQUAL 0)
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
endif(NOT "${rm_retval}" STREQUAL 0)
else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
endforeach(file)

View File

@@ -1,673 +0,0 @@
#
/*
* Copyright (C) 2018
* Hayati Ayguen (h_ayguen@web.de)
*
* DAB-library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* DAB-library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DAB-library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "dab_tables.h"
#include <string.h>
#include <stdlib.h>
// ETSI TS 101 756 V2.2.1: Registered Tables
// for Extended Country Code, Country Id, Language Code,
// Program Type, User Application Type, Content Type
// https://www.etsi.org/deliver/etsi_ts/101700_101799/101756/02.02.01_60/ts_101756v020201p.pdf
// ETSI TR 101 496-3 V1.1.2
// protection level/classes, ..
// https://www.etsi.org/deliver/etsi_tr/101400_101499/10149603/01.01.02_60/tr_10149603v010102p.pdf
static const char *uep_rates [] = {"7/20", "2/5", "1/2", "3/5"};
static const char *eep_Arates[] = {"1/4", "3/8", "1/2", "3/4"}; // see ETSI EN 300 401 V1.3.2 (2000-09), Table 8, page 46
static const char *eep_Brates[] = {"4/9", "4/7", "4/6", "4/5"}; // see ETSI EN 300 401 V1.3.2 (2000-09), Table 9, page 46
struct country_codes {
uint8_t ecc;
uint8_t countryId;
const char *countryName;
};
// following countryTable[] is sorted over all regions to make
// it easier to find "missing" / "old" but still unused entries.
// achieved by searching old standard tables document for each ECC code.
// Table 3: ITU Region 1 - European broadcasting area
// Table 4: ITU Region 1 - African broadcasting area
// Table 6: ITU Region 2 - North and South Americas
// Table 7: ITU Region 3 - Asia and Pacific
static country_codes countryTable[] = {
{0xA0, 0x1, "United States of America"},
{0xA0, 0x2, "United States of America"},
{0xA0, 0x3, "United States of America"},
{0xA0, 0x4, "United States of America"},
{0xA0, 0x5, "United States of America"},
{0xA0, 0x6, "United States of America"},
{0xA0, 0x7, "United States of America"},
{0xA0, 0x8, "United States of America"},
{0xA0, 0x9, "United States of America"},
{0xA0, 0xA, "United States of America"},
{0xA0, 0xB, "United States of America"},
{0xA0, 0xC, "United States of America"},
{0xA0, 0xD, "United States of America"},
{0xA0, 0xE, "United States of America"},
{0xA1, 0xC, "Canada"},
{0xA1, 0xF, "Greenland"},
{0xA2, 0x1, "Anguilla"},
{0xA2, 0x2, "Antigua and Barbuda"},
{0xA2, 0x3, "Equador"},
{0xA2, 0x4, "Falkland Islands"},
{0xA2, 0x5, "Barbados"},
{0xA2, 0x6, "Belize"},
{0xA2, 0x7, "Cayman Islands"},
{0xA2, 0x8, "Costa Rica"},
{0xA2, 0x9, "Cuba"},
{0xA2, 0xA, "Argentina"},
{0xA2, 0xB, "Brazil"},
{0xA2, 0xC, "Bermuda"},
{0xA2, 0xD, "Netherlands Antilles"},
{0xA2, 0xE, "Guadeloupe"},
{0xA2, 0xF, "Bahamas"},
{0xA3, 0x1, "Bolivia"},
{0xA3, 0x2, "Colombia"},
{0xA3, 0x3, "Jamaica"},
{0xA3, 0x4, "Martinique"},
{0xA3, 0x6, "Paraguay"},
{0xA3, 0x7, "Nicaragua"},
{0xA3, 0x8, "Puerto Rico"},
{0xA3, 0x9, "Panama"},
{0xA3, 0xA, "Dominica"},
{0xA3, 0xB, "Dominican Republic"},
{0xA3, 0xC, "Chile"},
{0xA3, 0xD, "Grenada"},
{0xA3, 0xE, "Turks and Caicos islands"},
{0xA3, 0xF, "Guyana"},
{0xA4, 0x1, "Guatemala"},
{0xA4, 0x2, "Honduras"},
{0xA4, 0x3, "Aruba"},
{0xA4, 0x5, "Montserrat"},
{0xA4, 0x6, "Trinidad and Tobago"},
{0xA4, 0x7, "Peru"},
{0xA4, 0x8, "Surinam"},
{0xA4, 0x9, "Uruguay"},
{0xA4, 0xA, "St. Kitts"},
{0xA4, 0xB, "St. Lucia"},
{0xA4, 0xC, "El Salvador"},
{0xA4, 0xD, "Haiti"},
{0xA4, 0xE, "Venezuela"},
{0xA4, 0xF, "Mexico"},
{0xA5, 0xC, "St. Vincent"},
{0xA5, 0xF, "Virgin islands (British or USA)"}, // British and USA have same IDs! amended "or USA"
{0xA5, 0xF, "Virgin islands (USA)"}, // keep this entry .. doesn't hurt
{0xA6, 0xF, "St. Pierre and Miquelon"},
{0xD0, 0x1, "Cameroon"},
{0xD0, 0x2, "Central African Republic"},
{0xD0, 0x3, "Djibouti"},
{0xD0, 0x4, "Madagascar"},
{0xD0, 0x5, "Mali"},
{0xD0, 0x6, "Angola"},
{0xD0, 0x7, "Equatorial Guinea"},
{0xD0, 0x8, "Gabon"},
{0xD0, 0x9, "Republic of Guinea"},
{0xD0, 0xA, "South Africa"},
{0xD0, 0xB, "Burkina Faso"},
{0xD0, 0xC, "Congo"},
{0xD0, 0xD, "Togo"},
{0xD0, 0xE, "Benin"},
{0xD0, 0xF, "Malawi"},
{0xD1, 0x1, "Namibia"},
{0xD1, 0x2, "Liberia"},
{0xD1, 0x3, "Ghana"},
{0xD1, 0x4, "Mauritania"},
{0xD1, 0x5, "Sao Tome & Principe"},
{0xD1, 0x6, "Cape Verde"},
{0xD1, 0x7, "Senegal"},
{0xD1, 0x8, "Gambia"},
{0xD1, 0x9, "Burundi"},
{0xD1, 0xA, "Ascension island"},
{0xD1, 0xB, "Botswana"},
{0xD1, 0xC, "Comoros"},
{0xD1, 0xD, "Tanzania"},
{0xD1, 0xE, "Ethiopia"},
{0xD1, 0xF, "Nigeria"},
{0xD2, 0x1, "Sierra Leone"},
{0xD2, 0x2, "Zimbabwe"},
{0xD2, 0x3, "Mozambique"},
{0xD2, 0x4, "Uganda"},
{0xD2, 0x5, "Swaziland"},
{0xD2, 0x6, "Kenya"},
{0xD2, 0x7, "Somalia"},
{0xD2, 0x8, "Niger"},
{0xD2, 0x9, "Chad"},
{0xD2, 0xA, "Guinea-Bissau"},
{0xD2, 0xB, "Zaire"},
{0xD2, 0xC, "Cote d'Ivoire"},
{0xD2, 0xD, "Zanzibar"},
{0xD2, 0xE, "Zambia"},
{0xD3, 0x3, "Western Sahara"},
{0xD3, 0x4, "Cabinda"}, // was in V1.4.1. was removed later. but IDs are unused .. so keep it here
{0xD3, 0x5, "Rwanda"},
{0xD3, 0x6, "Lesotho"},
{0xD3, 0x8, "Seychelles"},
{0xD3, 0xA, "Mauritius"},
{0xD3, 0xC, "Sudan"},
{0xE0, 0x1, "Germany"},
{0xE0, 0x2, "Algeria"},
{0xE0, 0x3, "Andorra"},
{0xE0, 0x4, "Israel"},
{0xE0, 0x5, "Italy"},
{0xE0, 0x6, "Belgium"},
{0xE0, 0x7, "Russian Federation"},
{0xE0, 0x8, "Azores (Portugal)"}, // was in V1.4.1. was removed later. but IDs are unused .. so keep it here
{0xE0, 0x9, "Albania"},
{0xE0, 0xA, "Austria"},
{0xE0, 0xB, "Hungary"},
{0xE0, 0xC, "Malta"},
{0xE0, 0xD, "Germany"},
{0xE0, 0xE, "Canary Islands (Spain)"}, // amended "(Spain)"
{0xE0, 0xF, "Egypt"},
{0xE1, 0x1, "Greece"},
{0xE1, 0x2, "Cyprus"},
{0xE1, 0x3, "San Marino"},
{0xE1, 0x4, "Switzerland"},
{0xE1, 0x5, "Jordan"},
{0xE1, 0x6, "Finland"},
{0xE1, 0x7, "Luxembourg"},
{0xE1, 0x8, "Bulgaria"},
{0xE1, 0x9, "Faroe (Denmark)"},
{0xE1, 0xA, "Gibraltar (UK)"}, // amended "(UK)"
{0xE1, 0xB, "Iraq"},
{0xE1, 0xC, "United Kingdom"},
{0xE1, 0xD, "Libya"},
{0xE1, 0xE, "Romania"},
{0xE1, 0xF, "France"},
{0xE2, 0x1, "Marocco"},
{0xE2, 0x2, "Czech Republic"},
{0xE2, 0x3, "Poland"},
{0xE2, 0x4, "Vatican"},
{0xE2, 0x5, "Slovak Republic"},
{0xE2, 0x6, "Syria"},
{0xE2, 0x7, "Tunisia"},
{0xE2, 0x8, "Madeira"}, // was in V1.4.1. was removed later. but IDs are unused .. so keep it here
{0xE2, 0x9, "Liechtenstein"},
{0xE2, 0xA, "Iceland"},
{0xE2, 0xB, "Monaco"},
{0xE2, 0xC, "Lithuania"},
{0xE2, 0xD, "Serbia"},
{0xE2, 0xE, "Spain"},
{0xE2, 0xF, "Norway"},
{0xE3, 0x1, "Montenegro"},
{0xE3, 0x2, "Ireland"},
{0xE3, 0x3, "Turkey"},
{0xE3, 0x4, "Macedonia"},
{0xE3, 0x5, "Tajikistan"}, // was in V1.4.1. was removed later. but IDs are unused .. so keep it here
{0xE3, 0x8, "Netherlands"},
{0xE3, 0x9, "Latvia"},
{0xE3, 0xA, "Lebanon"},
{0xE3, 0xB, "Azerbaijan"}, // was in V1.4.1. was removed later. but IDs are unused .. so keep it here
{0xE3, 0xC, "Croatia"},
{0xE3, 0xD, "Kazakhstan"}, // was in V1.4.1. was removed later. but IDs are unused .. so keep it here
{0xE3, 0xE, "Sweden"},
{0xE3, 0xF, "Belarus"},
{0xE4, 0x1, "Moldova"},
{0xE4, 0x2, "Estonia"},
{0xE4, 0x3, "Macedonia / Kyrghyzstan"}, // amended "/ Kyrghyzstan" double used Id
{0xE4, 0x3, "Kyrghyzstan"}, // keep this entry .. doesn't hurt
{0xE4, 0x6, "Ukraine"},
{0xE4, 0x7, "Kosovo"},
{0xE4, 0x8, "Portugal"},
{0xE4, 0x9, "Slovenia"},
{0xE4, 0xA, "Armenia"},
{0xE4, 0xB, "Uzbekistan"},
{0xE4, 0xC, "Georgia"},
{0xE4, 0xE, "Turkmenistan"},
{0xE4, 0xF, "Bosnia Herzegovina"},
{0xF0, 0x1, "Australia: Capital Cities (commercial and community)"},
{0xF0, 0x2, "Australia: New South Wales and ACT"},
{0xF0, 0x3, "Australia: Capital Cities (national broadcasters, was Victoria)"},
{0xF0, 0x4, "Australia: Queensland"},
{0xF0, 0x5, "Australia: South and Northern Territory"},
{0xF0, 0x6, "Australia: Western"},
{0xF0, 0x7, "Australia: Victoria and Tasmania"},
{0xF0, 0x8, "Australia: (future, was Northern Territory)"},
{0xF0, 0x9, "Saudi Arabia"},
{0xF0, 0xA, "Afghanistan"},
{0xF0, 0xB, "Myanmar (Burma)"},
{0xF0, 0xC, "China"},
{0xF0, 0xD, "Korea (North)"},
{0xF0, 0xE, "Bahrain"},
{0xF0, 0xF, "Malaysia"},
{0xF1, 0x1, "Kiribati"},
{0xF1, 0x2, "Bhutan"},
{0xF1, 0x3, "Bangladesh"},
{0xF1, 0x4, "Pakistan"},
{0xF1, 0x5, "Fiji"},
{0xF1, 0x6, "Oman"},
{0xF1, 0x7, "Nauru"},
{0xF1, 0x8, "Iran"},
{0xF1, 0x9, "New Zealand"},
{0xF1, 0xA, "Solomon Islands"},
{0xF1, 0xB, "Brunei Darussalam"},
{0xF1, 0xC, "Sri Lanka"},
{0xF1, 0xD, "Taiwan"},
{0xF1, 0xE, "Korea (South)"},
{0xF1, 0xF, "Hong Kong"},
{0xF2, 0x1, "Kuwait"},
{0xF2, 0x2, "Qatar"},
{0xF2, 0x3, "Cambodia"},
{0xF2, 0x4, "Western Samoa"},
{0xF2, 0x5, "India"},
{0xF2, 0x6, "Macau"},
{0xF2, 0x7, "Vietnam"},
{0xF2, 0x8, "Philippines"},
{0xF2, 0x9, "Japan"},
{0xF2, 0xA, "Singapore"},
{0xF2, 0xB, "Maldives"},
{0xF2, 0xC, "Indonesia"},
{0xF2, 0xD, "United Arab Emirates"},
{0xF2, 0xE, "Nepal"},
{0xF2, 0xF, "Vanuatu"},
{0xF3, 0x1, "Laos"},
{0xF3, 0x2, "Thailand"},
{0xF3, 0x3, "Tonga"},
{0xF3, 0x9, "Papua New Guinea"},
{0xF3, 0xB, "Yemen"},
{0xF3, 0xE, "Micronesia"},
{0xF3, 0xF, "Mongolia"},
{0x00, 0x0, nullptr }
};
// from Table 2a
const char * getASCTy(int16_t ASCTy) {
switch (ASCTy) {
case 0: return "DAB";
case 63: return "DAB+";
default: return "unknown";
}
}
// from Table 2b
const char * getDSCTy(int16_t DSCTy) {
switch (DSCTy) {
case 1: return "Traffic Message CHannel (TMC)";
case 2: return "Emergency Warning System (EWS)";
case 3: return "Interactive Text Transmission System (ITTS)";
case 4: return "Paging";
case 5: return "Transparent Data Channel (TDC)";
case 24: return "MPEG-2 Transport Stream";
case 59: return "Embedded IP packets";
case 60: return "Multimedia Object Transfer (MOT)";
case 61: return "Proprietary service";
default: return "unknown";
}
}
// from Table 9 and 10
const char * getLanguage (int16_t language) {
switch (language) {
case 0x00: return "Unknown/not applicable";
case 0x01: return "Albanian";
case 0x02: return "Breton";
case 0x03: return "Catalan";
case 0x04: return "Croatian";
case 0x05: return "Welsh";
case 0x06: return "Czech";
case 0x07: return "Danish";
case 0x08: return "German";
case 0x09: return "English";
case 0x0A: return "Spanish";
case 0x0B: return "Esperanto";
case 0x0C: return "Estonian";
case 0x0D: return "Basque";
case 0x0E: return "Faroese";
case 0x0F: return "French";
case 0x10: return "Frisian";
case 0x11: return "Irish";
case 0x12: return "Gaelic";
case 0x13: return "Galician";
case 0x14: return "Icelandic";
case 0x15: return "Italian";
case 0x16: return "Sami";
case 0x17: return "Latin";
case 0x18: return "Latvian";
case 0x19: return "Luxembourgian";
case 0x1A: return "Lithuanian";
case 0x1B: return "Hungarian";
case 0x1C: return "Maltese";
case 0x1D: return "Dutch";
case 0x1E: return "Norwegian";
case 0x1F: return "Occitan";
case 0x20: return "Polish";
case 0x21: return "Portuguese";
case 0x22: return "Romanian";
case 0x23: return "Romansh";
case 0x24: return "Serbian";
case 0x25: return "Slovak";
case 0x26: return "Slovene";
case 0x27: return "Finnish";
case 0x28: return "Swedish";
case 0x29: return "Turkish";
case 0x2A: return "Flemish";
case 0x2B: return "Walloon";
case 0x30: // no break
case 0x31: // no break
case 0x32: // no break
case 0x33: // no break
case 0x34: // no break
case 0x35: // no break
case 0x36: // no break
case 0x37: // no break
case 0x38: // no break
case 0x39: // no break
case 0x3A: // no break
case 0x3B: // no break
case 0x3C: // no break
case 0x3D: // no break
case 0x3E: // no break
case 0x3F: return "Reserved for national assignment";
case 0x7F: return "Amharic";
case 0x7E: return "Arabic";
case 0x7D: return "Armenian";
case 0x7C: return "Assamese";
case 0x7B: return "Azerbaijani";
case 0x7A: return "Bambora";
case 0x79: return "Belorussian";
case 0x78: return "Bengali";
case 0x77: return "Bulgarian";
case 0x76: return "Burmese";
case 0x75: return "Chinese";
case 0x74: return "Chuvash";
case 0x73: return "Dari";
case 0x72: return "Fulani";
case 0x71: return "Georgian";
case 0x70: return "Greek";
case 0x6F: return "Gujurati";
case 0x6E: return "Gurani";
case 0x6D: return "Hausa";
case 0x6C: return "Hebrew";
case 0x6B: return "Hindi";
case 0x6A: return "Indonesian";
case 0x69: return "Japanese";
case 0x68: return "Kannada";
case 0x67: return "Kazakh";
case 0x66: return "Khmer";
case 0x65: return "Korean";
case 0x64: return "Laotian";
case 0x63: return "Macedonian";
case 0x62: return "Malagasay";
case 0x61: return "Malaysian";
case 0x60: return "Moldavian";
case 0x5F: return "Marathi";
case 0x5E: return "Ndebele";
case 0x5D: return "Nepali";
case 0x5C: return "Oriya";
case 0x5B: return "Papiamento";
case 0x5A: return "Persian";
case 0x59: return "Punjabi";
case 0x58: return "Pushtu";
case 0x57: return "Quechua";
case 0x56: return "Russian";
case 0x55: return "Rusyn";
case 0x54: return "Serbo-Croat";
case 0x53: return "Shona";
case 0x52: return "Sinhalese";
case 0x51: return "Somali";
case 0x50: return "Sranan Tongo";
case 0x4F: return "Swahili";
case 0x4E: return "Tadzhik";
case 0x4D: return "Tamil";
case 0x4C: return "Tatar";
case 0x4B: return "Telugu";
case 0x4A: return "Thai";
case 0x49: return "Ukranian";
case 0x48: return "Urdu";
case 0x47: return "Uzbek";
case 0x46: return "Vietnamese";
case 0x45: return "Zulu";
case 0x40: return "Background sound/clean feed";
default: return "unknown";
}
}
const char *getCountry (uint8_t ecc, uint8_t countryId) {
int16_t i = 0;
while (countryTable [i].ecc != 0) {
if ((countryTable[i].ecc == ecc) &&
(countryTable[i].countryId == countryId) )
return countryTable[i].countryName;
++i;
}
return nullptr;
}
// from Table 12
const char *getProgramType_Not_NorthAmerica (int16_t programType) {
switch (programType) {
case 0: return "No programme type";
case 1: return "News";
case 2: return "Current Affairs";
case 3: return "Information";
case 4: return "Sport";
case 5: return "Education";
case 6: return "Drama";
case 7: return "Culture";
case 8: return "Science";
case 9: return "Varied"; //Talk
case 10: return "Pop Music";
case 11: return "Rock Music";
case 12: return "Easy Listening Music";
case 13: return "Light Classical";
case 14: return "Serious Classical";
case 15: return "Other Music";
case 16: return "Weather/meteorology";
case 17: return "Finance/Business";
case 18: return "Children's programmes";
case 19: return "Social Affairs"; //Factual
case 20: return "Religion";
case 21: return "Phone In";
case 22: return "Travel";
case 23: return "Leisure";
case 24: return "Jazz Music";
case 25: return "Country Music";
case 26: return "National Music";
case 27: return "Oldies Music";
case 28: return "Folk Music";
case 29: return "Documentary";
case 30: return "unknown programme type 30";
case 31: return "unknown programme type 31";
default: return "unknown programme type";
}
}
// from Table 13
const char *getProgramType_For_NorthAmerica (int16_t programType) {
switch (programType) {
case 0: return "No programme type";
case 1: return "News";
case 2: return "Information";
case 3: return "Sports";
case 4: return "Talk";
case 5: return "Rock";
case 6: return "Classic Rock";
case 7: return "Adult Hits";
case 8: return "Soft Rock";
case 9: return "Top 40";
case 10: return "Country";
case 11: return "Oldies";
case 12: return "Soft";
case 13: return "Nostalgia";
case 14: return "Jazz";
case 15: return "Classical";
case 16: return "Rhythm and Blues";
case 17: return "Soft Rhythm and Blues";
case 18: return "Foreign Language";
case 19: return "Religious Music";
case 20: return "Religious Talk";
case 21: return "Personality";
case 22: return "Public";
case 23: return "College";
case 24: return "unknown programme type 24";
case 25: return "unknown programme type 25";
case 26: return "unknown programme type 26";
case 27: return "unknown programme type 27";
case 28: return "unknown programme type 28";
case 29: return "Weather";
case 30: return "unknown programme type 30";
case 31: return "unknown programme type 31";
default: return "unknown programme type";
}
}
const char *getProgramType (bool gotInterTabId,
uint8_t interTabId, int16_t programType) {
if (gotInterTabId && (interTabId == 1))
return getProgramType_Not_NorthAmerica (programType);
else
if (gotInterTabId && (interTabId == 2))
return getProgramType_For_NorthAmerica (programType);
else {
switch (programType) {
case 0: return "unknown programme type 0";
case 1: return "unknown programme type 1";
case 2: return "unknown programme type 2";
case 3: return "unknown programme type 3";
case 4: return "unknown programme type 4";
case 5: return "unknown programme type 5";
case 6: return "unknown programme type 6";
case 7: return "unknown programme type 7";
case 8: return "unknown programme type 8";
case 9: return "unknown programme type 9";
case 10: return "unknown programme type 10";
case 11: return "unknown programme type 11";
case 12: return "unknown programme type 12";
case 13: return "unknown programme type 13";
case 14: return "unknown programme type 14";
case 15: return "unknown programme type 15";
case 16: return "unknown programme type 16";
case 17: return "unknown programme type 17";
case 18: return "unknown programme type 18";
case 19: return "unknown programme type 19";
case 20: return "unknown programme type 20";
case 21: return "unknown programme type 21";
case 22: return "unknown programme type 22";
case 23: return "unknown programme type 23";
case 24: return "unknown programme type 24";
case 25: return "unknown programme type 25";
case 26: return "unknown programme type 26";
case 27: return "unknown programme type 27";
case 28: return "unknown programme type 28";
case 29: return "unknown programme type 29";
case 30: return "unknown programme type 30";
case 31: return "unknown programme type 31";
default: return "unknown programme type";
}
}
return "unknown programme type";
}
// 11-bit from HandleFIG0Extension13, see ETSI TS 101 756 table 16
const char *getUserApplicationType (int16_t appType) {
switch (appType) {
case 1: return "Dynamic labels (X-PAD only)";
case 2: return "MOT Slide Show";
case 3: return "MOT Broadcast Web Site";
case 4: return "TPEG";
case 5: return "DGPS";
case 6: return "TMC";
case 7: return "SPI, was EPG";
case 8: return "DAB Java";
case 9: return "DMB";
case 0x00a: return "IPDC services";
case 0x00b: return "Voice applications";
case 0x00c: return "Middleware";
case 0x00d: return "Filecasting";
case 0x44a: return "Journaline";
default: return "unknown";
}
}
const char * getFECscheme (int16_t FEC_scheme) {
switch (FEC_scheme) {
case 0: return "no FEC";
case 1: return "FEC";
default: return "unknown";
}
}
const char * getProtectionLevel (bool shortForm, int16_t protLevel) {
if (!shortForm) {
switch (protLevel) {
case 0: return "EEP 1-A";
case 1: return "EEP 2-A";
case 2: return "EEP 3-A";
case 3: return "EEP 4-A";
case 4: return "EEP 1-B";
case 5: return "EEP 2-B";
case 6: return "EEP 3-B";
case 7: return "EEP 4-B";
default: return "EEP unknown";
}
}
else {
switch (protLevel) {
case 1: return "UEP 1";
case 2: return "UEP 2";
case 3: return "UEP 3";
case 4: return "UEP 4";
case 5: return "UEP 5";
default: return "UEP unknown";
}
}
}
const char *getCodeRate (bool shortForm, int16_t protLevel) {
int h = protLevel;
if (!shortForm)
return ((h & (1 << 2)) == 0) ?
eep_Arates [h & 03] :
eep_Brates [h & 03]; // EEP -A/-B
else
return uep_rates [h & 03]; // UEP
}

View File

@@ -1,16 +0,0 @@
#pragma once
#include <inttypes.h>
const char * getASCTy(int16_t ASCTy);
const char * getDSCTy(int16_t DSCTy);
const char * getLanguage(int16_t language);
const char * getCountry(uint8_t ecc, uint8_t countryId);
const char * getProgramType_Not_NorthAmerica(int16_t programType);
const char * getProgramType_For_NorthAmerica(int16_t programType);
const char * getProgramType(bool, uint8_t interTabId, int16_t programType);
const char * getUserApplicationType(int16_t appType);
const char * getFECscheme(int16_t FEC_scheme);
const char * getProtectionLevel(bool shortForm, int16_t protLevel);
const char * getCodeRate(bool shortForm, int16_t protLevel);

File diff suppressed because it is too large Load Diff

View File

@@ -1,321 +0,0 @@
#
/*
* $Id: pa_ringbuffer.c 1738 2011-08-18 11:47:28Z rossb $
* Portable Audio I/O Library
* Ring Buffer utility.
*
* Author: Phil Burk, http://www.softsynth.com
* modified for SMP safety on Mac OS X by Bjorn Roche
* modified for SMP safety on Linux by Leland Lucius
* also, allowed for const where possible
* modified for multiple-byte-sized data elements by Sven Fischer
*
* Note that this is safe only for a single-thread reader and a
* single-thread writer.
*
* This program uses the PortAudio Portable Audio Library.
* For more information see: http://www.portaudio.com
* Copyright (c) 1999-2000 Ross Bencina and Phil Burk
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files
* (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*
*
* Copyright (C) 2008, 2009, 2010
* Jan van Katwijk (J.vanKatwijk@gmail.com)
* Lazy Chair Computing
*
* The ringbuffer here is a rewrite of the ringbuffer used in the PA code
* All rights remain with their owners
* This file is part of the SDR-J.
* Many of the ideas as implemented in SDR-J are derived from
* other work, made available through the GNU general Public License.
* All copyrights of the original authors are recognized.
*
* SDR-J is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* SDR-J is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ESDR; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __RINGBUFFER
#define __RINGBUFFER
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>
/*
* a simple ringbuffer, lockfree, however only for a
* single reader and a single writer.
* Mostly used for getting samples from or to the soundcard
*/
#if defined(__APPLE__)
# include <libkern/OSAtomic.h>
/* Here are the memory barrier functions. Mac OS X only provides
full memory barriers, so the three types of barriers are the same,
however, these barriers are superior to compiler-based ones. */
# define PaUtil_FullMemoryBarrier() OSMemoryBarrier()
# define PaUtil_ReadMemoryBarrier() OSMemoryBarrier()
# define PaUtil_WriteMemoryBarrier() OSMemoryBarrier()
#elif defined(__GNUC__)
/* GCC >= 4.1 has built-in intrinsics. We'll use those */
# if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)
# define PaUtil_FullMemoryBarrier() __sync_synchronize()
# define PaUtil_ReadMemoryBarrier() __sync_synchronize()
# define PaUtil_WriteMemoryBarrier() __sync_synchronize()
/* as a fallback, GCC understands volatile asm and "memory" to mean it
* should not reorder memory read/writes */
# elif defined( __PPC__ )
# define PaUtil_FullMemoryBarrier() asm volatile("sync":::"memory")
# define PaUtil_ReadMemoryBarrier() asm volatile("sync":::"memory")
# define PaUtil_WriteMemoryBarrier() asm volatile("sync":::"memory")
# elif defined( __i386__ ) || defined( __i486__ ) || defined( __i586__ ) || defined( __i686__ ) || defined( __x86_64__ )
# define PaUtil_FullMemoryBarrier() asm volatile("mfence":::"memory")
# define PaUtil_ReadMemoryBarrier() asm volatile("lfence":::"memory")
# define PaUtil_WriteMemoryBarrier() asm volatile("sfence":::"memory")
# else
# ifdef ALLOW_SMP_DANGERS
# warning Memory barriers not defined on this system or system unknown
# warning For SMP safety, you should fix this.
# define PaUtil_FullMemoryBarrier()
# define PaUtil_ReadMemoryBarrier()
# define PaUtil_WriteMemoryBarrier()
# else
# error Memory barriers are not defined on this system. You can still compile by defining ALLOW_SMP_DANGERS, but SMP safety will not be guaranteed.
# endif
# endif
#else
# ifdef ALLOW_SMP_DANGERS
# warning Memory barriers not defined on this system or system unknown
# warning For SMP safety, you should fix this.
# define PaUtil_FullMemoryBarrier()
# define PaUtil_ReadMemoryBarrier()
# define PaUtil_WriteMemoryBarrier()
# else
# error Memory barriers are not defined on this system. You can still compile by defining ALLOW_SMP_DANGERS, but SMP safety will not be guaranteed.
# endif
#endif
template <class elementtype>
class RingBuffer {
private:
uint32_t bufferSize;
volatile uint32_t writeIndex;
volatile uint32_t readIndex;
uint32_t bigMask;
uint32_t smallMask;
char *buffer;
public:
RingBuffer (uint32_t elementCount) {
if (((elementCount - 1) & elementCount) != 0)
elementCount = 2 * 16384; /* default */
bufferSize = elementCount;
buffer = new char [2 * bufferSize * sizeof (elementtype)];
writeIndex = 0;
readIndex = 0;
smallMask = (elementCount)- 1;
bigMask = (elementCount * 2) - 1;
}
~RingBuffer () {
delete[] buffer;
}
/*
* functions for checking available data for reading and space
* for writing
*/
int32_t GetRingBufferReadAvailable (void) {
return (writeIndex - readIndex) & bigMask;
}
int32_t ReadSpace (void){
return GetRingBufferReadAvailable ();
}
int32_t GetRingBufferWriteAvailable (void) {
return bufferSize - GetRingBufferReadAvailable ();
}
int32_t WriteSpace (void) {
return GetRingBufferWriteAvailable ();
}
void FlushRingBuffer () {
writeIndex = 0;
readIndex = 0;
}
/* ensure that previous writes are seen before we update the write index
(write after write)
*/
int32_t AdvanceRingBufferWriteIndex (int32_t elementCount) {
PaUtil_WriteMemoryBarrier();
return writeIndex = (writeIndex + elementCount) & bigMask;
}
/* ensure that previous reads (copies out of the ring buffer) are
* always completed before updating (writing) the read index.
* (write-after-read) => full barrier
*/
int32_t AdvanceRingBufferReadIndex (int32_t elementCount) {
PaUtil_FullMemoryBarrier();
return readIndex = (readIndex + elementCount) & bigMask;
}
/***************************************************************************
** Get address of region(s) to which we can write data.
** If the region is contiguous, size2 will be zero.
** If non-contiguous, size2 will be the size of second region.
** Returns room available to be written or elementCount, whichever is smaller.
*/
int32_t GetRingBufferWriteRegions (uint32_t elementCount,
void **dataPtr1, int32_t *sizePtr1,
void **dataPtr2, int32_t *sizePtr2 ) {
uint32_t index;
uint32_t available = GetRingBufferWriteAvailable ();
if (elementCount > available)
elementCount = available;
/* Check to see if write is not contiguous. */
index = writeIndex & smallMask;
if ((index + elementCount) > bufferSize ) {
/* Write data in two blocks that wrap the buffer. */
int32_t firstHalf = bufferSize - index;
*dataPtr1 = &buffer[index * sizeof(elementtype)];
*sizePtr1 = firstHalf;
*dataPtr2 = &buffer [0];
*sizePtr2 = elementCount - firstHalf;
}
else { // fits
*dataPtr1 = &buffer [index * sizeof(elementtype)];
*sizePtr1 = elementCount;
*dataPtr2 = NULL;
*sizePtr2 = 0;
}
if (available > 0)
PaUtil_FullMemoryBarrier(); /* (write-after-read) => full barrier */
return elementCount;
}
/***************************************************************************
** Get address of region(s) from which we can read data.
** If the region is contiguous, size2 will be zero.
** If non-contiguous, size2 will be the size of second region.
** Returns room available to be read or elementCount, whichever is smaller.
*/
int32_t GetRingBufferReadRegions (uint32_t elementCount,
void **dataPtr1, int32_t *sizePtr1,
void **dataPtr2, int32_t *sizePtr2) {
uint32_t index;
uint32_t available = GetRingBufferReadAvailable (); /* doesn't use memory barrier */
if (elementCount > available)
elementCount = available;
/* Check to see if read is not contiguous. */
index = readIndex & smallMask;
if ((index + elementCount) > bufferSize) {
/* Write data in two blocks that wrap the buffer. */
int32_t firstHalf = bufferSize - index;
*dataPtr1 = &buffer [index * sizeof(elementtype)];
*sizePtr1 = firstHalf;
*dataPtr2 = &buffer [0];
*sizePtr2 = elementCount - firstHalf;
}
else {
*dataPtr1 = &buffer [index * sizeof(elementtype)];
*sizePtr1 = elementCount;
*dataPtr2 = NULL;
*sizePtr2 = 0;
}
if (available)
PaUtil_ReadMemoryBarrier(); /* (read-after-read) => read barrier */
return elementCount;
}
int32_t putDataIntoBuffer (const void *data, int32_t elementCount) {
int32_t size1, size2, numWritten;
void *data1;
void *data2;
numWritten = GetRingBufferWriteRegions (elementCount,
&data1, &size1,
&data2, &size2 );
if (size2 > 0) {
memcpy (data1, data, size1 * sizeof(elementtype));
data = ((char *)data) + size1 * sizeof(elementtype);
memcpy (data2, data, size2 * sizeof(elementtype));
}
else
memcpy (data1, data, size1 * sizeof(elementtype));
AdvanceRingBufferWriteIndex (numWritten );
return numWritten;
}
int32_t getDataFromBuffer (void *data, int32_t elementCount ) {
int32_t size1, size2, numRead;
void *data1;
void *data2;
numRead = GetRingBufferReadRegions (elementCount,
&data1, &size1,
&data2, &size2 );
if (size2 > 0) {
memcpy (data, data1, size1 * sizeof(elementtype));
data = ((char *)data) + size1 * sizeof(elementtype);
memcpy (data, data2, size2 * sizeof(elementtype));
}
else
memcpy (data, data1, size1 * sizeof(elementtype));
AdvanceRingBufferReadIndex (numRead );
return numRead;
}
int32_t skipDataInBuffer (uint32_t n_values) {
// ensure that we have the correct read and write indices
PaUtil_FullMemoryBarrier ();
if (n_values > GetRingBufferReadAvailable ())
n_values = GetRingBufferReadAvailable ();
AdvanceRingBufferReadIndex (n_values);
return n_values;
}
};
#endif

View File

@@ -1,124 +0,0 @@
#
/*
* Copyright (C) 2016, 2017
* Jan van Katwijk (J.vanKatwijk@gmail.com)
* Lazy Chair Computing
*
* This file is part of the DAB-library
* DAB-library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* DAB-library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DAB-library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Simple streaming server, for e.g. epg data and tpg data
*/
#include <stdint.h>
#include <ringbuffer.h>
#include <arpa/inet.h>
#include "tcp-server.h"
tcpServer::tcpServer (int port) {
buffer = new RingBuffer<uint8_t> (32 * 32768);
connected. store (false);
threadHandle = std::thread (&tcpServer::run, this, port);
}
tcpServer::~tcpServer (void) {
if (running. load ()) {
running. store (false);
usleep (1000);
threadHandle. join ();
}
delete buffer;
}
void tcpServer::sendData (uint8_t *data, int32_t amount) {
if (connected)
buffer -> putDataIntoBuffer (data, amount);
}
#define BUF_SIZE 1024
void tcpServer::run (int port) {
// Variables for writing a server.
/*
* 1. Getting the address data structure.
* 2. Opening a new socket.
* 3. Bind to the socket.
* 4. Listen to the socket.
* 5. Accept Connection.
* 6. Receive Data.
* 7. Close Connection.
*/
int socket_desc , client_sock , c , read_size;
struct sockaddr_in server , client;
//Create socket
socket_desc = socket(AF_INET , SOCK_STREAM , 0);
if (socket_desc == -1) {
fprintf (stderr, "Could not create socket");
return;
}
fprintf (stderr, "Socket created");
running. store (true);
// Prepare the sockaddr_in structure
server.sin_family = AF_INET;
server.sin_addr.s_addr = INADDR_ANY;
server.sin_port = htons (port);
// Bind
if (bind (socket_desc,
(struct sockaddr *)&server , sizeof(server)) < 0) {
// print the error message
perror ("bind failed. Error");
return;
}
fprintf (stderr, "I am now accepting connections ...\n");
// Listen
listen (socket_desc , 3);
while (running) {
// Accept a new connection and return back the socket desciptor
c = sizeof(struct sockaddr_in);
// accept connection from an incoming client
client_sock = accept (socket_desc,
(struct sockaddr *)&client,
(socklen_t*)&c);
if (client_sock < 0) {
perror("accept failed");
return;
}
fprintf (stderr, "Connection accepted");
connected = true;
try {
uint8_t localBuffer [BUF_SIZE];
int16_t amount;
int status;
while (running. load ()) {
while (running. load () &&
(buffer -> GetRingBufferReadAvailable () < BUF_SIZE))
usleep (1000);
amount = buffer -> getDataFromBuffer (localBuffer, BUF_SIZE);
status = send (client_sock, localBuffer, amount ,0);
if (status == -1) {
throw (22);
}
}
}
catch (int e) {}
connected = false;
}
// Close the socket before we finish
close (socket_desc);
running. store (false);
}

View File

@@ -1,51 +0,0 @@
#
/*
* Copyright (C) 2016, 2017
* Jan van Katwijk (J.vanKatwijk@gmail.com)
* Lazy Chair Programming
*
* This file is part of the DAB-library
* DAB-library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* DAB-library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DAB-library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Simple streaming server, for e.g. epg data and tpg data
*/
#ifndef __TCP_SERVER__
#define __TCP_SERVER__
#include <stdint.h>
#include <ringbuffer.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <string>
#include <thread>
#include <unistd.h>
#include <atomic>
class tcpServer {
public:
tcpServer (int);
~tcpServer (void);
void sendData (uint8_t *, int32_t);
void run (int port);
private:
std::thread threadHandle;
RingBuffer<uint8_t> *buffer;
std::atomic<bool> running;
std::atomic<bool> connected;
};
#endif

View File

@@ -305,7 +305,6 @@ endif ()
../library/includes/backend/data/mot
../library/includes/backend/data/journaline
../library/includes/support
../library/includes/support/viterbi_768
/usr/include/
)
@@ -348,7 +347,7 @@ endif ()
../library/includes/backend/data/mot/mot-dir.h
../library/includes/backend/data/mot/mot-object.h
../library/includes/backend/data/data-processor.h
../library/includes/support/viterbi_768/viterbi-768.h
../library/includes/support/viterbi-handler.h
../library/includes/support/protTables.h
../library/includes/support/protection.h
../library/includes/support/uep-protection.h
@@ -396,8 +395,7 @@ endif ()
../library/src/backend/data/mot/mot-dir.cpp
../library/src/backend/data/mot/mot-object.cpp
../library/src/backend/data/data-processor.cpp
../library/src/support/viterbi_768/viterbi-768.cpp
../library/src/support/viterbi_768/spiral-no-sse.c
../library/src/support/viterbi-handler.cpp
../library/src/support/protTables.cpp
../library/src/support/protection.cpp
../library/src/support/eep-protection.cpp

View File

@@ -1,410 +0,0 @@
cmake_minimum_required( VERSION 2.8.11 )
set (objectName dab_cmdline-2)
#set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11 -flto")
#set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -flto")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11 -g")
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -g")
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set (CMAKE_INSTALL_PREFIX "/usr/local/bin" CACHE PATH "default install path" FORCE )
endif()
#set (CMAKE_INSTALL_PREFIX /usr/local/bin)
if(MINGW)
add_definitions ( -municode)
endif()
########################################################################
# select the release build type by default to get optimization flags
########################################################################
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
message(STATUS "Build type not specified: defaulting to release.")
endif(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "")
### make sure our local CMake Modules path comes first
list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake/Modules)
######################################################################
#
########################################################################
if(DEFINED AIRSPY)
set(AIRSPY true)
set(objectName dab-airspy-2a)
endif ()
if(DEFINED SDRPLAY)
set(SDRPLAY true)
set(objectName dab-sdrplay-2a)
endif ()
if(DEFINED RTLSDR)
set(RTLSDR true)
set(objectName dab-rtlsdr-2a)
endif ()
if(DEFINED WAVFILES)
set(WAVFILES true)
set(objectName dab-files-2)
endif ()
if(DEFINED RAWFILES)
set(RAWFILES true)
set(objectName dab-raw-2)
endif ()
if(DEFINED RTL_TCP)
set(RTL_TCP true)
set(objectName dab-rtl_tcp-2)
endif ()
if (DEFINED_SERVER)
add_definitions(-DHAVE_SERVER)
endif ()
#add_definitions (-D__THREADED_DECODING)
#########################################################################
find_package (PkgConfig)
find_package(FFTW3f)
if (NOT FFTW3F_FOUND)
message(FATAL_ERROR "please install FFTW3")
endif ()
find_package(Faad)
if (NOT FAAD_FOUND )
message(FATAL_ERROR "please install libfaad")
endif ()
find_package(LibSndFile)
if (NOT LIBSNDFILE_FOUND)
message(FATAL_ERROR "please install libsndfile")
endif ()
list(APPEND extraLibs ${LIBSNDFILE_LIBRARY})
find_package(LibSampleRate)
if (NOT LIBSAMPLERATE_FOUND)
message(FATAL_ERROR "please install libsamplerate")
endif ()
list(APPEND extraLibs ${LIBSAMPLERATE_LIBRARY})
#########################################################################
find_package (PkgConfig)
##########################################################################
# The devices
#
if (RTL_TCP)
include_directories (
../devices/rtl_tcp
)
set ($(objectName)_HDRS
${${objectName}_HDRS}
../devices/rtl_tcp/rtl_tcp-client.h
)
set (${objectName}_SRCS
${${objectName}_SRCS}
../devices/rtl_tcp/rtl_tcp-client.cpp
)
add_definitions (-DHAVE_RTL_TCP)
endif (RTL_TCP)
if (SDRPLAY)
find_path (SDRPLAYLIB_INCLUDE_DIR
NAMES mirsdrapi-rsp.h
PATHS
/usr/local/include/
)
include_directories (${SDRPLAYLIB_INCLUDE_DIR})
find_library (SDRPLAYLIB mirsdrapi-rsp)
if(NOT(SDRPLAYLIB))
message(FATAL_ERROR "please install -lmirsdrapi-rsp")
else(NOT(SDRPLAYLIB))
list (APPEND extraLibs ${SDRPLAYLIB})
endif(NOT(SDRPLAYLIB))
include_directories (
../devices/sdrplay-handler
)
set ($(objectName)_HDRS
${${objectName}_HDRS}
../devices/sdrplay-handler/sdrplay-handler.h
)
set (${objectName}_SRCS
${${objectName}_SRCS}
../devices/sdrplay-handler/sdrplay-handler.cpp
)
add_definitions (-DHAVE_SDRPLAY)
endif (SDRPLAY)
if (AIRSPY)
find_package(LibAIRSPY)
if (NOT LIBAIRSPY_FOUND)
message(FATAL_ERROR "please install airspy library")
endif ()
### include_directories (${AIRSPYLIB_INCLUDE_DIR})
include_directories (
../devices/airspy-handler
)
set ($(objectName)_HDRS
${${objectName}_HDRS}
../devices/airspy-handler/airspy-handler.h
)
set (${objectName}_SRCS
${${objectName}_SRCS}
../devices/airspy-handler/airspy-handler.cpp
)
add_definitions (-DHAVE_AIRSPY)
endif (AIRSPY)
if (RTLSDR)
find_package(LibRTLSDR)
if (NOT LIBRTLSDR_FOUND)
message(FATAL_ERROR "please install librtlsdr")
endif ()
###include_directories (${RTLSDR_INCLUDE_DIR})
include_directories (
../devices/rtlsdr-handler/
)
set (${objectName}_HDRS
${${objectName}_HDRS}
../devices/rtlsdr-handler/rtlsdr-handler.h
)
set (${objectName}_SRCS
${${objectName}_SRCS}
../devices/rtlsdr-handler/rtlsdr-handler.cpp
)
add_definitions (-DHAVE_RTLSDR)
endif()
find_package(Portaudio)
if (NOT PORTAUDIO_FOUND)
message(FATAL_ERROR "please install portaudio V19")
endif ()
list(APPEND extraLibs ${PORTAUDIO_LIBRARIES})
find_package(zlib)
if (NOT ZLIB_FOUND)
message(FATAL_ERROR "please install libz")
endif ()
list(APPEND extraLibs ${ZLIB_LIBRARY})
find_library (PTHREADS pthread)
if (NOT(PTHREADS))
message (FATAL_ERROR "please install libpthread")
else (NOT(PTHREADS))
set (extraLibs ${extraLibs} ${PTHREADS})
endif (NOT(PTHREADS))
if (WAVFILES)
include_directories (
../devices/wavfiles/
)
set (${objectName}_HDRS
${${objectName}_HDRS}
../devices/wavfiles/wavfiles.h
)
set (${objectName}_SRCS
${${objectName}_SRCS}
../devices/wavfiles/wavfiles.cpp
)
find_package(LibSndFile)
if (NOT LIBSNDFILE_FOUND)
message(FATAL_ERROR "please install libsndfile")
endif ()
list(APPEND extraLibs ${LIBSNDFILE_LIBRARY})
add_definitions (-DHAVE_WAVFILES)
endif()
if (RAWFILES)
include_directories (
../devices/rawfiles/
)
set (${objectName}_HDRS
${${objectName}_HDRS}
../devices/rawfiles/rawfiles.h
)
set (${objectName}_SRCS
${${objectName}_SRCS}
../devices/rawfiles/rawfiles.cpp
)
add_definitions (-DHAVE_RAWFILES)
endif()
#######################################################################
#
# Here we really start
include_directories (
${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
.
./
./server-thread
../
../library
../library/includes
../library/includes/ofdm
../library/includes/backend
../library/includes/backend/audio
../library/includes/backend/data
../library/includes/backend/data/mot
../library/includes/backend/data/journaline
../library/includes/support
../library/includes/support/viterbi_768
/usr/include/
)
set (${objectName}_HDRS
${${objectName}_HDRS}
./ringbuffer.h
./band-handler.h
./audio-base.h
./audiosink.h
./filesink.h
./newconverter.h
./server-thread/tcp-server.h
../dab-api.h
../devices/device-handler.h
../library/includes/dab-constants.h
../library/includes/dab-processor.h
../library/includes/ofdm/phasereference.h
../library/includes/ofdm/phasetable.h
../library/includes/ofdm/freq-interleaver.h
../library/includes/ofdm/timesyncer.h
../library/includes/ofdm/fic-handler.h
../library/includes/ofdm/fib-processor.cpp
../library/includes/ofdm/sample-reader.h
../library/includes/backend/firecode-checker.h
../library/includes/backend/backend-base.h
../library/includes/backend/charsets.h
../library/includes/backend/galois.h
../library/includes/backend/reed-solomon.h
../library/includes/backend/msc-handler.h
../library/includes/backend/virtual-backend.h
../library/includes/backend/audio-backend.h
../library/includes/backend/data-backend.h
../library/includes/backend/audio/faad-decoder.h
../library/includes/backend/audio/mp4processor.h
../library/includes/backend/audio/mp2processor.h
../library/includes/backend/data/virtual-datahandler.h
../library/includes/backend/data/tdc-datahandler.h
../library/includes/backend/data/pad-handler.h
../library/includes/backend/data/mot/mot-handler.h
../library/includes/backend/data/mot/mot-dir.h
../library/includes/backend/data/mot/mot-object.h
../library/includes/backend/data/data-processor.h
../library/includes/support/viterbi_768/viterbi-768.h
../library/includes/support/protTables.h
../library/includes/support/protection.h
../library/includes/support/uep-protection.h
../library/includes/support/eep-protection.h
../library/includes/support/fft_handler.h
../library/includes/support/dab-params.h
../library/includes/support/tii_table.h
)
set (${objectName}_SRCS
${${objectName}_SRCS}
./main.cpp
./audio-base.cpp
./audiosink.cpp
./filesink.cpp
./newconverter.cpp
./band-handler.cpp
./server-thread/tcp-server.cpp
../devices/device-handler.cpp
../library/dab-api.cpp
../library/src/dab-processor.cpp
../library/src/ofdm/ofdm-decoder.cpp
../library/src/ofdm/phasereference.cpp
../library/src/ofdm/phasetable.cpp
../library/src/ofdm/freq-interleaver.cpp
../library/src/ofdm/timesyncer.cpp
../library/src/ofdm/sample-reader.cpp
../library/src/ofdm/fib-processor.cpp
../library/src/ofdm/fic-handler.cpp
../library/src/backend/firecode-checker.cpp
../library/src/backend/backend-base.cpp
../library/src/backend/charsets.cpp
../library/src/backend/galois.cpp
../library/src/backend/reed-solomon.cpp
../library/src/backend/msc-handler.cpp
../library/src/backend/virtual-backend.cpp
../library/src/backend/audio-backend.cpp
../library/src/backend/data-backend.cpp
../library/src/backend/audio/mp4processor.cpp
../library/src/backend/audio/mp2processor.cpp
../library/src/backend/data/virtual-datahandler.cpp
../library/src/backend/data/tdc-datahandler.cpp
../library/src/backend/data/pad-handler.cpp
../library/src/backend/data/mot/mot-handler.cpp
../library/src/backend/data/mot/mot-dir.cpp
../library/src/backend/data/mot/mot-object.cpp
../library/src/backend/data/data-processor.cpp
../library/src/support/viterbi_768/viterbi-768.cpp
../library/src/support/viterbi_768/spiral-no-sse.c
../library/src/support/protTables.cpp
../library/src/support/protection.cpp
../library/src/support/eep-protection.cpp
../library/src/support/uep-protection.cpp
../library/src/support/fft_handler.cpp
../library/src/support/dab-params.cpp
../library/src/support/tii_table.cpp
)
#
include_directories (
${FFTW_INCLUDE_DIRS}
${PORTAUDIO_INCLUDE_DIRS}
${FAAD_INCLUDE_DIRS}
${SNDFILES_INCLUDE_DIRS}
)
#####################################################################
add_executable (${objectName}
${${objectName}_SRCS}
)
target_link_libraries (${objectName}
${FFTW3F_LIBRARIES}
${extraLibs}
${FAAD_LIBRARIES}
${CMAKE_DL_LIBS}
)
INSTALL (TARGETS ${objectName} DESTINATION .)
########################################################################
# Create uninstall target
########################################################################
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)

View File

@@ -1,37 +0,0 @@
Example 2
Example 2 is a simple command line version of the DAB software. The
input device is fixed, depending on a setting in the CMakeLists.txt
file. The output is either to the soundcard (default) or to a file
(-O option).
Other than example 1, it binds directly to the functionality implementing
the DAB decoding.
All callbacks are defined, most of them with an empty body.
See the file main.cpp for the command line options
Feel free to improve the program
Points to note:
bytesOut is a new callback function, a function that is called
from the tdc handler (and later may be from others as well)
The data parameter is a packet with a 4 byte header
byte 0 is 0xFF
byte 1 is 0x00
byte 2 is 0xFF
byte 3 is 0x00
byte 4 is the high byte of the 16 bit size
byte 5 is the low byte of the 16 bit size
byte 6 is 0x00
byte 7 is 0 for packet type 0, 0xFF for packet type 1
Note that the lenngth is the length of the data part, so not taking the
header into account
The bytesOut function puts the data into a simple TCP server that can be
read from port 8888 (depending on the configuration).

View File

@@ -1,189 +0,0 @@
#
/*
* Copyright (C) 2011, 2012, 2013
* Jan van Katwijk (J.vanKatwijk@gmail.com)
* Lazy Chair Computing
*
* This file is part of the main program for the DAB library
*
* DAB library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* DAB library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DAB library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "audio-base.h"
#include <stdio.h>
/*
* The class is the abstract sink for the data generated
* It will handle the "dumping" though
*/
audioBase::audioBase (void):
converter_16 (16000, 48000, 2 * 1600),
converter_24 (24000, 48000, 2 * 2400),
converter_32 (32000, 48000, 4 * 3200) {
}
audioBase::~audioBase (void) {
}
void audioBase::restart (void) {
}
void audioBase::stop (void) {
}
//
// This one is a hack for handling different baudrates coming from
// the aac decoder. call is from the GUI, triggered by the
// aac decoder or the mp2 decoder
void audioBase::audioOut (int16_t *buffer,
int32_t amount, int32_t rate) {
switch (rate) {
case 16000:
audioOut_16000 (NULL, buffer, amount / 2);
return;
case 24000:
audioOut_24000 (NULL, buffer, amount / 2);
return;
case 32000:
audioOut_32000 (NULL, buffer, amount / 2);
return;
default:
case 48000:
audioOut_48000 (NULL, buffer, amount / 2);
return;
}
}
void audioBase::audioOut (SNDFILE *f,
int16_t *buffer,
int32_t amount, int32_t rate) {
switch (rate) {
case 16000:
audioOut_16000 (f, buffer, amount / 2);
return;
case 24000:
audioOut_24000 (f, buffer, amount / 2);
return;
case 32000:
audioOut_32000 (f, buffer, amount / 2);
return;
default:
case 48000:
audioOut_48000 (f, buffer, amount / 2);
return;
}
}
//
// scale up from 16 -> 48
// amount gives number of pairs
void audioBase::audioOut_16000 (SNDFILE *f,
int16_t *V, int32_t amount) {
DSPCOMPLEX outputBuffer [converter_16. getOutputsize ()];
float buffer [2 * converter_16. getOutputsize ()];
int16_t i, j;
int32_t result;
for (i = 0; i < amount; i ++)
if (converter_16. convert (DSPCOMPLEX (V [2 * i] / 32767.0,
V [2 * i + 1] / 32767.0),
outputBuffer, &result)) {
for (j = 0; j < result; j ++) {
buffer [2 * j ] = real (outputBuffer [j]);
buffer [2 * j + 1] = imag (outputBuffer [j]);
}
audioOutput (f, buffer, result);
}
}
// scale up from 24000 -> 48000
// amount gives number of pairs
void audioBase::audioOut_24000 (SNDFILE *f,
int16_t *V, int32_t amount) {
DSPCOMPLEX outputBuffer [converter_24. getOutputsize ()];
float buffer [2 * converter_24. getOutputsize ()];
int16_t i, j;
int32_t result;
for (i = 0; i < amount; i ++)
if (converter_24. convert (DSPCOMPLEX (V [2 * i] / 32767.0,
V [2 * i + 1] / 32767.0),
outputBuffer, &result)) {
for (j = 0; j < result; j ++) {
buffer [2 * j ] = real (outputBuffer [j]);
buffer [2 * j + 1] = imag (outputBuffer [j]);
}
audioOutput (f, buffer, result);
}
}
//
// scale up from 32000 -> 48000
// amount is number of pairs
void audioBase::audioOut_32000 (SNDFILE *f,
int16_t *V, int32_t amount) {
DSPCOMPLEX outputBuffer [converter_32. getOutputsize ()];
float buffer [2 * converter_32. getOutputsize ()];
int32_t i, j;
int32_t result;
for (i = 0; i < amount; i ++) {
if (converter_32. convert (DSPCOMPLEX (V [2 * i] / 32767.0,
V [2 * i + 1] / 32767.0),
outputBuffer, &result)) {
for (j = 0; j < result; j ++) {
buffer [2 * j ] = real (outputBuffer [j]);
buffer [2 * j + 1] = imag (outputBuffer [j]);
}
audioOutput (f, buffer, result);
}
}
}
void audioBase::audioOut_48000 (SNDFILE *f,
int16_t *V, int32_t amount) {
float *buffer = (float *)alloca (2 * amount * sizeof (float));
int32_t i;
for (i = 0; i < amount; i ++) {
buffer [2 * i] = V [2 * i] / 32767.0;
buffer [2 * i + 1] = V [2 * i + 1] / 32767.0;
}
audioOutput (f, buffer, amount);
}
void audioBase::audioOutput (SNDFILE *f, float *V, int32_t amount) {
float *buffer = (float *)alloca (2 * amount * sizeof (float));
int32_t i;
for (i = 0; i < amount; i ++) {
buffer [2 * i] = V [2 * i];
buffer [2 * i + 1] = V [2 * i + 1];
}
if (f != NULL)
sf_writef_float (f, buffer, amount);
else
audioOutput (V, amount);
}
// The audioOut function is the one that really should be
// reimplemented in the offsprings of this class
void audioBase::audioOutput (float *v, int32_t amount) {
(void)v;
(void)amount;
}

View File

@@ -1,60 +0,0 @@
#
/*
* Copyright (C) 2009, 2010, 2011
* Jan van Katwijk (J.vanKatwijk@gmail.com)
* Lazy Chair Computing
*
* This file is part of the main program for the DAB library
*
* DAB library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* DAB library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DAB library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __AUDIO_BASE__
#define __AUDIO_BASE__
#include <stdio.h>
#include <samplerate.h>
#include <sndfile.h>
#include "newconverter.h"
#include "ringbuffer.h"
typedef float DSPFLOAT;
typedef std::complex<DSPFLOAT> DSPCOMPLEX;
using namespace std;
class audioBase {
public:
audioBase (void);
virtual ~audioBase (void);
virtual void stop (void);
virtual void restart (void);
void audioOut (int16_t *, int32_t, int32_t);
void audioOut (SNDFILE *,
int16_t *, int32_t, int32_t);
private:
void audioOut_16000 (SNDFILE *, int16_t *, int32_t);
void audioOut_24000 (SNDFILE *, int16_t *, int32_t);
void audioOut_32000 (SNDFILE *, int16_t *, int32_t);
void audioOut_48000 (SNDFILE *, int16_t *, int32_t);
newConverter converter_16;
newConverter converter_24;
newConverter converter_32;
void audioOutput (SNDFILE *, float *, int32_t);
protected:
virtual void audioOutput (float *, int32_t);
};
#endif

View File

@@ -1,253 +0,0 @@
#
/*
* Copyright (C) 2011, 2012, 2013
* Jan van Katwijk (J.vanKatwijk@gmail.com)
* Lazy Chair Computing
*
* This file is part of the main program of the DAB library
*
* DAB library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* DAB library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DAB library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "audiosink.h"
#include <stdio.h>
/*
*/
audioSink::audioSink (int16_t latency,
std::string soundChannel,
bool *err):
audioBase () {
int32_t i;
this -> latency = latency;
this -> CardRate = 48000;
_O_Buffer = new RingBuffer<float>(2 * 32768);
portAudio = false;
writerRunning = false;
if (Pa_Initialize () != paNoError) {
fprintf (stderr, "Initializing Pa for output failed\n");
return;
}
portAudio = true;
fprintf (stderr, "Hostapis: %d\n", Pa_GetHostApiCount ());
for (i = 0; i < Pa_GetHostApiCount (); i ++)
fprintf (stderr, "Api %d is %s\n", i, Pa_GetHostApiInfo (i) -> name);
numofDevices = Pa_GetDeviceCount ();
outTable = new int16_t [numofDevices + 1];
for (i = 0; i < numofDevices; i ++)
outTable [i] = -1;
ostream = NULL;
*err = !selectDevice (soundChannel);
}
audioSink::~audioSink (void) {
if ((ostream != NULL) && !Pa_IsStreamStopped (ostream)) {
paCallbackReturn = paAbort;
(void) Pa_AbortStream (ostream);
while (!Pa_IsStreamStopped (ostream))
Pa_Sleep (1);
writerRunning = false;
}
if (ostream != NULL)
Pa_CloseStream (ostream);
if (portAudio)
Pa_Terminate ();
delete _O_Buffer;
delete[] outTable;
}
bool audioSink::selectDevice (const std::string soundChannel) {
PaError err;
int16_t odev = 0, i;
fprintf (stderr, "selecting device %s\n", soundChannel. c_str ());
for (i = 0; i < numofDevices; i ++) {
const std::string so =
outputChannelwithRate (i, CardRate);
if (so == std::string (""))
continue;
fprintf (stderr, "device %s seems available as %d\n",
so. c_str (), i);
if (so. find (soundChannel,0) != std::string::npos)
odev = i;
}
if (!isValidDevice (odev)) {
fprintf (stderr, "invalid device (%d) selected\n", odev);
return false;
}
if ((ostream != NULL) && !Pa_IsStreamStopped (ostream)) {
paCallbackReturn = paAbort;
(void) Pa_AbortStream (ostream);
while (!Pa_IsStreamStopped (ostream))
Pa_Sleep (1);
writerRunning = false;
}
if (ostream != NULL)
Pa_CloseStream (ostream);
outputParameters. device = odev;
outputParameters. channelCount = 2;
outputParameters. sampleFormat = paFloat32;
outputParameters. suggestedLatency =
Pa_GetDeviceInfo (odev) ->
defaultHighOutputLatency * latency;
bufSize = (int)((float)outputParameters. suggestedLatency);
bufSize = latency * 128;
outputParameters. hostApiSpecificStreamInfo = NULL;
//
fprintf (stderr, "Suggested size for outputbuffer = %d\n", bufSize);
err = Pa_OpenStream (&ostream,
NULL,
&outputParameters,
CardRate,
bufSize,
0,
this -> paCallback_o,
this
);
if (err != paNoError) {
fprintf (stderr, "Open ostream error\n");
return false;
}
paCallbackReturn = paContinue;
err = Pa_StartStream (ostream);
if (err != paNoError) {
fprintf (stderr, "Open startstream error\n");
return false;
}
writerRunning = true;
return true;
}
void audioSink::restart (void) {
PaError err;
if (!Pa_IsStreamStopped (ostream))
return;
_O_Buffer -> FlushRingBuffer ();
paCallbackReturn = paContinue;
err = Pa_StartStream (ostream);
if (err == paNoError)
writerRunning = true;
}
void audioSink::stop (void) {
if (Pa_IsStreamStopped (ostream))
return;
paCallbackReturn = paAbort;
(void)Pa_StopStream (ostream);
while (!Pa_IsStreamStopped (ostream))
Pa_Sleep (1);
writerRunning = false;
}
//
// helper
bool audioSink::OutputrateIsSupported (int16_t device, int32_t Rate) {
PaStreamParameters *outputParameters =
(PaStreamParameters *)alloca (sizeof (PaStreamParameters));
outputParameters -> device = device;
outputParameters -> channelCount = 2; /* I and Q */
outputParameters -> sampleFormat = paFloat32;
outputParameters -> suggestedLatency = 0;
outputParameters -> hostApiSpecificStreamInfo = NULL;
return Pa_IsFormatSupported (NULL, outputParameters, Rate) ==
paFormatIsSupported;
}
/*
* ... and the callback
*/
int audioSink::paCallback_o (
const void* inputBuffer,
void* outputBuffer,
unsigned long framesPerBuffer,
const PaStreamCallbackTimeInfo *timeInfo,
PaStreamCallbackFlags statusFlags,
void *userData) {
RingBuffer<float> *outB;
float *outp = (float *)outputBuffer;
audioSink *ud = reinterpret_cast <audioSink *>(userData);
uint32_t actualSize;
uint32_t i;
(void)statusFlags;
(void)inputBuffer;
(void)timeInfo;
if (ud -> paCallbackReturn == paContinue) {
outB = (reinterpret_cast <audioSink *> (userData)) -> _O_Buffer;
actualSize = outB -> getDataFromBuffer (outp, 2 * framesPerBuffer);
for (i = actualSize; i < 2 * framesPerBuffer; i ++)
outp [i] = 0;
}
return ud -> paCallbackReturn;
}
void audioSink::audioOutput (float *b, int32_t amount) {
_O_Buffer -> putDataIntoBuffer (b, 2 * amount);
}
const char *audioSink::outputChannelwithRate (int16_t ch, int32_t rate) {
const PaDeviceInfo *deviceInfo;
if ((ch < 0) || (ch >= numofDevices))
return "";
deviceInfo = Pa_GetDeviceInfo (ch);
if (deviceInfo == NULL)
return "";
if (deviceInfo -> maxOutputChannels <= 0)
return "";
if (OutputrateIsSupported (ch, rate))
return (deviceInfo -> name);
return "";
}
int16_t audioSink::invalidDevice (void) {
return numofDevices + 128;
}
bool audioSink::isValidDevice (int16_t dev) {
return 0 <= dev && dev < numofDevices;
}
bool audioSink::selectDefaultDevice (void) {
return selectDevice ("default");
}
int32_t audioSink::cardRate (void) {
return 48000;
}
int16_t audioSink::numberofDevices (void) {
return numofDevices;
}

View File

@@ -1,73 +0,0 @@
#
/*
* Copyright (C) 2009, 2010, 2011
* Jan van Katwijk (J.vanKatwijk@gmail.com)
* Lazy Chair Computing
*
* This file is part of the main program for the DAB library
*
* DAB library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* DAB library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DAB library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef __AUDIO_SINK__
#define __AUDIO_SINK__
#include <portaudio.h>
#include <stdio.h>
#include "audio-base.h"
#include "ringbuffer.h"
#include <string>
class audioSink : public audioBase {
public:
audioSink (int16_t, std::string, bool *);
~audioSink (void);
void stop (void);
void restart (void);
bool selectDevice (const std::string);
bool selectDefaultDevice (void);
private:
int16_t numberofDevices (void);
const char *outputChannelwithRate (int16_t, int32_t);
int16_t invalidDevice (void);
bool isValidDevice (int16_t);
int32_t cardRate (void);
bool OutputrateIsSupported (int16_t, int32_t);
void audioOutput (float *, int32_t);
int32_t CardRate;
int16_t latency;
int32_t size;
bool portAudio;
bool writerRunning;
int16_t numofDevices;
int paCallbackReturn;
int16_t bufSize;
PaStream *ostream;
RingBuffer<float> *_O_Buffer;
PaStreamParameters outputParameters;
int16_t *outTable;
protected:
static int paCallback_o (const void *input,
void *output,
unsigned long framesperBuffer,
const PaStreamCallbackTimeInfo *timeInfo,
PaStreamCallbackFlags statusFlags,
void *userData);
};
#endif

View File

@@ -1,121 +0,0 @@
#
/*
* Copyright (C) 2013, 2014, 2015, 2016, 2017
* Jan van Katwijk (J.vanKatwijk@gmail.com)
* Lazy Chair Computing
*
* This file is part of the DAB library
*
* DAB library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* DAB library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DAB library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "band-handler.h"
struct dabFrequencies {
const char *key;
int fKHz;
};
static
struct dabFrequencies bandIII_frequencies [] = {
{"5A", 174928},
{"5B", 176640},
{"5C", 178352},
{"5D", 180064},
{"6A", 181936},
{"6B", 183648},
{"6C", 185360},
{"6D", 187072},
{"7A", 188928},
{"7B", 190640},
{"7C", 192352},
{"7D", 194064},
{"8A", 195936},
{"8B", 197648},
{"8C", 199360},
{"8D", 201072},
{"9A", 202928},
{"9B", 204640},
{"9C", 206352},
{"9D", 208064},
{"10A", 209936},
{"10B", 211648},
{"10C", 213360},
{"10D", 215072},
{"11A", 216928},
{"11B", 218640},
{"11C", 220352},
{"11D", 222064},
{"12A", 223936},
{"12B", 225648},
{"12C", 227360},
{"12D", 229072},
{"13A", 230748},
{"13B", 232496},
{"13C", 234208},
{"13D", 235776},
{"13E", 237488},
{"13F", 239200},
{NULL, 0}
};
static
struct dabFrequencies Lband_frequencies [] = {
{"LA", 1452960},
{"LB", 1454672},
{"LC", 1456384},
{"LD", 1458096},
{"LE", 1459808},
{"LF", 1461520},
{"LG", 1463232},
{"LH", 1464944},
{"LI", 1466656},
{"LJ", 1468368},
{"LK", 1470080},
{"LL", 1471792},
{"LM", 1473504},
{"LN", 1475216},
{"LO", 1476928},
{"LP", 1478640},
{NULL, 0}
};
bandHandler::bandHandler (void) {}
bandHandler::~bandHandler (void) {}
// find the frequency for a given channel in a given band
int32_t bandHandler::Frequency (uint8_t dabBand, std::string Channel) {
int32_t tunedFrequency = 0;
struct dabFrequencies *finger;
int i;
if (dabBand == BAND_III)
finger = bandIII_frequencies;
else
finger = Lband_frequencies;
for (i = 0; finger [i]. key != NULL; i ++) {
if (finger [i]. key == Channel) {
tunedFrequency = finger [i]. fKHz * 1000;
break;
}
}
if (tunedFrequency == 0)
tunedFrequency = finger [0]. fKHz * 1000;
return tunedFrequency;
}

View File

@@ -1,41 +0,0 @@
#
/*
* Copyright (C) 2013, 2014, 2015, 2016, 2017
* Jan van Katwijk (J.vanKatwijk@gmail.com)
* Lazy Chair Computing
*
* This file is part of the Qt-DAB program
* Qt-DAB is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* Qt-DAB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Qt-DAB; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __BANDHANDLER__
#define __BANDHANDLER__
#include <stdint.h>
#include <string>
//
// a simple convenience class
//
#define BAND_III 0100
#define L_BAND 0101
class bandHandler {
public:
bandHandler (void);
~bandHandler (void);
int32_t Frequency (uint8_t band, std::string Channel);
};
#endif

View File

@@ -1,42 +0,0 @@
QMAKE_DEFAULT_INCDIRS = \
/usr/include/c++/6.4.1 \
/usr/include/c++/6.4.1/x86_64-redhat-linux \
/usr/include/c++/6.4.1/backward \
/usr/lib/gcc/x86_64-redhat-linux/6.4.1/include \
/usr/local/include \
/usr/include
QMAKE_DEFAULT_LIBDIRS = \
/usr/lib/gcc/x86_64-redhat-linux/6.4.1 \
/usr/lib64 \
/lib64 \
/usr/lib \
/lib
QMAKE_CXX.INCDIRS = \
/usr/include/c++/6.4.1 \
/usr/include/c++/6.4.1/x86_64-redhat-linux \
/usr/include/c++/6.4.1/backward \
/usr/lib/gcc/x86_64-redhat-linux/6.4.1/include \
/usr/local/include \
/usr/include \
/usr/include/c++/7 \
/usr/include/c++/7/x86_64-redhat-linux \
/usr/include/c++/7/backward \
/usr/lib/gcc/x86_64-redhat-linux/7/include \
/usr/local/include \
/usr/include
QMAKE_CXX.LIBDIRS = \
/usr/lib/gcc/x86_64-redhat-linux/6.4.1 \
/usr/lib64 \
/lib64 \
/usr/lib \
/lib \
/usr/lib/gcc/x86_64-redhat-linux/7
QMAKE_CXX.QT_COMPILER_STDCXX = 201402L
QMAKE_CXX.QMAKE_GCC_MAJOR_VERSION = 7
QMAKE_CXX.QMAKE_GCC_MINOR_VERSION = 2
QMAKE_CXX.QMAKE_GCC_PATCH_VERSION = 1
QMAKE_CXX.COMPILER_MACROS = \
QT_COMPILER_STDCXX \
QMAKE_GCC_MAJOR_VERSION \
QMAKE_GCC_MINOR_VERSION \
QMAKE_GCC_PATCH_VERSION

Binary file not shown.

View File

@@ -1,658 +0,0 @@
#############################################################################
# Makefile for building: Client
# Generated by qmake (3.1) (Qt 5.9.2)
# Project: client.pro
# Template: app
# Command: /usr/bin/qmake-qt5 -o Makefile client.pro
#############################################################################
MAKEFILE = Makefile
####### Compiler, tools and options
CC = gcc
CXX = g++
DEFINES = -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB
CFLAGS = -pipe -O2 -Wall -W -D_REENTRANT -fPIC $(DEFINES)
CXXFLAGS = -pipe -O2 -Wall -W -D_REENTRANT -fPIC $(DEFINES)
INCPATH = -I. -I. -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtNetwork -isystem /usr/include/qt5/QtCore -I. -isystem /usr/include/libdrm -I. -I/usr/lib64/qt5/mkspecs/linux-g++
QMAKE = /usr/bin/qmake-qt5
DEL_FILE = rm -f
CHK_DIR_EXISTS= test -d
MKDIR = mkdir -p
COPY = cp -f
COPY_FILE = cp -f
COPY_DIR = cp -f -R
INSTALL_FILE = install -m 644 -p
INSTALL_PROGRAM = install -m 755 -p
INSTALL_DIR = cp -f -R
QINSTALL = /usr/bin/qmake-qt5 -install qinstall
QINSTALL_PROGRAM = /usr/bin/qmake-qt5 -install qinstall -exe
DEL_FILE = rm -f
SYMLINK = ln -f -s
DEL_DIR = rmdir
MOVE = mv -f
TAR = tar -cf
COMPRESS = gzip -9f
DISTNAME = Client1.0.0
DISTDIR = /usr/shared/sdr-j-development/systems/dab-cmdline/example-2/client/.tmp/Client1.0.0
LINK = g++
LFLAGS = -Wl,-O1
LIBS = $(SUBLIBS) -lQt5Widgets -lQt5Gui -lQt5Network -lQt5Core -lGL -lpthread
AR = ar cqs
RANLIB =
SED = sed
STRIP = strip
####### Output directory
OBJECTS_DIR = ./
####### Files
SOURCES = client.cpp \
main.cpp moc_client.cpp
OBJECTS = client.o \
main.o \
moc_client.o
DIST = /usr/lib64/qt5/mkspecs/features/spec_pre.prf \
/usr/lib64/qt5/mkspecs/common/unix.conf \
/usr/lib64/qt5/mkspecs/common/linux.conf \
/usr/lib64/qt5/mkspecs/common/sanitize.conf \
/usr/lib64/qt5/mkspecs/common/gcc-base.conf \
/usr/lib64/qt5/mkspecs/common/gcc-base-unix.conf \
/usr/lib64/qt5/mkspecs/common/g++-base.conf \
/usr/lib64/qt5/mkspecs/common/g++-unix.conf \
/usr/lib64/qt5/mkspecs/qconfig.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3danimation.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3danimation_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dcore.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dcore_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dextras.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dextras_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dinput.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dinput_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dlogic.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dlogic_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquick.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquick_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickanimation.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickanimation_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickextras.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickextras_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickinput.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickinput_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickrender.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickrender_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickscene2d.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickscene2d_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3drender.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3drender_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_accessibility_support_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_bluetooth.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_bluetooth_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_charts.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_charts_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_concurrent.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_concurrent_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_core.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_core_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_dbus.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_dbus_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_designer.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_designer_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_designercomponents_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_devicediscovery_support_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_egl_support_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_eglfs_kms_support_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_eglfsdeviceintegration_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_enginio.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_enginio_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_eventdispatcher_support_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_fb_support_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_fontdatabase_support_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_glx_support_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_gui.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_gui_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_help.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_help_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_input_support_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_kms_support_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_linuxaccessibility_support_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_location.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_location_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_multimedia.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_multimedia_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_multimediawidgets.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_multimediawidgets_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_network.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_network_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_nfc.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_nfc_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_opengl.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_opengl_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_openglextensions.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_openglextensions_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_packetprotocol_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_platformcompositor_support_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_positioning.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_positioning_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_printsupport.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_printsupport_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_qml.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_qml_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_qmldebug_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_qmldevtools_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_qmltest.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_qmltest_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_qtmultimediaquicktools_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_quick.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_quick_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_quickparticles_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_quickwidgets.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_quickwidgets_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_script.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_script_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_scripttools.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_scripttools_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_sensors.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_sensors_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_serialport.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_serialport_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_service_support_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_sql.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_sql_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_svg.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_svg_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_testlib.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_testlib_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_theme_support_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_uiplugin.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_uitools.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_uitools_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_waylandclient.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_waylandclient_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_waylandcompositor.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_waylandcompositor_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_webchannel.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_webchannel_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_webkit.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_webkitwidgets.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_websockets.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_websockets_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_widgets.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_widgets_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_x11extras.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_x11extras_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_xcb_qpa_lib_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_xml.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_xml_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_xmlpatterns.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_xmlpatterns_private.pri \
/usr/lib64/qt5/mkspecs/features/qt_functions.prf \
/usr/lib64/qt5/mkspecs/features/qt_config.prf \
/usr/lib64/qt5/mkspecs/linux-g++/qmake.conf \
/usr/lib64/qt5/mkspecs/features/spec_post.prf \
.qmake.stash \
/usr/lib64/qt5/mkspecs/features/exclusive_builds.prf \
/usr/lib64/qt5/mkspecs/features/toolchain.prf \
/usr/lib64/qt5/mkspecs/features/default_pre.prf \
/usr/lib64/qt5/mkspecs/features/resolve_config.prf \
/usr/lib64/qt5/mkspecs/features/default_post.prf \
/usr/lib64/qt5/mkspecs/features/warn_on.prf \
/usr/lib64/qt5/mkspecs/features/qt.prf \
/usr/lib64/qt5/mkspecs/features/resources.prf \
/usr/lib64/qt5/mkspecs/features/moc.prf \
/usr/lib64/qt5/mkspecs/features/unix/opengl.prf \
/usr/lib64/qt5/mkspecs/features/uic.prf \
/usr/lib64/qt5/mkspecs/features/unix/thread.prf \
/usr/lib64/qt5/mkspecs/features/qmake_use.prf \
/usr/lib64/qt5/mkspecs/features/file_copies.prf \
/usr/lib64/qt5/mkspecs/features/testcase_targets.prf \
/usr/lib64/qt5/mkspecs/features/exceptions.prf \
/usr/lib64/qt5/mkspecs/features/yacc.prf \
/usr/lib64/qt5/mkspecs/features/lex.prf \
client.pro client.h \
constants.h client.cpp \
main.cpp
QMAKE_TARGET = Client
DESTDIR =
TARGET = Client
first: all
####### Build rules
$(TARGET): ui_widget.h $(OBJECTS)
$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
Makefile: client.pro /usr/lib64/qt5/mkspecs/linux-g++/qmake.conf /usr/lib64/qt5/mkspecs/features/spec_pre.prf \
/usr/lib64/qt5/mkspecs/common/unix.conf \
/usr/lib64/qt5/mkspecs/common/linux.conf \
/usr/lib64/qt5/mkspecs/common/sanitize.conf \
/usr/lib64/qt5/mkspecs/common/gcc-base.conf \
/usr/lib64/qt5/mkspecs/common/gcc-base-unix.conf \
/usr/lib64/qt5/mkspecs/common/g++-base.conf \
/usr/lib64/qt5/mkspecs/common/g++-unix.conf \
/usr/lib64/qt5/mkspecs/qconfig.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3danimation.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3danimation_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dcore.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dcore_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dextras.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dextras_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dinput.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dinput_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dlogic.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dlogic_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquick.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquick_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickanimation.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickanimation_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickextras.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickextras_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickinput.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickinput_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickrender.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickrender_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickscene2d.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickscene2d_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3drender.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_3drender_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_accessibility_support_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_bluetooth.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_bluetooth_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_charts.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_charts_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_concurrent.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_concurrent_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_core.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_core_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_dbus.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_dbus_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_designer.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_designer_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_designercomponents_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_devicediscovery_support_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_egl_support_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_eglfs_kms_support_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_eglfsdeviceintegration_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_enginio.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_enginio_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_eventdispatcher_support_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_fb_support_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_fontdatabase_support_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_glx_support_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_gui.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_gui_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_help.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_help_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_input_support_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_kms_support_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_linuxaccessibility_support_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_location.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_location_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_multimedia.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_multimedia_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_multimediawidgets.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_multimediawidgets_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_network.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_network_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_nfc.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_nfc_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_opengl.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_opengl_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_openglextensions.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_openglextensions_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_packetprotocol_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_platformcompositor_support_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_positioning.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_positioning_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_printsupport.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_printsupport_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_qml.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_qml_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_qmldebug_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_qmldevtools_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_qmltest.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_qmltest_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_qtmultimediaquicktools_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_quick.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_quick_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_quickparticles_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_quickwidgets.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_quickwidgets_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_script.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_script_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_scripttools.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_scripttools_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_sensors.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_sensors_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_serialport.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_serialport_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_service_support_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_sql.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_sql_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_svg.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_svg_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_testlib.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_testlib_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_theme_support_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_uiplugin.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_uitools.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_uitools_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_waylandclient.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_waylandclient_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_waylandcompositor.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_waylandcompositor_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_webchannel.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_webchannel_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_webkit.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_webkitwidgets.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_websockets.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_websockets_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_widgets.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_widgets_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_x11extras.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_x11extras_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_xcb_qpa_lib_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_xml.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_xml_private.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_xmlpatterns.pri \
/usr/lib64/qt5/mkspecs/modules/qt_lib_xmlpatterns_private.pri \
/usr/lib64/qt5/mkspecs/features/qt_functions.prf \
/usr/lib64/qt5/mkspecs/features/qt_config.prf \
/usr/lib64/qt5/mkspecs/linux-g++/qmake.conf \
/usr/lib64/qt5/mkspecs/features/spec_post.prf \
.qmake.stash \
/usr/lib64/qt5/mkspecs/features/exclusive_builds.prf \
/usr/lib64/qt5/mkspecs/features/toolchain.prf \
/usr/lib64/qt5/mkspecs/features/default_pre.prf \
/usr/lib64/qt5/mkspecs/features/resolve_config.prf \
/usr/lib64/qt5/mkspecs/features/default_post.prf \
/usr/lib64/qt5/mkspecs/features/warn_on.prf \
/usr/lib64/qt5/mkspecs/features/qt.prf \
/usr/lib64/qt5/mkspecs/features/resources.prf \
/usr/lib64/qt5/mkspecs/features/moc.prf \
/usr/lib64/qt5/mkspecs/features/unix/opengl.prf \
/usr/lib64/qt5/mkspecs/features/uic.prf \
/usr/lib64/qt5/mkspecs/features/unix/thread.prf \
/usr/lib64/qt5/mkspecs/features/qmake_use.prf \
/usr/lib64/qt5/mkspecs/features/file_copies.prf \
/usr/lib64/qt5/mkspecs/features/testcase_targets.prf \
/usr/lib64/qt5/mkspecs/features/exceptions.prf \
/usr/lib64/qt5/mkspecs/features/yacc.prf \
/usr/lib64/qt5/mkspecs/features/lex.prf \
client.pro \
/usr/lib64/libQt5Widgets.prl \
/usr/lib64/libQt5Gui.prl \
/usr/lib64/libQt5Network.prl \
/usr/lib64/libQt5Core.prl
$(QMAKE) -o Makefile client.pro
/usr/lib64/qt5/mkspecs/features/spec_pre.prf:
/usr/lib64/qt5/mkspecs/common/unix.conf:
/usr/lib64/qt5/mkspecs/common/linux.conf:
/usr/lib64/qt5/mkspecs/common/sanitize.conf:
/usr/lib64/qt5/mkspecs/common/gcc-base.conf:
/usr/lib64/qt5/mkspecs/common/gcc-base-unix.conf:
/usr/lib64/qt5/mkspecs/common/g++-base.conf:
/usr/lib64/qt5/mkspecs/common/g++-unix.conf:
/usr/lib64/qt5/mkspecs/qconfig.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_3danimation.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_3danimation_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dcore.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dcore_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dextras.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dextras_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dinput.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dinput_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dlogic.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dlogic_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquick.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquick_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickanimation.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickanimation_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickextras.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickextras_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickinput.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickinput_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickrender.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickrender_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickscene2d.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_3dquickscene2d_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_3drender.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_3drender_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_accessibility_support_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_bluetooth.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_bluetooth_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_charts.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_charts_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_concurrent.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_concurrent_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_core.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_core_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_dbus.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_dbus_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_designer.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_designer_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_designercomponents_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_devicediscovery_support_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_egl_support_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_eglfs_kms_support_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_eglfsdeviceintegration_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_enginio.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_enginio_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_eventdispatcher_support_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_fb_support_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_fontdatabase_support_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_glx_support_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_gui.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_gui_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_help.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_help_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_input_support_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_kms_support_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_linuxaccessibility_support_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_location.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_location_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_multimedia.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_multimedia_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_multimediawidgets.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_multimediawidgets_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_network.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_network_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_nfc.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_nfc_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_opengl.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_opengl_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_openglextensions.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_openglextensions_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_packetprotocol_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_platformcompositor_support_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_positioning.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_positioning_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_printsupport.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_printsupport_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_qml.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_qml_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_qmldebug_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_qmldevtools_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_qmltest.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_qmltest_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_qtmultimediaquicktools_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_quick.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_quick_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_quickparticles_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_quickwidgets.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_quickwidgets_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_script.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_script_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_scripttools.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_scripttools_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_sensors.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_sensors_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_serialport.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_serialport_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_service_support_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_sql.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_sql_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_svg.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_svg_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_testlib.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_testlib_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_theme_support_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_uiplugin.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_uitools.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_uitools_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_waylandclient.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_waylandclient_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_waylandcompositor.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_waylandcompositor_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_webchannel.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_webchannel_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_webkit.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_webkitwidgets.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_websockets.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_websockets_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_widgets.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_widgets_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_x11extras.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_x11extras_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_xcb_qpa_lib_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_xml.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_xml_private.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_xmlpatterns.pri:
/usr/lib64/qt5/mkspecs/modules/qt_lib_xmlpatterns_private.pri:
/usr/lib64/qt5/mkspecs/features/qt_functions.prf:
/usr/lib64/qt5/mkspecs/features/qt_config.prf:
/usr/lib64/qt5/mkspecs/linux-g++/qmake.conf:
/usr/lib64/qt5/mkspecs/features/spec_post.prf:
.qmake.stash:
/usr/lib64/qt5/mkspecs/features/exclusive_builds.prf:
/usr/lib64/qt5/mkspecs/features/toolchain.prf:
/usr/lib64/qt5/mkspecs/features/default_pre.prf:
/usr/lib64/qt5/mkspecs/features/resolve_config.prf:
/usr/lib64/qt5/mkspecs/features/default_post.prf:
/usr/lib64/qt5/mkspecs/features/warn_on.prf:
/usr/lib64/qt5/mkspecs/features/qt.prf:
/usr/lib64/qt5/mkspecs/features/resources.prf:
/usr/lib64/qt5/mkspecs/features/moc.prf:
/usr/lib64/qt5/mkspecs/features/unix/opengl.prf:
/usr/lib64/qt5/mkspecs/features/uic.prf:
/usr/lib64/qt5/mkspecs/features/unix/thread.prf:
/usr/lib64/qt5/mkspecs/features/qmake_use.prf:
/usr/lib64/qt5/mkspecs/features/file_copies.prf:
/usr/lib64/qt5/mkspecs/features/testcase_targets.prf:
/usr/lib64/qt5/mkspecs/features/exceptions.prf:
/usr/lib64/qt5/mkspecs/features/yacc.prf:
/usr/lib64/qt5/mkspecs/features/lex.prf:
client.pro:
/usr/lib64/libQt5Widgets.prl:
/usr/lib64/libQt5Gui.prl:
/usr/lib64/libQt5Network.prl:
/usr/lib64/libQt5Core.prl:
qmake: FORCE
@$(QMAKE) -o Makefile client.pro
qmake_all: FORCE
all: Makefile $(TARGET)
dist: distdir FORCE
(cd `dirname $(DISTDIR)` && $(TAR) $(DISTNAME).tar $(DISTNAME) && $(COMPRESS) $(DISTNAME).tar) && $(MOVE) `dirname $(DISTDIR)`/$(DISTNAME).tar.gz . && $(DEL_FILE) -r $(DISTDIR)
distdir: FORCE
@test -d $(DISTDIR) || mkdir -p $(DISTDIR)
$(COPY_FILE) --parents $(DIST) $(DISTDIR)/
$(COPY_FILE) --parents /usr/lib64/qt5/mkspecs/features/data/dummy.cpp $(DISTDIR)/
$(COPY_FILE) --parents client.h constants.h $(DISTDIR)/
$(COPY_FILE) --parents client.cpp main.cpp $(DISTDIR)/
$(COPY_FILE) --parents widget.ui $(DISTDIR)/
clean: compiler_clean
-$(DEL_FILE) $(OBJECTS)
-$(DEL_FILE) *~ core *.core
distclean: clean
-$(DEL_FILE) $(TARGET)
-$(DEL_FILE) .qmake.stash
-$(DEL_FILE) Makefile
####### Sub-libraries
mocclean: compiler_moc_header_clean compiler_moc_source_clean
mocables: compiler_moc_header_make_all compiler_moc_source_make_all
check: first
benchmark: first
compiler_rcc_make_all:
compiler_rcc_clean:
compiler_moc_predefs_make_all: moc_predefs.h
compiler_moc_predefs_clean:
-$(DEL_FILE) moc_predefs.h
moc_predefs.h: /usr/lib64/qt5/mkspecs/features/data/dummy.cpp
g++ -pipe -O2 -Wall -W -dM -E -o moc_predefs.h /usr/lib64/qt5/mkspecs/features/data/dummy.cpp
compiler_moc_header_make_all: moc_client.cpp
compiler_moc_header_clean:
-$(DEL_FILE) moc_client.cpp
moc_client.cpp: constants.h \
ui_widget.h \
header-test.h \
client.h \
moc_predefs.h \
/usr/lib64/qt5/bin/moc
/usr/lib64/qt5/bin/moc $(DEFINES) --include ./moc_predefs.h -I/usr/lib64/qt5/mkspecs/linux-g++ -I/usr/shared/sdr-j-development/systems/dab-cmdline/example-2/client -I/usr/shared/sdr-j-development/systems/dab-cmdline/example-2/client -I/usr/include/qt5 -I/usr/include/qt5/QtWidgets -I/usr/include/qt5/QtGui -I/usr/include/qt5/QtNetwork -I/usr/include/qt5/QtCore -I/usr/include/c++/6.4.1 -I/usr/include/c++/6.4.1/x86_64-redhat-linux -I/usr/include/c++/6.4.1/backward -I/usr/lib/gcc/x86_64-redhat-linux/6.4.1/include -I/usr/local/include -I/usr/include -I/usr/include/c++/7 -I/usr/include/c++/7/x86_64-redhat-linux -I/usr/include/c++/7/backward -I/usr/lib/gcc/x86_64-redhat-linux/7/include -I/usr/local/include -I/usr/include client.h -o moc_client.cpp
compiler_moc_source_make_all:
compiler_moc_source_clean:
compiler_uic_make_all: ui_widget.h
compiler_uic_clean:
-$(DEL_FILE) ui_widget.h
ui_widget.h: widget.ui \
/usr/lib64/qt5/bin/uic
/usr/lib64/qt5/bin/uic widget.ui -o ui_widget.h
compiler_yacc_decl_make_all:
compiler_yacc_decl_clean:
compiler_yacc_impl_make_all:
compiler_yacc_impl_clean:
compiler_lex_make_all:
compiler_lex_clean:
compiler_clean: compiler_moc_predefs_clean compiler_moc_header_clean compiler_uic_clean
####### Compile
client.o: client.cpp client.h \
constants.h \
ui_widget.h \
header-test.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o client.o client.cpp
main.o: main.cpp client.h \
constants.h \
ui_widget.h \
header-test.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp
moc_client.o: moc_client.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_client.o moc_client.cpp
####### Install
install: FORCE
uninstall: FORCE
FORCE:

View File

@@ -1,3 +0,0 @@
Very simple client, for use with the tcpServer that emits the tdc data.

View File

@@ -1,274 +0,0 @@
#
/*
* Copyright (C) 2015
* Jan van Katwijk (J.vanKatwijk@gmail.com)
* Lazy Chair Computing
*
* This file is part of the SDR-J.
* Many of the ideas as implemented in SDR-J are derived from
* other work, made available through the GNU general Public License.
* All copyrights of the original authors are recognized.
*
* SDR-J is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* SDR-J is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SDR-J; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Communication via network to a DAB receiver to
* show the tdc data
*/
#include <QSettings>
#include <QLabel>
#include <QMessageBox>
#include <QtNetwork>
#include <QTcpSocket>
#include <QHostAddress>
#include "client.h"
//
#define swap(a) (((a) << 8) | ((a) >> 8))
//---------------------------------------------------------------------------
uint16_t usCalculCRC (uint8_t *buf, int lg) {
uint16_t crc;
uint count;
crc = 0xFFFF;
for (count= 0; count < lg; count++) {
crc = (uint16_t) (swap (crc) ^ (uint16_t)buf [count]);
crc ^= ((uint8_t)crc) >> 4;
crc = (uint16_t)
(crc ^ (swap((uint8_t)(crc)) << 4) ^ ((uint8_t)(crc) << 5));
}
return ((uint16_t)(crc ^ 0xFFFF));
}
static inline
bool check_crc_bytes (uint8_t *msg, int16_t len) {
int i, j;
uint16_t accumulator = 0xFFFF;
uint16_t crc;
uint16_t genpoly = 0x1021;
for (i = 0; i < len; i ++) {
int16_t data = msg [i] << 8;
for (j = 8; j > 0; j--) {
if ((data ^ accumulator) & 0x8000)
accumulator = ((accumulator << 1) ^ genpoly) & 0xFFFF;
else
accumulator = (accumulator << 1) & 0xFFFF;
data = (data << 1) & 0xFFFF;
}
}
//
// ok, now check with the crc that is contained
// in the au
crc = ~((msg [len] << 8) | msg [len + 1]) & 0xFFFF;
return (crc ^ accumulator) == 0;
}
Client::Client (QWidget *parent):QDialog (parent) {
int16_t i;
setupUi (this);
connected = false;
connect (connectButton, SIGNAL (clicked (void)),
this, SLOT (wantConnect (void)));
connect (terminateButton, SIGNAL (clicked (void)),
this, SLOT (terminate (void)));
state -> setText ("waiting to start");
connectionTimer = new QTimer ();
connectionTimer -> setInterval (1000);
connect (connectionTimer, SIGNAL (timeout (void)),
this, SLOT (timerTick (void)));
}
//
Client::~Client (void) {
connected = false;
}
//
void Client::wantConnect (void) {
QString ipAddress;
int16_t i;
QList<QHostAddress> ipAddressesList = QNetworkInterface::allAddresses();
if (connected)
return;
// use the first non-localhost IPv4 address
for (i = 0; i < ipAddressesList.size(); ++i) {
if (ipAddressesList.at (i) != QHostAddress::LocalHost &&
ipAddressesList. at (i). toIPv4Address ()) {
ipAddress = ipAddressesList. at(i). toString();
break;
}
}
// if we did not find one, use IPv4 localhost
if (ipAddress. isEmpty())
ipAddress = QHostAddress (QHostAddress::LocalHost).toString ();
hostLineEdit -> setText (ipAddress);
hostLineEdit -> setInputMask ("000.000.000.000");
// Setting default IP address
state -> setText ("Give IP address, return");
connect (hostLineEdit, SIGNAL (returnPressed (void)),
this, SLOT (setConnection (void)));
}
// if / when a return is pressed in the line edit,
// a signal appears and we are able to collect the
// inserted text. The format is the IP-V4 format.
// Using this text, we try to connect,
void Client::setConnection (void) {
QString s = hostLineEdit -> text ();
QHostAddress theAddress = QHostAddress (s);
int32_t basePort;
basePort = 8888;
disconnect (hostLineEdit, SIGNAL (returnPressed (void)),
this, SLOT (setConnection (void)));
//
// The streamer will provide us with the raw data
streamer. connectToHost (theAddress, basePort);
if (!streamer. waitForConnected (2000)) {
QMessageBox::warning (this, tr ("client"),
tr ("setting up stream failed\n"));
return;
}
connected = true;
state -> setText ("Connected");
connect (&streamer, SIGNAL (readyRead (void)),
this, SLOT (readData (void)));
connectionTimer -> start (1000);
}
// These functions are typical for network use
void Client::readData (void) {
QByteArray d;
int16_t i;
d. resize (4 * 512);
while (streamer. bytesAvailable () > 4 * 512) {
streamer. read (d. data (), d. size ());
for (i = 0; i < d. size (); i ++)
handle ((uint8_t)(d [i]));
}
}
#define SEARCH_HEADER 0
#define HEADER_FOUND 1
int searchState = SEARCH_HEADER;
void Client::handle (uint8_t d) {
int16_t i;
if (searchState == SEARCH_HEADER) {
headertester. shift (d);
if (headertester. hasHeader ()) {
toRead = headertester. length ();
dataLength = toRead;
dataBuffer = new uint8_t [toRead];
dataIndex = 0;
frameType = headertester. frametype ();
searchState = HEADER_FOUND;
headertester. reset ();
}
return;
}
toRead --;
dataBuffer [dataIndex ++] = d;
if (toRead == 0) {
searchState = SEARCH_HEADER;
if (frameType == 0)
handleFrameType_0 (dataBuffer, dataLength);
else
handleFrameType_1 (dataBuffer, dataLength);
delete[] dataBuffer;
}
}
void Client::terminate (void) {
if (connected) {
streamer. close ();
}
accept ();
}
void Client::timerTick (void) {
if (streamer. state () == QAbstractSocket::UnconnectedState) {
state -> setText ("not connected");
connected = false;
connectionTimer -> stop ();
}
}
void Client::handleFrameType_0 (uint8_t *dataBuffer, int16_t Length) {
fprintf (stderr, "number of services %d\n", dataBuffer [0]);
}
void Client::handleFrameType_1 (uint8_t *dataBuffer, int16_t Length) {
fprintf (stderr, "type 1 %x %x %x %x\n",
dataBuffer [0],
dataBuffer [1], dataBuffer [2], dataBuffer [3]);
if (dataBuffer [3] == 0) { // encryption 0
int16_t index = 4;
while (index < Length) {
int16_t i;
uint8_t sCi = dataBuffer [index];
uint16_t segLen = (dataBuffer [index + 1] << 8) |
dataBuffer [index + 2];
uint16_t crc = (dataBuffer [index + 3] << 8) |
dataBuffer [index + 4];
uint8_t testVector [18];
testVector [0] = sCi;
testVector [1] = dataBuffer [index + 1];
testVector [2] = dataBuffer [index + 2];
for (i = 0; i < 13; i ++)
testVector [i + 3] = dataBuffer [index + i + 5];
testVector [16] = dataBuffer [index + 3];
testVector [17] = dataBuffer [index + 4];
if (usCalculCRC (testVector, 16) == crc)
fprintf (stderr,
"sCi = %o, segLen = %d (index = %d, Length = %d)\n",
sCi, segLen, index, Length);
else {
fprintf (stderr, "failing crc\n");
}
index += segLen + 5;
}
}
else
fprintf (stderr, "encryption not zero\n");
}
bool Client::serviceComponentFrameheaderCRC (uint8_t *data,
int16_t offset,
int16_t maxL) {
uint8_t testVector [18];
int16_t i;
int16_t length = (data [offset + 1] << 8) | data [offset + 2];
int16_t size = length < 13 ? length : 13;
uint16_t crc;
if (length < 0)
return false; // assumed garbage
crc = (data [offset + 3] << 8) | data [offset + 4]; // the crc
testVector [0] = data [offset + 0];
testVector [1] = data [offset + 1];
testVector [2] = data [offset + 2];
for (i = 0; i < size; i ++)
testVector [3 + i] = data [offset + 5 + i];
return usCalculCRC (testVector, 3 + size) == crc;
}

View File

@@ -1,76 +0,0 @@
#
/*
* Copyright (C) 2015
* Jan van Katwijk (J.vanKatwijk@gmail.com)
* Lazy Chair Computing
*
* This file is part of the SDR-J.
* Many of the ideas as implemented in SDR-J are derived from
* other work, made available through the GNU general Public License.
* All copyrights of the original authors are recognized.
*
* SDR-J is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* SDR-J is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SDR-J; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Communication via network to a DAB receiver to
* show the tdc data
*/
#ifndef __TDC_CLIENT__
#define __TDC_CLIENT__
#include "constants.h"
#include <QDialog>
#include <QSettings>
#include <QLabel>
#include <QMessageBox>
#include <QTcpSocket>
#include <QHostAddress>
#include <QTimer>
#include "ui_widget.h"
#include "header-test.h"
//
class Client:public QDialog, public Ui_widget {
Q_OBJECT
public:
Client (QWidget *parent = NULL);
~Client (void);
bool connected;
private slots:
void wantConnect (void);
void setConnection (void);
void readData (void);
void handle (uint8_t);
void terminate (void);
void timerTick (void);
private:
void handleFrameType_0 (uint8_t *, int16_t);
void handleFrameType_1 (uint8_t *, int16_t);
bool serviceComponentFrameheaderCRC (uint8_t *data,
int16_t offset,
int16_t maxL);
QTcpSocket streamer;
QTimer *connectionTimer;
headerTest headertester;
int16_t toRead;
int16_t dataLength;
uint8_t *dataBuffer;
uint8_t frameType;
int16_t dataIndex;
};
#endif

View File

@@ -1,18 +0,0 @@
#
TEMPLATE = app
CONFIG += console
QT += core gui network widgets
INCLUDEPATH += .
HEADERS = ./client.h \
./constants.h
SOURCES = ./client.cpp main.cpp
TARGET = Client
FORMS += ./widget.ui
unix{
DESTDIR = .
}

View File

@@ -1,81 +0,0 @@
#
/*
* Copyright (C) 2011, 2012, 2013
* Jan van Katwijk (J.vanKatwijk@gmail.com)
* Lazy Chair Computing
*
* This file is part of the SDR-J
* Many of the ideas as implemented in SDR-J are derived from
* other work, made available through the GNU general Public License.
* All copyrights of the original authors are recognized.
*
* SDR-J is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* SDR-J is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SDR-J; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#
#ifndef __SOUND_CONSTANTS
#define __SOUND_CONSTANTS
#include <math.h>
#include <complex>
#include <stdint.h>
#include <unistd.h>
#include <limits>
#include "stdlib.h"
using namespace std;
#include <malloc.h>
#ifdef __MINGW32__
#include "windows.h"
#else
#include "alloca.h"
#endif
/*
*/
typedef float DSPFLOAT;
typedef std::complex<DSPFLOAT> DSPCOMPLEX;
#define MINIMUM(x, y) ((x) < (y) ? x : y)
#define MAXIMUM(x, y) ((x) > (y) ? x : y)
// common, simple but useful, functions
static inline
bool isIndeterminate (DSPFLOAT x) {
return x != x;
}
static inline
bool isInfinite (double x) {
return x == numeric_limits<DSPFLOAT>::infinity ();
}
//
static inline
DSPCOMPLEX cmul (DSPCOMPLEX x, float y) {
return DSPCOMPLEX (real (x) * y, imag (x) * y);
}
static inline
DSPCOMPLEX cdiv (DSPCOMPLEX x, float y) {
return DSPCOMPLEX (real (x) / y, imag (x) / y);
}
static inline
float get_db (DSPFLOAT x) {
return 20 * log10 ((x + 1) / (float)(256 * 65536));
}
#endif

View File

@@ -1,102 +0,0 @@
#
/*
* Copyright (C) 2017
* Jan van Katwijk (J.vanKatwijk@gmail.com)
* Lazy Chair Computing
*
* This file is part of the SDR-J
* Many of the ideas as implemented in SDR-J are derived from
* other work, made available through the GNU general Public License.
* All copyrights of the original authors are recognized.
*
* SDR-J is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* SDR-J is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SDR-J; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*
* Simple checker for te package header
*/
#ifndef __HEADER_TEST__
#define __HEADER_TEST__
#include <stdint.h>
#include <stdio.h>
class headerTest {
private:
uint8_t b [8];
int16_t counter;
public:
headerTest (void) {
counter = 0;
}
~headerTest (void) {
}
void shift (uint8_t d) {
if ((counter == 0) && (d == 0xFF)) {
b [counter ++] = 0xFF;
return;
}
if ((counter == 1) && (d == 0x00)) {
b [counter ++] = 0x00;
return;
}
if ((counter == 2) && (d == 0xFF)) {
b [counter ++] = 0xFF;
return;
}
if ((counter == 3) && (d == 0x00)) {
b [counter ++] = 0x00;
return;
}
if (counter == 4) {
b [counter ++] = d;
return;
}
if (counter == 5) {
b [counter ++] = d;
return;
}
if ((counter == 6) && (d == 0x00)) {
b [counter ++] = d;
return;
}
if ((counter == 7) && ((d == 0x00) || (d = 0xFF))) {
b [counter ++] = d;
fprintf (stderr, "header detected, %o %o %o (%d)\n",
b [4], b [5], b [7],
(b [4] << 8) | (b [5] & 0xFF));
return;
}
counter = 0;
}
void reset (void) {
counter = 0;
}
bool hasHeader (void) {
return counter == 8;
}
uint8_t frametype (void) {
return b [7];
}
int16_t length () {
return (b [4] << 8) | b [5];
}
};
#endif

View File

@@ -1,51 +0,0 @@
#
/*
* Copyright (C) 2008, 2009, 2010, 2011, 2012
* Jan van Katwijk (J.vanKatwijk@gmail.com)
* Lazy Chair programming
*
* This file is part of the SDR-J.
* Many of the ideas as implemented in SDR-J are derived from
* other work, made available through the GNU general Public License.
* All copyrights of the original authors are recognized.
*
* SDR-J is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* SDR-J is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SDR-J; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Main program
*/
#include <QApplication>
#include <QDir>
#include "client.h"
#ifdef __MINGW32__
#include "windows.h"
#endif
int main (int argc, char **argv) {
Client *myClient;
QApplication a (argc, argv);
myClient = new Client ();
myClient -> show ();
a. exec ();
/*
* done:
*/
fflush (stdout);
fflush (stderr);
qDebug ("It is done\n");
}

View File

@@ -1,320 +0,0 @@
#
/*
* $Id: pa_ringbuffer.c 1738 2011-08-18 11:47:28Z rossb $
* Portable Audio I/O Library
* Ring Buffer utility.
*
* Author: Phil Burk, http://www.softsynth.com
* modified for SMP safety on Mac OS X by Bjorn Roche
* modified for SMP safety on Linux by Leland Lucius
* also, allowed for const where possible
* modified for multiple-byte-sized data elements by Sven Fischer
*
* Note that this is safe only for a single-thread reader and a
* single-thread writer.
*
* This program uses the PortAudio Portable Audio Library.
* For more information see: http://www.portaudio.com
* Copyright (c) 1999-2000 Ross Bencina and Phil Burk
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files
* (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*
*
* Copyright (C) 2008, 2009, 2010
* Jan van Katwijk (J.vanKatwijk@gmail.com)
* Lazy Chair Computing
*
* The ringbuffer here is a rewrite of the ringbuffer used in the PA code
* All rights remain with their owners
* This file is part of the SDR-J.
* Many of the ideas as implemented in SDR-J are derived from
* other work, made available through the GNU general Public License.
* All copyrights of the original authors are recognized.
*
* SDR-J is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* SDR-J is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SDR-J; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __RINGBUFFER
#define __RINGBUFFER
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>
/*
* a simple ringbuffer, lockfree, however only for a
* single reader and a single writer.
* Mostly used for getting samples from or to the soundcard
*/
#if defined(__APPLE__)
# include <libkern/OSAtomic.h>
/* Here are the memory barrier functions. Mac OS X only provides
full memory barriers, so the three types of barriers are the same,
however, these barriers are superior to compiler-based ones. */
# define PaUtil_FullMemoryBarrier() OSMemoryBarrier()
# define PaUtil_ReadMemoryBarrier() OSMemoryBarrier()
# define PaUtil_WriteMemoryBarrier() OSMemoryBarrier()
#elif defined(__GNUC__)
/* GCC >= 4.1 has built-in intrinsics. We'll use those */
# if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)
# define PaUtil_FullMemoryBarrier() __sync_synchronize()
# define PaUtil_ReadMemoryBarrier() __sync_synchronize()
# define PaUtil_WriteMemoryBarrier() __sync_synchronize()
/* as a fallback, GCC understands volatile asm and "memory" to mean it
* should not reorder memory read/writes */
# elif defined( __PPC__ )
# define PaUtil_FullMemoryBarrier() asm volatile("sync":::"memory")
# define PaUtil_ReadMemoryBarrier() asm volatile("sync":::"memory")
# define PaUtil_WriteMemoryBarrier() asm volatile("sync":::"memory")
# elif defined( __i386__ ) || defined( __i486__ ) || defined( __i586__ ) || defined( __i686__ ) || defined( __x86_64__ )
# define PaUtil_FullMemoryBarrier() asm volatile("mfence":::"memory")
# define PaUtil_ReadMemoryBarrier() asm volatile("lfence":::"memory")
# define PaUtil_WriteMemoryBarrier() asm volatile("sfence":::"memory")
# else
# ifdef ALLOW_SMP_DANGERS
# warning Memory barriers not defined on this system or system unknown
# warning For SMP safety, you should fix this.
# define PaUtil_FullMemoryBarrier()
# define PaUtil_ReadMemoryBarrier()
# define PaUtil_WriteMemoryBarrier()
# else
# error Memory barriers are not defined on this system. You can still compile by defining ALLOW_SMP_DANGERS, but SMP safety will not be guaranteed.
# endif
# endif
#else
# ifdef ALLOW_SMP_DANGERS
# warning Memory barriers not defined on this system or system unknown
# warning For SMP safety, you should fix this.
# define PaUtil_FullMemoryBarrier()
# define PaUtil_ReadMemoryBarrier()
# define PaUtil_WriteMemoryBarrier()
# else
# error Memory barriers are not defined on this system. You can still compile by defining ALLOW_SMP_DANGERS, but SMP safety will not be guaranteed.
# endif
#endif
template <class elementtype>
class RingBuffer {
private:
uint32_t bufferSize;
volatile uint32_t writeIndex;
volatile uint32_t readIndex;
uint32_t bigMask;
uint32_t smallMask;
char *buffer;
public:
RingBuffer (uint32_t elementCount) {
if (((elementCount - 1) & elementCount) != 0)
elementCount = 4 * 16384; /* default */
bufferSize = elementCount;
buffer = new char [2 * bufferSize * sizeof (elementtype)];
writeIndex = 0;
readIndex = 0;
smallMask = (elementCount)- 1;
bigMask = (elementCount * 2) - 1;
}
~RingBuffer () {
delete[] buffer;
}
/*
* functions for checking available data for reading and space
* for writing
*/
uint32_t GetRingBufferReadAvailable (void) {
return (writeIndex - readIndex) & bigMask;
}
//int32_t ReadSpace (void){
// return GetRingBufferReadAvailable ();
//}
uint32_t GetRingBufferWriteAvailable (void) {
return bufferSize - GetRingBufferReadAvailable ();
}
int32_t WriteSpace (void) {
return GetRingBufferWriteAvailable ();
}
void FlushRingBuffer () {
writeIndex = 0;
readIndex = 0;
}
/* ensure that previous writes are seen before we update the write index
(write after write)
*/
int32_t AdvanceRingBufferWriteIndex (int32_t elementCount) {
PaUtil_WriteMemoryBarrier();
return writeIndex = (writeIndex + elementCount) & bigMask;
}
/* ensure that previous reads (copies out of the ring buffer) are
* always completed before updating (writing) the read index.
* (write-after-read) => full barrier
*/
int32_t AdvanceRingBufferReadIndex (int32_t elementCount) {
PaUtil_FullMemoryBarrier();
return readIndex = (readIndex + elementCount) & bigMask;
}
/***************************************************************************
** Get address of region(s) to which we can write data.
** If the region is contiguous, size2 will be zero.
** If non-contiguous, size2 will be the size of second region.
** Returns room available to be written or elementCount, whichever is smaller.
*/
int32_t GetRingBufferWriteRegions (uint32_t elementCount,
void **dataPtr1, int32_t *sizePtr1,
void **dataPtr2, int32_t *sizePtr2 ) {
uint32_t index;
uint32_t available = GetRingBufferWriteAvailable ();
if (elementCount > available)
elementCount = available;
/* Check to see if write is not contiguous. */
index = writeIndex & smallMask;
if ((index + elementCount) > bufferSize ) {
/* Write data in two blocks that wrap the buffer. */
int32_t firstHalf = bufferSize - index;
*dataPtr1 = &buffer[index * sizeof(elementtype)];
*sizePtr1 = firstHalf;
*dataPtr2 = &buffer [0];
*sizePtr2 = elementCount - firstHalf;
}
else { // fits
*dataPtr1 = &buffer [index * sizeof(elementtype)];
*sizePtr1 = elementCount;
*dataPtr2 = NULL;
*sizePtr2 = 0;
}
if (available > 0)
PaUtil_FullMemoryBarrier(); /* (write-after-read) => full barrier */
return elementCount;
}
/***************************************************************************
** Get address of region(s) from which we can read data.
** If the region is contiguous, size2 will be zero.
** If non-contiguous, size2 will be the size of second region.
** Returns room available to be read or elementCount, whichever is smaller.
*/
int32_t GetRingBufferReadRegions (uint32_t elementCount,
void **dataPtr1, int32_t *sizePtr1,
void **dataPtr2, int32_t *sizePtr2) {
uint32_t index;
uint32_t available = GetRingBufferReadAvailable (); /* doesn't use memory barrier */
if (elementCount > available)
elementCount = available;
/* Check to see if read is not contiguous. */
index = readIndex & smallMask;
if ((index + elementCount) > bufferSize) {
/* Write data in two blocks that wrap the buffer. */
int32_t firstHalf = bufferSize - index;
*dataPtr1 = &buffer [index * sizeof(elementtype)];
*sizePtr1 = firstHalf;
*dataPtr2 = &buffer [0];
*sizePtr2 = elementCount - firstHalf;
}
else {
*dataPtr1 = &buffer [index * sizeof(elementtype)];
*sizePtr1 = elementCount;
*dataPtr2 = NULL;
*sizePtr2 = 0;
}
if (available)
PaUtil_ReadMemoryBarrier(); /* (read-after-read) => read barrier */
return elementCount;
}
int32_t putDataIntoBuffer (const void *data, int32_t elementCount) {
int32_t size1, size2, numWritten;
void *data1;
void *data2;
numWritten = GetRingBufferWriteRegions (elementCount,
&data1, &size1,
&data2, &size2 );
if (size2 > 0) {
memcpy (data1, data, size1 * sizeof(elementtype));
data = ((char *)data) + size1 * sizeof(elementtype);
memcpy (data2, data, size2 * sizeof(elementtype));
}
else
memcpy (data1, data, size1 * sizeof(elementtype));
AdvanceRingBufferWriteIndex (numWritten );
return numWritten;
}
int32_t getDataFromBuffer (void *data, int32_t elementCount ) {
int32_t size1, size2, numRead;
void *data1;
void *data2;
numRead = GetRingBufferReadRegions (elementCount,
&data1, &size1,
&data2, &size2 );
if (size2 > 0) {
memcpy (data, data1, size1 * sizeof(elementtype));
data = ((char *)data) + size1 * sizeof(elementtype);
memcpy (data, data2, size2 * sizeof(elementtype));
}
else
memcpy (data, data1, size1 * sizeof(elementtype));
AdvanceRingBufferReadIndex (numRead );
return numRead;
}
int32_t skipDataInBuffer (uint32_t n_values) {
// ensure that we have the correct read and write indices
PaUtil_FullMemoryBarrier ();
if (n_values > GetRingBufferReadAvailable ())
n_values = GetRingBufferReadAvailable ();
AdvanceRingBufferReadIndex (n_values);
return n_values;
}
};
#endif

View File

@@ -1,68 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>widget</class>
<widget class="QDialog" name="widget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>230</width>
<height>195</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<widget class="QPushButton" name="connectButton">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>131</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>connect</string>
</property>
</widget>
<widget class="QLineEdit" name="hostLineEdit">
<property name="geometry">
<rect>
<x>10</x>
<y>30</y>
<width>131</width>
<height>21</height>
</rect>
</property>
</widget>
<widget class="QLabel" name="state">
<property name="geometry">
<rect>
<x>10</x>
<y>130</y>
<width>131</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="terminateButton">
<property name="geometry">
<rect>
<x>150</x>
<y>10</y>
<width>71</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>quit</string>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>

View File

@@ -1,41 +0,0 @@
# http://tim.klingt.org/code/projects/supernova/repository/revisions/d336dd6f400e381bcfd720e96139656de0c53b6a/entry/cmake_modules/FindFFTW3f.cmake
# Modified to use pkg config and use standard var names
# Find single-precision (float) version of FFTW3
INCLUDE(FindPkgConfig)
PKG_CHECK_MODULES(PC_FFTW3F "fftw3f >= 3.0")
FIND_PATH(
FFTW3F_INCLUDE_DIRS
NAMES fftw3.h
HINTS $ENV{FFTW3_DIR}/include
${PC_FFTW3F_INCLUDE_DIR}
PATHS /usr/local/include
/usr/include
)
FIND_LIBRARY(
FFTW3F_LIBRARIES
NAMES fftw3f libfftw3f
HINTS $ENV{FFTW3_DIR}/lib
${PC_FFTW3F_LIBDIR}
PATHS /usr/local/lib
/usr/lib
/usr/lib64
)
FIND_LIBRARY(
FFTW3F_THREADS_LIBRARIES
NAMES fftw3f_threads libfftw3f_threads
HINTS $ENV{FFTW3_DIR}/lib
${PC_FFTW3F_LIBDIR}
PATHS /usr/local/lib
/usr/lib
/usr/lib64
)
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(FFTW3F DEFAULT_MSG FFTW3F_LIBRARIES FFTW3F_INCLUDE_DIRS)
MARK_AS_ADVANCED(FFTW3F_LIBRARIES FFTW3F_INCLUDE_DIRS FFTW3F_THREADS_LIBRARIES)

View File

@@ -1,34 +0,0 @@
# Try to find FAAD library and include path.
# Once done this will define
#
# FAAD_INCLUDE_DIRS - where to find faad.h, etc.
# FAAD_LIBRARIES - List of libraries when using libfaad.
# FAAD_FOUND - True if libfaad found.
find_path(FAAD_INCLUDE_DIR faad.h DOC "The directory where faad.h resides")
find_library(FAAD_LIBRARY NAMES faad DOC "The libfaad library")
if(FAAD_INCLUDE_DIR AND FAAD_LIBRARY)
set(FAAD_FOUND 1)
set(FAAD_LIBRARIES ${FAAD_LIBRARY})
set(FAAD_INCLUDE_DIRS ${FAAD_INCLUDE_DIR})
else(FAAD_INCLUDE_DIR AND FAAD_LIBRARY)
set(FAAD_FOUND 0)
set(FAAD_LIBRARIES)
set(FAAD_INCLUDE_DIRS)
endif(FAAD_INCLUDE_DIR AND FAAD_LIBRARY)
mark_as_advanced(FAAD_INCLUDE_DIR)
mark_as_advanced(FAAD_LIBRARY)
mark_as_advanced(FAAD_FOUND)
if(NOT FAAD_FOUND)
set(FAAD_DIR_MESSAGE "libfaad was not found. Make sure FAAD_LIBRARY and FAAD_INCLUDE_DIR are set.")
if(NOT FAAD_FIND_QUIETLY)
message(STATUS "${FAAD_DIR_MESSAGE}")
else(NOT FAAD_FIND_QUIETLY)
if(FAAD_FIND_REQUIRED)
message(FATAL_ERROR "${FAAD_DIR_MESSAGE}")
endif(FAAD_FIND_REQUIRED)
endif(NOT FAAD_FIND_QUIETLY)
endif(NOT FAAD_FOUND)

View File

@@ -1,28 +0,0 @@
if(NOT LIBAIRSPY_FOUND)
pkg_check_modules (LIBAIRSPY_PKG libairspy)
find_path(LIBAIRSPY_INCLUDE_DIR NAMES libairspy/airspy.h
PATHS
${LIBAIRSPY_PKG_INCLUDE_DIRS}
/usr/include
/usr/local/include
)
find_library(LIBAIRSPY_LIBRARIES NAMES airspy
PATHS
${LIBAIRSPY_PKG_LIBRARY_DIRS}
/usr/lib
/usr/local/lib
)
if(LIBAIRSPY_INCLUDE_DIR AND LIBAIRSPY_LIBRARIES)
set(LIBAIRSPY_FOUND TRUE CACHE INTERNAL "libairspy found")
message(STATUS "Found libairspy: ${LIBAIRSPY_INCLUDE_DIR}, ${LIBAIRSPY_LIBRARIES}")
else(LIBAIRSPY_INCLUDE_DIR AND LIBAIRSPY_LIBRARIES)
set(LIBAIRSPY_FOUND FALSE CACHE INTERNAL "libairspy found")
message(STATUS "libairspy not found.")
endif(LIBAIRSPY_INCLUDE_DIR AND LIBAIRSPY_LIBRARIES)
mark_as_advanced(LIBAIRSPY_INCLUDE_DIR LIBAIRSPY_LIBRARIES)
endif(NOT LIBAIRSPY_FOUND)

View File

@@ -1,28 +0,0 @@
if(NOT LIBRTLSDR_FOUND)
pkg_check_modules (LIBRTLSDR_PKG librtlsdr)
find_path(LIBRTLSDR_INCLUDE_DIR NAMES rtl-sdr.h
PATHS
${LIBRTLSDR_PKG_INCLUDE_DIRS}
/usr/include
/usr/local/include
)
find_library(LIBRTLSDR_LIBRARIES NAMES rtlsdr
PATHS
${LIBRTLSDR_PKG_LIBRARY_DIRS}
/usr/lib
/usr/local/lib
)
if(LIBRTLSDR_INCLUDE_DIR AND LIBRTLSDR_LIBRARIES)
set(LIBRTLSDR_FOUND TRUE CACHE INTERNAL "librtlsdr found")
message(STATUS "Found librtlsdr: ${LIBRTLSDR_INCLUDE_DIR}, ${LIBRTLSDR_LIBRARIES}")
else(LIBRTLSDR_INCLUDE_DIR AND LIBRTLSDR_LIBRARIES)
set(LIBRTLSDR_FOUND FALSE CACHE INTERNAL "librtlsdr found")
message(STATUS "librtlsdr not found.")
endif(LIBRTLSDR_INCLUDE_DIR AND LIBRTLSDR_LIBRARIES)
mark_as_advanced(LIBRTLSDR_INCLUDE_DIR LIBRTLSDR_LIBRARIES)
endif(NOT LIBRTLSDR_FOUND)

View File

@@ -1,20 +0,0 @@
# Find libsamplerate
FIND_PATH(LIBSAMPLERATE_INCLUDE_DIR samplerate.h)
SET(LIBSAMPLERATE_NAMES ${LIBSAMPLERATE_NAMES} samplerate libsamplerate)
FIND_LIBRARY(LIBSAMPLERATE_LIBRARY NAMES ${LIBSAMPLERATE_NAMES} PATH)
IF (LIBSAMPLERATE_INCLUDE_DIR AND LIBSAMPLERATE_LIBRARY)
SET(LIBSAMPLERATE_FOUND TRUE)
ENDIF (LIBSAMPLERATE_INCLUDE_DIR AND LIBSAMPLERATE_LIBRARY)
IF (LIBSAMPLERATE_FOUND)
IF (NOT LibSampleRate_FIND_QUIETLY)
MESSAGE (STATUS "Found LibSampleRate: ${LIBSNDFILE_LIBRARY}")
ENDIF (NOT LibSampleRate_FIND_QUIETLY)
ELSE (LIBSAMPLERATE_FOUND)
IF (LibSampleRate_FIND_REQUIRED)
MESSAGE (FATAL_ERROR "Could not find samplerate")
ENDIF (LibSampleRate_FIND_REQUIRED)
ENDIF (LIBSAMPLERATE_FOUND)

View File

@@ -1,20 +0,0 @@
# Find libsndfile
FIND_PATH(LIBSNDFILE_INCLUDE_DIR sndfile.h)
SET(LIBSNDFILE_NAMES ${LIBSNDFILE_NAMES} sndfile libsndfile)
FIND_LIBRARY(LIBSNDFILE_LIBRARY NAMES ${LIBSNDFILE_NAMES} PATH)
IF (LIBSNDFILE_INCLUDE_DIR AND LIBSNDFILE_LIBRARY)
SET(LIBSNDFILE_FOUND TRUE)
ENDIF (LIBSNDFILE_INCLUDE_DIR AND LIBSNDFILE_LIBRARY)
IF (LIBSNDFILE_FOUND)
IF (NOT LibSndFile_FIND_QUIETLY)
MESSAGE (STATUS "Found LibSndFile: ${LIBSNDFILE_LIBRARY}")
ENDIF (NOT LibSndFile_FIND_QUIETLY)
ELSE (LIBSNDFILE_FOUND)
IF (LibSndFile_FIND_REQUIRED)
MESSAGE (FATAL_ERROR "Could not find sndfile")
ENDIF (LibSndFile_FIND_REQUIRED)
ENDIF (LIBSNDFILE_FOUND)

View File

@@ -1,52 +0,0 @@
# - Try to find Portaudio
# Once done this will define
#
# PORTAUDIO_FOUND - system has Portaudio
# PORTAUDIO_INCLUDE_DIRS - the Portaudio include directory
# PORTAUDIO_LIBRARIES - Link these to use Portaudio
include(FindPkgConfig)
pkg_check_modules(PC_PORTAUDIO portaudio-2.0)
find_path(PORTAUDIO_INCLUDE_DIRS
NAMES
portaudio.h
PATHS
/usr/local/include
/usr/include
HINTS
${PC_PORTAUDIO_INCLUDEDIR}
)
find_library(PORTAUDIO_LIBRARIES
NAMES
portaudio
PATHS
/usr/local/lib
/usr/lib
/usr/lib64
HINTS
${PC_PORTAUDIO_LIBDIR}
)
mark_as_advanced(PORTAUDIO_INCLUDE_DIRS PORTAUDIO_LIBRARIES)
# Found PORTAUDIO, but it may be version 18 which is not acceptable.
if(EXISTS ${PORTAUDIO_INCLUDE_DIRS}/portaudio.h)
include(CheckCXXSourceCompiles)
set(CMAKE_REQUIRED_INCLUDES_SAVED ${CMAKE_REQUIRED_INCLUDES})
set(CMAKE_REQUIRED_INCLUDES ${PORTAUDIO_INCLUDE_DIRS})
CHECK_CXX_SOURCE_COMPILES(
"#include <portaudio.h>\nPaDeviceIndex pa_find_device_by_name(const char *name); int main () {return 0;}"
PORTAUDIO2_FOUND)
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVED})
unset(CMAKE_REQUIRED_INCLUDES_SAVED)
if(PORTAUDIO2_FOUND)
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PORTAUDIO DEFAULT_MSG PORTAUDIO_INCLUDE_DIRS PORTAUDIO_LIBRARIES)
else(PORTAUDIO2_FOUND)
message(STATUS
" portaudio.h not compatible (requires API 2.0)")
set(PORTAUDIO_FOUND FALSE)
endif(PORTAUDIO2_FOUND)
endif()

View File

@@ -1,64 +0,0 @@
# - try to find Qwt libraries and include files
# QWT_INCLUDE_DIR where to find qwt_global.h, etc.
# QWT_LIBRARIES libraries to link against
# QWT_FOUND If false, do not try to use Qwt
# qwt_global.h holds a string with the QWT version;
# test to make sure it's at least 5.2
find_path(QWT_INCLUDE_DIRS
NAMES qwt_global.h
HINTS
${CMAKE_INSTALL_PREFIX}/include/qwt
PATHS
/usr/local/include/qwt-qt4
/usr/local/include/qwt
/usr/include/qwt6
/usr/include/qwt-qt4
/usr/include/qwt-qt4
/usr/include/qwt
/usr/include/qwt5
/usr/include/qwt6-qt5
/opt/local/include/qwt
/sw/include/qwt
/usr/local/lib/qwt.framework/Headers
)
find_library (QWT_LIBRARIES
NAMES qwt6 qwt6-qt5 qwt-qt5 qwt6-qt4 qwt qwt-qt4
HINTS
${CMAKE_INSTALL_PREFIX}/lib
${CMAKE_INSTALL_PREFIX}/lib64
PATHS
/usr/local/lib
/usr/lib
/opt/local/lib
/sw/lib
/usr/local/lib/qwt.framework
)
set(QWT_FOUND FALSE)
if(QWT_INCLUDE_DIRS)
file(STRINGS "${QWT_INCLUDE_DIRS}/qwt_global.h"
QWT_STRING_VERSION REGEX "QWT_VERSION_STR")
set(QWT_WRONG_VERSION True)
set(QWT_VERSION "No Version")
string(REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" QWT_VERSION ${QWT_STRING_VERSION})
string(COMPARE LESS ${QWT_VERSION} "5.2.0" QWT_WRONG_VERSION)
string(COMPARE GREATER ${QWT_VERSION} "6.2.0" QWT_WRONG_VERSION)
message(STATUS "QWT Version: ${QWT_VERSION}")
if(NOT QWT_WRONG_VERSION)
set(QWT_FOUND TRUE)
else(NOT QWT_WRONG_VERSION)
message(STATUS "QWT Version must be >= 5.2 and <= 6.2.0, Found ${QWT_VERSION}")
endif(NOT QWT_WRONG_VERSION)
endif(QWT_INCLUDE_DIRS)
if(QWT_FOUND)
# handle the QUIETLY and REQUIRED arguments and set QWT_FOUND to TRUE if
# all listed variables are TRUE
include ( FindPackageHandleStandardArgs )
find_package_handle_standard_args( Qwt DEFAULT_MSG QWT_LIBRARIES QWT_INCLUDE_DIRS )
MARK_AS_ADVANCED(QWT_LIBRARIES QWT_INCLUDE_DIRS)
endif(QWT_FOUND)

View File

@@ -1,20 +0,0 @@
# Find zlib
FIND_PATH(ZLIB_INCLUDE_DIR zlib.h)
SET(ZLIB_NAMES ${ZLIB_NAMES} libz z)
FIND_LIBRARY(ZLIB_LIBRARY NAMES ${ZLIB_NAMES} PATH)
IF (ZLIB_INCLUDE_DIR AND ZLIB_LIBRARY)
SET(ZLIB_FOUND TRUE)
ENDIF (ZLIB_INCLUDE_DIR AND ZLIB_LIBRARY)
IF (ZLIB_FOUND)
IF (NOT zlib_FIND_QUIETLY)
MESSAGE (STATUS "Found zlib: ${ZLIBFILE_LIBRARY}")
ENDIF (NOT zlib_FIND_QUIETLY)
ELSE (ZLIB_FOUND)
IF (zlib_FIND_REQUIRED)
MESSAGE (FATAL_ERROR "Could not find zlib")
ENDIF (zlib_FIND_REQUIRED)
ENDIF (ZLIB_FOUND)

View File

@@ -1,21 +0,0 @@
if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
string(REGEX REPLACE "\n" ";" files "${files}")
foreach(file ${files})
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
exec_program(
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
OUTPUT_VARIABLE rm_out
RETURN_VALUE rm_retval
)
if(NOT "${rm_retval}" STREQUAL 0)
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
endif(NOT "${rm_retval}" STREQUAL 0)
else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
endforeach(file)

View File

@@ -1,63 +0,0 @@
#
/*
* Copyright (C) 2009, 2010, 2011
* Jan van Katwijk (J.vanKatwijk@gmail.com)
* Lazy Chair Computing
*
* This file is part of the main program for the DAB library
*
* DAB library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* DAB library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DAB library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include <stdio.h>
#include "filesink.h"
fileSink::fileSink (std::string fileName, bool *success) {
if (fileName == "-") { // stdout
outputFile = stdout;
*success = true;
}
else {
outputFile = fopen (fileName. c_str (), "w+b");
*success = outputFile != NULL;
}
audioOK = *success;
}
fileSink::~fileSink (void) {
if (audioOK)
fclose (outputFile);
}
void fileSink::stop (void) {
}
void fileSink::restart (void) {
}
void fileSink::audioOutput (float *buffer, int32_t amount) {
if (audioOK) {
int16_t localBuffer [2 * amount];
int16_t i;
for (i = 0; i < amount; i ++) {
localBuffer [2 * i ] = buffer [2 * i] * 32767;
localBuffer [2 * i + 1] = buffer [2 * i + 1] * 32767;
}
fwrite (localBuffer, 2 * sizeof (int16_t), amount, outputFile);
}
}

View File

@@ -1,584 +0,0 @@
#
/*
* Copyright (C) 2015, 2016, 2017
* Jan van Katwijk (J.vanKatwijk@gmail.com)
* Lazy Chair Computing
*
* This file is part of the DAB-library
*
* DAB-library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* DAB-library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DAB-library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* E X A M P L E P R O G R A M
* This program might (or might not) be used to mould the interface to
* your wishes. Do not take it as a definitive and "ready: program
* for the DAB-library
*/
#include <unistd.h>
#include <signal.h>
#include <getopt.h>
#include <cstdio>
#include <iostream>
#include <sndfile.h>
#include <complex>
#include <vector>
#include <mutex>
#include "dab-api.h"
#include "audiosink.h"
#include "filesink.h"
#include "band-handler.h"
#ifdef HAVE_SDRPLAY
#include "sdrplay-handler.h"
#elif HAVE_AIRSPY
#include "airspy-handler.h"
#elif HAVE_RTLSDR
#include "rtlsdr-handler.h"
#elif HAVE_WAVFILES
#include "wavfiles.h"
#elif HAVE_RAWFILES
#include "rawfiles.h"
#elif HAVE_RTL_TCP
#include "rtl_tcp-client.h"
#endif
#include <locale>
#include <codecvt>
#include <atomic>
#ifdef DATA_STREAMER
#include "tcp-server.h"
#endif
#include <string>
using std::cerr;
using std::endl;
void printOptions (void); // forward declaration
// we deal with callbacks from different threads. So, if you extend
// the functions, take care and add locking whenever needed
static
std::atomic<bool> run;
static
void *theRadio = NULL;
static
std::atomic<bool>timeSynced;
static
std::atomic<bool>timesyncSet;
static
std::atomic<bool>ensembleRecognized;
static
audioBase *soundOut = NULL;
#ifdef DATA_STREAMER
tcpServer tdcServer (8888);
#endif
std::string programName = "Sky Radio";
int32_t serviceIdentifier = -1;
static void sighandler (int signum) {
fprintf (stderr, "Signal caught, terminating!\n");
run. store (false);
}
static
void syncsignalHandler (bool b, void *userData) {
timeSynced. store (b);
timesyncSet. store (true);
(void)userData;
}
//
// This function is called whenever the dab engine has taken
// some time to gather information from the FIC bloks
// the Boolean b tells whether or not an ensemble has been
// recognized, the names of the programs are in the
// ensemble
static
void ensemblenameHandler (std::string name, int Id, void *userData) {
fprintf (stderr, "ensemble %s is (%X) recognized\n",
name. c_str (), (uint32_t)Id);
ensembleRecognized. store (true);
}
std::vector<std::string> programNames;
std::vector<int> programSIds;
static
void programnameHandler (std::string s, int SId, void *userdata) {
for (std::vector<std::string>::iterator it = programNames.begin();
it != programNames. end(); ++it)
if (*it == s)
return;
programNames. push_back (s);
programSIds . push_back (SId);
std::cerr << "program " << s << " is part of the ensemble\n";
}
static
void programdataHandler (audiodata *d, void *ctx) {
(void)ctx;
std::cerr << "\tstartaddress\t= " << d -> startAddr << "\n";
std::cerr << "\tlength\t\t= " << d -> length << "\n";
std::cerr << "\tsubChId\t\t= " << d -> subchId << "\n";
std::cerr << "\tprotection\t= " << d -> protLevel << "\n";
std::cerr << "\tbitrate\t\t= " << d -> bitRate << "\n";
}
//
// The function is called from within the library with
// a string, the so-called dynamic label
static
void dataOut_Handler (std::string dynamicLabel, void *ctx) {
(void)ctx;
std::cerr << dynamicLabel << "\r";
}
//
// The function is called from the MOT handler, with
// as parameters the filename where the picture is stored
// d denotes the subtype of the picture
// typedef void (*motdata_t)(std::string, int, void *);
void motdataHandler (std::string s, int d, void *ctx) {
(void)s; (void)d; (void)ctx;
fprintf (stderr, "plaatje %s\n", s. c_str ());
}
//
// Note: the function is called from the tdcHandler with a
// frame, either frame 0 or frame 1.
// The frames are packed bytes, here an additional header
// is added, a header of 8 bytes:
// the first 4 bytes for a pattern 0xFF 0x00 0xFF 0x00 0xFF
// the length of the contents, i.e. framelength without header
// is stored in bytes 5 (high byte) and byte 6.
// byte 7 contains 0x00, byte 8 contains 0x00 for frametype 0
// and 0xFF for frametype 1
// Note that the callback function is executed in the thread
// that executes the tdcHandler code.
static
void bytesOut_Handler (uint8_t *data, int16_t amount,
uint8_t type, void *ctx) {
#ifdef DATA_STREAMER
uint8_t localBuf [amount + 8];
int16_t i;
localBuf [0] = 0xFF;
localBuf [1] = 0x00;
localBuf [2] = 0xFF;
localBuf [3] = 0x00;
localBuf [4] = (amount >> 8) & 0xFF;
localBuf [5] = amount & 0xFF;
localBuf [6] = 0x00;
localBuf [7] = type == 0 ? 0 : 0xFF;
for (i = 0; i < amount; i ++)
localBuf [8 + i] = data;
tdcServer. sendData (localBuf, amount + 8);
#else
(void)data;
(void)amount;
#endif
(void)ctx;
}
//
// This function is overloaded. In the normal form it
// handles a buffer full of PCM samples. We pass them on to the
// audiohandler, based on portaudio. Feel free to modify this
// and send the samples elsewhere
//
// However, in the "special mode", the aac frames are send out
// Obviously, the parameters "rate" and "isStereo" are meaningless
// then.
static
SNDFILE *audiofilePointer = NULL;
mutex pcmLock;
int sleepLimit = -1;
int sleepCounter = -1;
static
void pcmHandler (int16_t *buffer, int size, int rate,
bool isStereo, void *ctx) {
static bool isStarted = false;
(void)isStereo;
if (!isStarted) {
soundOut -> restart ();
isStarted = true;
}
pcmLock. lock ();
if (audiofilePointer != NULL)
soundOut -> audioOut (audiofilePointer, buffer, size, rate);
else
soundOut -> audioOut (buffer, size, rate);
pcmLock. unlock ();
}
static
void systemData (bool flag, int16_t snr, int32_t freqOff, void *ctx) {
// fprintf (stderr, "synced = %s, snr = %d, offset = %d\n",
// flag? "on":"off", snr, freqOff);
}
static
void fibQuality (int16_t q, void *ctx) {
// fprintf (stderr, "fic quality = %d\n", q);
}
static
void mscQuality (int16_t fe, int16_t rsE, int16_t aacE, void *ctx) {
// fprintf (stderr, "msc quality = %d %d %d\n", fe, rsE, aacE);
}
int main (int argc, char **argv) {
// Default values
uint8_t theMode = 1;
std::string theChannel = "11C";
uint8_t theBand = BAND_III;
int16_t ppmCorrection = 0;
int theGain = 45; // scale = 0 .. 100
std::string soundChannel = "default";
int16_t latency = 10;
int16_t timeSyncTime = 5;
int16_t freqSyncTime = 5;
bool autogain = false;
int opt;
struct sigaction sigact;
bandHandler dabBand;
deviceHandler *theDevice;
#ifdef HAVE_WAVFILES
std::string fileName;
#elif HAVE_RAWFILES
std::string fileName;
#elif HAVE_RTL_TCP
std::string hostname = "127.0.0.1"; // default
int32_t basePort = 1234; // default
#endif
bool err;
std::cerr << "dab_cmdline V 1.0alfa,\n \
Copyright 2017 J van Katwijk, Lazy Chair Computing\n";
timeSynced. store (false);
timesyncSet. store (false);
run. store (false);
std::wcout.imbue(std::locale("en_US.utf8"));
if (argc == 1) {
printOptions ();
exit (1);
}
std::setlocale (LC_ALL, "en-US.utf8");
// For file input we do not need options like Q, G and C,
// We do need an option to specify the filename
#if (!defined (HAVE_WAVFILES) && !defined (HAVE_RAWFILES))
while ((opt = getopt (argc, argv, "D:d:M:B:C:P:G:A:L:S:QO:F:T:")) != -1) {
#elif HAVE_RTL_TCP
while ((opt = getopt (argc, argv, "D:d:M:B:C:P:G:A:L:S:H:I:QO:F:T:")) != -1) {
#else
while ((opt = getopt (argc, argv, "D:d:M:B:P:A:L:S:F:O:")) != -1) {
#endif
switch (opt) {
case 'D':
freqSyncTime = atoi (optarg);
break;
case 'd':
timeSyncTime = atoi (optarg);
break;
case 'M':
theMode = atoi (optarg);
if (!((theMode == 1) || (theMode == 2) || (theMode == 4)))
theMode = 1;
break;
case 'B':
theBand = std::string (optarg) == std::string ("L_BAND") ?
L_BAND : BAND_III;
break;
case 'P':
programName = optarg;
break;
case 'p':
ppmCorrection = atoi (optarg);
break;
#ifdef HAVE_WAVFILES
case 'F':
fileName = std::string (optarg);
break;
#elif HAVE_RAWFILES
case 'F':
fileName = std::string (optarg);
break;
#else
case 'F':
{ std::string file = std::string (optarg);
SF_INFO sf_info;
sf_info. samplerate = 48000;
sf_info. channels = 2;
sf_info. format = SF_FORMAT_WAV | SF_FORMAT_FLOAT;
audiofilePointer = sf_open (file. c_str (),
SFM_WRITE, &sf_info);
}
break;
case 'T':
sleepLimit = atoi (optarg);
sleepLimit = 60 * sleepLimit;
sleepCounter = 0;
break;
case 'C':
theChannel = std::string (optarg);
break;
case 'G':
theGain = atoi (optarg);
break;
case 'Q':
autogain = true;
break;
#ifdef HAVE_RTL_TCP
case 'H':
hostname = std::string (optarg);
break;
case 'I':
basePort = atoi (optarg);
break;
#endif
#endif
case 'O':
soundOut = new fileSink (std::string (optarg), &err);
if (!err) {
std::cerr << "sorry, could not open file\n";
exit (32);
}
break;
case 'A':
soundChannel = optarg;
break;
case 'L':
latency = atoi (optarg);
break;
case 'S': {
std::stringstream ss;
ss << std::hex << optarg;
ss >> serviceIdentifier;
break;
}
default:
printOptions ();
exit (1);
}
}
//
sigact.sa_handler = sighandler;
sigemptyset(&sigact.sa_mask);
sigact.sa_flags = 0;
int32_t frequency = dabBand. Frequency (theBand, theChannel);
try {
#ifdef HAVE_SDRPLAY
theDevice = new sdrplayHandler (frequency,
ppmCorrection,
theGain,
autogain,
0,
0);
#elif HAVE_AIRSPY
theDevice = new airspyHandler (frequency,
ppmCorrection,
theGain);
#elif HAVE_RTLSDR
theDevice = new rtlsdrHandler (frequency,
ppmCorrection,
theGain,
autogain);
#elif HAVE_WAVFILES
theDevice = new wavFiles (fileName);
#elif defined (HAVE_RAWFILES)
theDevice = new rawFiles (fileName);
#elif HAVE_RTL_TCP
theDevice = new rtl_tcp_client (hostname,
basePort,
frequency,
theGain,
autogain,
ppmCorrection);
#endif
}
catch (int e) {
std::cerr << "allocating device failed (" << e << "), fatal\n";
exit (32);
}
//
if (soundOut == NULL) { // not bound to a file?
if (audiofilePointer != NULL)
soundOut = new audioBase ();
else
soundOut = new audioSink (latency, soundChannel, &err);
if (err) {
std::cerr << "no valid sound channel, fatal\n";
exit (33);
}
}
//
// and with a sound device we now can create a "backend"
theRadio = dabInit (theDevice,
theMode,
syncsignalHandler,
systemData,
ensemblenameHandler,
programnameHandler,
fibQuality,
pcmHandler,
dataOut_Handler,
bytesOut_Handler,
programdataHandler,
mscQuality,
motdataHandler, // MOT in PAD
nullptr, // spectrum buffer
nullptr, // iqBuffer
nullptr // Ctx
);
if (theRadio == NULL) {
std::cerr << "sorry, no radio available, fatal\n";
exit (4);
}
theDevice -> setGain (theGain);
if (autogain)
theDevice -> set_autogain (autogain);
theDevice -> setVFOFrequency (frequency);
theDevice -> restartReader ();
theDevice -> setGain (theGain);
if (autogain)
theDevice -> set_autogain (autogain);
theDevice -> setVFOFrequency (frequency);
//
// The device should be working right now
timesyncSet. store (false);
ensembleRecognized. store (false);
dabStartProcessing (theRadio);
while (!timeSynced. load () && (--timeSyncTime >= 0))
sleep (1);
if (!timeSynced. load ()) {
cerr << "There does not seem to be a DAB signal here" << endl;
theDevice -> stopReader ();
sleep (1);
dabStop (theRadio);
dabExit (theRadio);
delete theDevice;
exit (22);
}
else
std::cerr << "there might be a DAB signal here" << endl;
while (!ensembleRecognized. load () &&
(--freqSyncTime >= 0)) {
std::cerr << freqSyncTime + 1 << "\r";
sleep (1);
}
std::cerr << "\n";
if (!ensembleRecognized. load ()) {
std::cerr << "no ensemble data found, fatal\n";
theDevice -> stopReader ();
sleep (1);
dabStop (theRadio);
dabExit (theRadio);
delete theDevice;
exit (22);
}
run. store (true);
if (serviceIdentifier != -1)
programName = dab_getserviceName (theRadio, serviceIdentifier);
std::cerr << "we try to start program " <<
programName << "\n";
if (!is_audioService (theRadio, programName. c_str ())) {
std::cerr << "sorry we cannot handle service " <<
programName << "\n";
run. store (false);
}
audiodata ad;
dataforAudioService (theRadio,
programName. c_str (), &ad, 0);
if (!ad. defined) {
std::cerr << "sorry we cannot handle service " <<
programName << "\n";
run. store (false);
}
dabReset_msc (theRadio);
set_audioChannel (theRadio, &ad);
while (run. load ()) {
sleep (1);
if ((sleepCounter >= 0) && (audiofilePointer != NULL)) {
sleepCounter ++;
if (sleepCounter >= sleepLimit) {
pcmLock. lock ();
sf_close (audiofilePointer);
audiofilePointer = NULL;
run. store (false);
pcmLock. unlock ();
}
}
}
theDevice -> stopReader ();
dabReset (theRadio);
if (audiofilePointer != NULL)
sf_close (audiofilePointer);
dabExit (theRadio);
delete theDevice;
delete soundOut;
}
void printOptions (void) {
std::cerr <<
" dab-cmdline options are\n\
-D number amount of time to look for an ensemble\n\
-d number seconds within a time sync should be reached\n\
-M Mode Mode is 1, 2 or 4. Default is Mode 1\n\
-B Band Band is either L_BAND or BAND_III (default)\n\
-P name program to be selected in the ensemble\n\
-C channel channel to be used\n\
-G Gain gain for device (range 1 .. 100)\n\
-Q if set, set autogain for device true\n\
-F filename in case the input is from file\n\
-A name select the audio channel (portaudio)\n\
-L number latency for audiobuffer\n\
-S hexnumber use hexnumber to identify program\n\n\
-O filename put the output into a file rather than through portaudio\n";
}

View File

@@ -1,85 +0,0 @@
#
/*
* Copyright (C) 2011, 2012, 2013
* Jan van Katwijk (J.vanKatwijk@gmail.com)
* Lazy Chair Computing
*
* This file is part of the main program of the DAB library
*
* DAB library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* DAB library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DAB library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "newconverter.h"
newConverter::newConverter (int32_t inRate, int32_t outRate,
int32_t inSize) {
int err;
this -> inRate = inRate;
this -> outRate = outRate;
inputLimit = inSize;
ratio = double(outRate) / inRate;
// fprintf (stderr, "ratio = %f\n", ratio);
outputLimit = inSize * ratio;
converter = src_new (SRC_SINC_BEST_QUALITY, 2, &err);
// converter = src_new (SRC_LINEAR, 2, &err);
// converter = src_new (SRC_SINC_MEDIUM_QUALITY, 2, &err);
src_data = new SRC_DATA;
inBuffer = new float [2 * inputLimit + 20];
outBuffer = new float [2 * outputLimit + 20];
src_data-> data_in = inBuffer;
src_data-> data_out = outBuffer;
src_data-> src_ratio = ratio;
src_data-> end_of_input = 0;
inp = 0;
}
newConverter::~newConverter (void) {
src_delete (converter);
delete [] inBuffer;
delete [] outBuffer;
delete src_data;
}
bool newConverter::convert (DSPCOMPLEX v,
DSPCOMPLEX *out, int32_t *amount) {
int32_t i;
int32_t framesOut;
int res;
inBuffer [2 * inp] = real (v);
inBuffer [2 * inp + 1] = imag (v);
inp ++;
if (inp < inputLimit)
return false;
src_data -> input_frames = inp;
src_data -> output_frames = outputLimit + 10;
res = src_process (converter, src_data);
if (res != 0) {
fprintf (stderr, "error %s\n", src_strerror (res));
return false;
}
inp = 0;
framesOut = src_data -> output_frames_gen;
for (i = 0; i < framesOut; i ++)
out [i] = DSPCOMPLEX (outBuffer [2 * i], outBuffer [2 * i + 1]);
*amount = framesOut;
return true;
}
int32_t newConverter::getOutputsize (void) {
return outputLimit;
}

View File

@@ -1,64 +0,0 @@
#
/*
* Copyright (C) 2011, 2012, 2013
* Jan van Katwijk (J.vanKatwijk@gmail.com)
* Lazy Chair Computing
*
* This file is part of the main program of the DAB library
*
* DAB library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* DAB library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DAB library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef __NEW_CONVERTER__
#define __NEW_CONVERTER__
#include <math.h>
#include <complex>
#include <stdint.h>
#include <unistd.h>
#include <limits>
#include <samplerate.h>
typedef float DSPFLOAT;
typedef std::complex<DSPFLOAT> DSPCOMPLEX;
using namespace std;
class newConverter {
private:
int32_t inRate;
int32_t outRate;
double ratio;
int32_t outputLimit;
int32_t inputLimit;
SRC_STATE *converter;
SRC_DATA *src_data;
float *inBuffer;
float *outBuffer;
int32_t inp;
public:
newConverter (int32_t inRate, int32_t outRate,
int32_t inSize);
~newConverter (void);
bool convert (DSPCOMPLEX v,
DSPCOMPLEX *out, int32_t *amount);
int32_t getOutputsize (void);
};
#endif

View File

@@ -1,321 +0,0 @@
#
/*
* $Id: pa_ringbuffer.c 1738 2011-08-18 11:47:28Z rossb $
* Portable Audio I/O Library
* Ring Buffer utility.
*
* Author: Phil Burk, http://www.softsynth.com
* modified for SMP safety on Mac OS X by Bjorn Roche
* modified for SMP safety on Linux by Leland Lucius
* also, allowed for const where possible
* modified for multiple-byte-sized data elements by Sven Fischer
*
* Note that this is safe only for a single-thread reader and a
* single-thread writer.
*
* This program uses the PortAudio Portable Audio Library.
* For more information see: http://www.portaudio.com
* Copyright (c) 1999-2000 Ross Bencina and Phil Burk
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files
* (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*
*
* Copyright (C) 2008, 2009, 2010
* Jan van Katwijk (J.vanKatwijk@gmail.com)
* Lazy Chair Computing
*
* The ringbuffer here is a rewrite of the ringbuffer used in the PA code
* All rights remain with their owners
* This file is part of the SDR-J.
* Many of the ideas as implemented in SDR-J are derived from
* other work, made available through the GNU general Public License.
* All copyrights of the original authors are recognized.
*
* SDR-J is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* SDR-J is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ESDR; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __RINGBUFFER
#define __RINGBUFFER
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>
/*
* a simple ringbuffer, lockfree, however only for a
* single reader and a single writer.
* Mostly used for getting samples from or to the soundcard
*/
#if defined(__APPLE__)
# include <libkern/OSAtomic.h>
/* Here are the memory barrier functions. Mac OS X only provides
full memory barriers, so the three types of barriers are the same,
however, these barriers are superior to compiler-based ones. */
# define PaUtil_FullMemoryBarrier() OSMemoryBarrier()
# define PaUtil_ReadMemoryBarrier() OSMemoryBarrier()
# define PaUtil_WriteMemoryBarrier() OSMemoryBarrier()
#elif defined(__GNUC__)
/* GCC >= 4.1 has built-in intrinsics. We'll use those */
# if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)
# define PaUtil_FullMemoryBarrier() __sync_synchronize()
# define PaUtil_ReadMemoryBarrier() __sync_synchronize()
# define PaUtil_WriteMemoryBarrier() __sync_synchronize()
/* as a fallback, GCC understands volatile asm and "memory" to mean it
* should not reorder memory read/writes */
# elif defined( __PPC__ )
# define PaUtil_FullMemoryBarrier() asm volatile("sync":::"memory")
# define PaUtil_ReadMemoryBarrier() asm volatile("sync":::"memory")
# define PaUtil_WriteMemoryBarrier() asm volatile("sync":::"memory")
# elif defined( __i386__ ) || defined( __i486__ ) || defined( __i586__ ) || defined( __i686__ ) || defined( __x86_64__ )
# define PaUtil_FullMemoryBarrier() asm volatile("mfence":::"memory")
# define PaUtil_ReadMemoryBarrier() asm volatile("lfence":::"memory")
# define PaUtil_WriteMemoryBarrier() asm volatile("sfence":::"memory")
# else
# ifdef ALLOW_SMP_DANGERS
# warning Memory barriers not defined on this system or system unknown
# warning For SMP safety, you should fix this.
# define PaUtil_FullMemoryBarrier()
# define PaUtil_ReadMemoryBarrier()
# define PaUtil_WriteMemoryBarrier()
# else
# error Memory barriers are not defined on this system. You can still compile by defining ALLOW_SMP_DANGERS, but SMP safety will not be guaranteed.
# endif
# endif
#else
# ifdef ALLOW_SMP_DANGERS
# warning Memory barriers not defined on this system or system unknown
# warning For SMP safety, you should fix this.
# define PaUtil_FullMemoryBarrier()
# define PaUtil_ReadMemoryBarrier()
# define PaUtil_WriteMemoryBarrier()
# else
# error Memory barriers are not defined on this system. You can still compile by defining ALLOW_SMP_DANGERS, but SMP safety will not be guaranteed.
# endif
#endif
template <class elementtype>
class RingBuffer {
private:
uint32_t bufferSize;
volatile uint32_t writeIndex;
volatile uint32_t readIndex;
uint32_t bigMask;
uint32_t smallMask;
char *buffer;
public:
RingBuffer (uint32_t elementCount) {
if (((elementCount - 1) & elementCount) != 0)
elementCount = 2 * 16384; /* default */
bufferSize = elementCount;
buffer = new char [2 * bufferSize * sizeof (elementtype)];
writeIndex = 0;
readIndex = 0;
smallMask = (elementCount)- 1;
bigMask = (elementCount * 2) - 1;
}
~RingBuffer () {
delete[] buffer;
}
/*
* functions for checking available data for reading and space
* for writing
*/
int32_t GetRingBufferReadAvailable (void) {
return (writeIndex - readIndex) & bigMask;
}
int32_t ReadSpace (void){
return GetRingBufferReadAvailable ();
}
int32_t GetRingBufferWriteAvailable (void) {
return bufferSize - GetRingBufferReadAvailable ();
}
int32_t WriteSpace (void) {
return GetRingBufferWriteAvailable ();
}
void FlushRingBuffer () {
writeIndex = 0;
readIndex = 0;
}
/* ensure that previous writes are seen before we update the write index
(write after write)
*/
int32_t AdvanceRingBufferWriteIndex (int32_t elementCount) {
PaUtil_WriteMemoryBarrier();
return writeIndex = (writeIndex + elementCount) & bigMask;
}
/* ensure that previous reads (copies out of the ring buffer) are
* always completed before updating (writing) the read index.
* (write-after-read) => full barrier
*/
int32_t AdvanceRingBufferReadIndex (int32_t elementCount) {
PaUtil_FullMemoryBarrier();
return readIndex = (readIndex + elementCount) & bigMask;
}
/***************************************************************************
** Get address of region(s) to which we can write data.
** If the region is contiguous, size2 will be zero.
** If non-contiguous, size2 will be the size of second region.
** Returns room available to be written or elementCount, whichever is smaller.
*/
int32_t GetRingBufferWriteRegions (uint32_t elementCount,
void **dataPtr1, int32_t *sizePtr1,
void **dataPtr2, int32_t *sizePtr2 ) {
uint32_t index;
uint32_t available = GetRingBufferWriteAvailable ();
if (elementCount > available)
elementCount = available;
/* Check to see if write is not contiguous. */
index = writeIndex & smallMask;
if ((index + elementCount) > bufferSize ) {
/* Write data in two blocks that wrap the buffer. */
int32_t firstHalf = bufferSize - index;
*dataPtr1 = &buffer[index * sizeof(elementtype)];
*sizePtr1 = firstHalf;
*dataPtr2 = &buffer [0];
*sizePtr2 = elementCount - firstHalf;
}
else { // fits
*dataPtr1 = &buffer [index * sizeof(elementtype)];
*sizePtr1 = elementCount;
*dataPtr2 = NULL;
*sizePtr2 = 0;
}
if (available > 0)
PaUtil_FullMemoryBarrier(); /* (write-after-read) => full barrier */
return elementCount;
}
/***************************************************************************
** Get address of region(s) from which we can read data.
** If the region is contiguous, size2 will be zero.
** If non-contiguous, size2 will be the size of second region.
** Returns room available to be read or elementCount, whichever is smaller.
*/
int32_t GetRingBufferReadRegions (uint32_t elementCount,
void **dataPtr1, int32_t *sizePtr1,
void **dataPtr2, int32_t *sizePtr2) {
uint32_t index;
uint32_t available = GetRingBufferReadAvailable (); /* doesn't use memory barrier */
if (elementCount > available)
elementCount = available;
/* Check to see if read is not contiguous. */
index = readIndex & smallMask;
if ((index + elementCount) > bufferSize) {
/* Write data in two blocks that wrap the buffer. */
int32_t firstHalf = bufferSize - index;
*dataPtr1 = &buffer [index * sizeof(elementtype)];
*sizePtr1 = firstHalf;
*dataPtr2 = &buffer [0];
*sizePtr2 = elementCount - firstHalf;
}
else {
*dataPtr1 = &buffer [index * sizeof(elementtype)];
*sizePtr1 = elementCount;
*dataPtr2 = NULL;
*sizePtr2 = 0;
}
if (available)
PaUtil_ReadMemoryBarrier(); /* (read-after-read) => read barrier */
return elementCount;
}
int32_t putDataIntoBuffer (const void *data, int32_t elementCount) {
int32_t size1, size2, numWritten;
void *data1;
void *data2;
numWritten = GetRingBufferWriteRegions (elementCount,
&data1, &size1,
&data2, &size2 );
if (size2 > 0) {
memcpy (data1, data, size1 * sizeof(elementtype));
data = ((char *)data) + size1 * sizeof(elementtype);
memcpy (data2, data, size2 * sizeof(elementtype));
}
else
memcpy (data1, data, size1 * sizeof(elementtype));
AdvanceRingBufferWriteIndex (numWritten );
return numWritten;
}
int32_t getDataFromBuffer (void *data, int32_t elementCount ) {
int32_t size1, size2, numRead;
void *data1;
void *data2;
numRead = GetRingBufferReadRegions (elementCount,
&data1, &size1,
&data2, &size2 );
if (size2 > 0) {
memcpy (data, data1, size1 * sizeof(elementtype));
data = ((char *)data) + size1 * sizeof(elementtype);
memcpy (data, data2, size2 * sizeof(elementtype));
}
else
memcpy (data, data1, size1 * sizeof(elementtype));
AdvanceRingBufferReadIndex (numRead );
return numRead;
}
int32_t skipDataInBuffer (uint32_t n_values) {
// ensure that we have the correct read and write indices
PaUtil_FullMemoryBarrier ();
if (n_values > GetRingBufferReadAvailable ())
n_values = GetRingBufferReadAvailable ();
AdvanceRingBufferReadIndex (n_values);
return n_values;
}
};
#endif

View File

@@ -1,124 +0,0 @@
#
/*
* Copyright (C) 2016, 2017
* Jan van Katwijk (J.vanKatwijk@gmail.com)
* Lazy Chair Computing
*
* This file is part of the DAB-library
* DAB-library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* DAB-library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DAB-library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Simple streaming server, for e.g. epg data and tpg data
*/
#include <stdint.h>
#include <ringbuffer.h>
#include <arpa/inet.h>
#include "tcp-server.h"
tcpServer::tcpServer (int port) {
buffer = new RingBuffer<uint8_t> (32 * 32768);
connected. store (false);
threadHandle = std::thread (&tcpServer::run, this, port);
}
tcpServer::~tcpServer (void) {
if (running. load ()) {
running. store (false);
usleep (1000);
threadHandle. join ();
}
delete buffer;
}
void tcpServer::sendData (uint8_t *data, int32_t amount) {
if (connected)
buffer -> putDataIntoBuffer (data, amount);
}
#define BUF_SIZE 1024
void tcpServer::run (int port) {
// Variables for writing a server.
/*
* 1. Getting the address data structure.
* 2. Opening a new socket.
* 3. Bind to the socket.
* 4. Listen to the socket.
* 5. Accept Connection.
* 6. Receive Data.
* 7. Close Connection.
*/
int socket_desc , client_sock , c , read_size;
struct sockaddr_in server , client;
//Create socket
socket_desc = socket(AF_INET , SOCK_STREAM , 0);
if (socket_desc == -1) {
fprintf (stderr, "Could not create socket");
return;
}
fprintf (stderr, "Socket created");
running. store (true);
// Prepare the sockaddr_in structure
server.sin_family = AF_INET;
server.sin_addr.s_addr = INADDR_ANY;
server.sin_port = htons (port);
// Bind
if (bind (socket_desc,
(struct sockaddr *)&server , sizeof(server)) < 0) {
// print the error message
perror ("bind failed. Error");
return;
}
fprintf (stderr, "I am now accepting connections ...\n");
// Listen
listen (socket_desc , 3);
while (running) {
// Accept a new connection and return back the socket desciptor
c = sizeof(struct sockaddr_in);
// accept connection from an incoming client
client_sock = accept (socket_desc,
(struct sockaddr *)&client,
(socklen_t*)&c);
if (client_sock < 0) {
perror("accept failed");
return;
}
fprintf (stderr, "Connection accepted");
connected = true;
try {
uint8_t localBuffer [BUF_SIZE];
int16_t amount;
int status;
while (running. load ()) {
while (running. load () &&
(buffer -> GetRingBufferReadAvailable () < BUF_SIZE))
usleep (1000);
amount = buffer -> getDataFromBuffer (localBuffer, BUF_SIZE);
status = send (client_sock, localBuffer, amount ,0);
if (status == -1) {
throw (22);
}
}
}
catch (int e) {}
connected = false;
}
// Close the socket before we finish
close (socket_desc);
running. store (false);
}

View File

@@ -1,51 +0,0 @@
#
/*
* Copyright (C) 2016, 2017
* Jan van Katwijk (J.vanKatwijk@gmail.com)
* Lazy Chair Programming
*
* This file is part of the DAB-library
* DAB-library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* DAB-library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DAB-library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Simple streaming server, for e.g. epg data and tpg data
*/
#ifndef __TCP_SERVER__
#define __TCP_SERVER__
#include <stdint.h>
#include <ringbuffer.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <string>
#include <thread>
#include <unistd.h>
#include <atomic>
class tcpServer {
public:
tcpServer (int);
~tcpServer (void);
void sendData (uint8_t *, int32_t);
void run (int port);
private:
std::thread threadHandle;
RingBuffer<uint8_t> *buffer;
std::atomic<bool> running;
std::atomic<bool> connected;
};
#endif

View File

@@ -255,7 +255,6 @@ add_definitions (-DSTREAMER_OUTPUT)
../library/includes/backend/data/mot
../library/includes/backend/data/journaline
../library/includes/support
../library/includes/support/viterbi_768
/usr/include/
)
@@ -295,7 +294,7 @@ add_definitions (-DSTREAMER_OUTPUT)
../library/includes/backend/data/mot/mot-handler.h
../library/includes/backend/data/mot/mot-dir.h
../library/includes/backend/data/mot/mot-object.h
../library/includes/support/viterbi_768/viterbi-768.h
../library/includes/support/viterbi-handler.h
../library/includes/support/protTables.h
../library/includes/support/protection.h
../library/includes/support/uep-protection.h
@@ -340,8 +339,7 @@ add_definitions (-DSTREAMER_OUTPUT)
../library/src/backend/data/mot/mot-handler.cpp
../library/src/backend/data/mot/mot-dir.cpp
../library/src/backend/data/mot/mot-object.cpp
../library/src/support/viterbi_768/viterbi-768.cpp
../library/src/support/viterbi_768/spiral-no-sse.c
../library/src/support/viterbi-handler.cpp
../library/src/support/protTables.cpp
../library/src/support/protection.cpp
../library/src/support/eep-protection.cpp

View File

@@ -255,7 +255,6 @@ endif ()
../library/includes/backend/data/mot
../library/includes/backend/data/journaline
../library/includes/support
../library/includes/support/viterbi_768
/usr/include/
)
@@ -294,7 +293,7 @@ endif ()
../library/includes/backend/data/mot/mot-handler.h
../library/includes/backend/data/mot/mot-dir.h
../library/includes/backend/data/mot/mot-object.h
../library/includes/support/viterbi_768/viterbi-768.h
../library/includes/support/viterbi-handler.h
../library/includes/support/protTables.h
../library/includes/support/protection.h
../library/includes/support/uep-protection.h
@@ -338,8 +337,7 @@ endif ()
../library/src/backend/data/mot/mot-handler.cpp
../library/src/backend/data/mot/mot-dir.cpp
../library/src/backend/data/mot/mot-object.cpp
../library/src/support/viterbi_768/viterbi-768.cpp
../library/src/support/viterbi_768/spiral-no-sse.c
../library/src/support/viterbi-handler.cpp
../library/src/support/protTables.cpp
../library/src/support/protection.cpp
../library/src/support/eep-protection.cpp

View File

@@ -267,7 +267,6 @@ endif ()
../library/includes/backend/data/mot
../library/includes/backend/data/journaline
../library/includes/support
../library/includes/support/viterbi_768
/usr/include/
)
@@ -310,7 +309,7 @@ endif ()
../library/includes/backend/data/mot/mot-handler.h
../library/includes/backend/data/mot/mot-dir.h
../library/includes/backend/data/mot/mot-object.h
../library/includes/support/viterbi_768/viterbi-768.h
../library/includes/support/viterbi-handler.h
../library/includes/support/protTables.h
../library/includes/support/protection.h
../library/includes/support/uep-protection.h
@@ -358,8 +357,7 @@ endif ()
../library/src/backend/data/mot/mot-handler.cpp
../library/src/backend/data/mot/mot-dir.cpp
../library/src/backend/data/mot/mot-object.cpp
../library/src/support/viterbi_768/viterbi-768.cpp
../library/src/support/viterbi_768/spiral-no-sse.c
../library/src/support/viterbi-handler.cpp
../library/src/support/protTables.cpp
../library/src/support/protection.cpp
../library/src/support/eep-protection.cpp

View File

@@ -237,7 +237,6 @@ endif ()
../library/includes/backend/data/mot
../library/includes/backend/data/journaline
../library/includes/support
../library/includes/support/viterbi_768
/usr/include/
)
@@ -282,7 +281,7 @@ endif ()
../library/includes/backend/data/mot/mot-handler.h
../library/includes/backend/data/mot/mot-dir.h
../library/includes/backend/data/mot/mot-object.h
../library/includes/support/viterbi_768/viterbi-768.h
../library/includes/support/viterbi-handler.h
../library/includes/support/protTables.h
../library/includes/support/protection.h
../library/includes/support/uep-protection.h
@@ -330,8 +329,7 @@ endif ()
../library/src/backend/data/mot/mot-handler.cpp
../library/src/backend/data/mot/mot-dir.cpp
../library/src/backend/data/mot/mot-object.cpp
../library/src/support/viterbi_768/viterbi-768.cpp
../library/src/support/viterbi_768/spiral-no-sse.c
../library/src/support/viterbi-handler.cpp
../library/src/support/protTables.cpp
../library/src/support/protection.cpp
../library/src/support/eep-protection.cpp

View File

@@ -109,7 +109,6 @@ list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake/Modules)
../library/includes/backend/data/mot
../library/includes/backend/data/journaline
../library/includes/support
../library/includes/support/viterbi_768
/usr/include/
)
@@ -151,7 +150,7 @@ list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake/Modules)
../library/includes/backend/data/mot/mot-dir.h
../library/includes/backend/data/mot/mot-object.h
../library/includes/backend/data/data-processor.h
../library/includes/support/viterbi_768/viterbi-768.h
../library/includes/support/viterbi-handler.h
../library/includes/support/protTables.h
../library/includes/support/protection.h
../library/includes/support/uep-protection.h
@@ -198,8 +197,7 @@ list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake/Modules)
../library/src/backend/data/mot/mot-dir.cpp
../library/src/backend/data/mot/mot-object.cpp
../library/src/backend/data/data-processor.cpp
../library/src/support/viterbi_768/viterbi-768.cpp
../library/src/support/viterbi_768/spiral-no-sse.c
../library/src/support/viterbi-handler.cpp
../library/src/support/protTables.cpp
../library/src/support/protection.cpp
../library/src/support/eep-protection.cpp

View File

@@ -66,7 +66,6 @@ list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake/Modules)
./includes/backend/data/mot
./includes/backend/data/journaline
./includes/support
./includes/support/viterbi_768
/usr/include/
)
@@ -104,7 +103,7 @@ list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake/Modules)
./includes/backend/data/mot/mot-dir.h
./includes/backend/data/mot/mot-object.h
./includes/support/protTables.h
./includes/support/viterbi_768/viterbi-768.h
./includes/support/viterbi-handler.h
./includes/support/protection.h
./includes/support/uep-protection.h
./includes/support/eep-protection.h
@@ -143,8 +142,7 @@ list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake/Modules)
./src/backend/data/mot/mot-handler.cpp
./src/backend/data/mot/mot-dir.cpp
./src/backend/data/mot/mot-object.cpp
./src/support/viterbi_768/viterbi-768.cpp
./src/support/viterbi_768/spiral-no-sse.c
./src/support/viterbi_handler.cpp
./src/support/protection.cpp
./src/support/protTables.cpp
./src/support/eep-protection.cpp

View File

@@ -90,36 +90,6 @@ bool is_dataService (void *Handle, const char *name) {
PACKET_SERVICE;
}
// functions contributed by Hayati Ayguen
// mainId < 0 (-1) => don't check mainId
// subId == -1 => deliver first available offset
// subId == -2 => deliver coarse coordinates
void dab_getCoordinates (void *Handle,
int16_t mainId, int16_t subId,
float *latitude, float *longitude,
bool *success,
int16_t *pMainId, int16_t *pSubId,
int16_t *pTD) {
std::complex<float> r =
((dabProcessor *)Handle) -> get_coordinates (mainId,
subId,
success,
pMainId,
pSubId, pTD);
*latitude = r.real();
*longitude = r.imag();
}
uint8_t dab_getExtendedCountryCode (void *Handle,
bool *success) {
return ((dabProcessor *)Handle) -> getECC(success);
}
uint8_t dab_getInternationalTabId (void *Handle,
bool *success) {
return ((dabProcessor *)Handle) -> getInterTabId(success);
}
void dataforAudioService (void *Handle,
const char *name,
audiodata *d, int o) {

View File

@@ -84,13 +84,6 @@ public:
void reset_msc (void);
std::complex<float>
get_coordinates (int16_t, int16_t, bool *);
std::complex<float>
get_coordinates (int16_t, int16_t, bool *,
int16_t *pMainId,
int16_t *pSubId,
int16_t *pTD);
uint8_t getECC (bool *);
uint8_t getInterTabId (bool *);
private:
deviceHandler *inputDevice;

View File

@@ -110,14 +110,6 @@ public:
get_coordinates (int16_t, int16_t, bool *);
void reset (void);
// Extended functions, contributed by Hayati Ayguen
std::complex<float>
get_coordinates (int16_t, int16_t, bool *,
int16_t *pMainId,
int16_t *pSubId,
int16_t *pTD);
uint8_t getECC (bool *);
uint8_t getInterTabId (bool *);
private:
ensemblename_t ensemblenameHandler;

View File

@@ -29,14 +29,14 @@
#include <stdio.h>
#include <stdint.h>
#include <vector>
#include "viterbi-768.h"
#include "viterbi-handler.h"
#include "fib-processor.h"
#include <mutex>
#include <string>
#include "dab-api.h"
#include "dab-params.h"
class ficHandler: public viterbi_768 {
class ficHandler: public viterbiHandler {
public:
ficHandler (uint8_t, // dabMode
ensemblename_t,
@@ -55,13 +55,7 @@ public:
void dataforAudioService (std::string &, audiodata *, int);
std::complex<float>
get_coordinates (int16_t, int16_t, bool *);
std::complex<float>
get_coordinates (int16_t, int16_t, bool *,
int16_t *pMainId, int16_t *,
int16_t *pTD);
void reset (void);
uint8_t getECC (bool *);
uint8_t getInterTabId (bool *);
private:
dabParams params;
fib_quality_t fib_qualityHandler;

View File

@@ -26,7 +26,6 @@
#include <stdio.h>
#include <stdint.h>
#include "protection.h"
#include "viterbi-768.h"
class eep_protection: public protection {

View File

@@ -27,9 +27,9 @@
#include <stdint.h>
#include <vector>
#include "viterbi-768.h"
#include "viterbi-handler.h"
class protection: public viterbi_768 {
class protection: public viterbiHandler {
public:
protection (int16_t, int16_t);
virtual ~protection (void);

View File

@@ -1,10 +1,10 @@
#
/*
* Copyright (C) 2009, 2010, 2011
* Copyright (C) 2014 .. 2017
* Jan van Katwijk (J.vanKatwijk@gmail.com)
* Lazy Chair Computing
*
* This file is part of the main program for the DAB library
* This file is part of DAB library
*
* DAB library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,29 +17,31 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DAB library; if not, write to the Free Software
* along with DAB-library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef __FILE_SINK__
#define __FILE_SINK__
#include <stdio.h>
#include "audio-base.h"
#include "ringbuffer.h"
#include <string>
#ifndef __VITERBI_HANDLER__
#define __VITERBI_HANDLER__
#include <stdint.h>
class viterbiHandler {
class fileSink : public audioBase {
public:
fileSink (std::string, bool *);
~fileSink (void);
void stop (void);
void restart (void);
viterbiHandler (int);
~viterbiHandler (void);
void deconvolve (int16_t *, uint8_t *);
private:
void audioOutput (float *, int32_t);
FILE *outputFile;
bool audioOK;
int costTable [16];
void computeCostTable (int16_t, int16_t, int16_t, int16_t);
uint8_t bitFor (int, int, int);
int blockLength;
int *stateSequence;
int **transCosts;
int **history;
};
#endif

View File

@@ -326,24 +326,6 @@ std::complex<float>
return my_ficHandler. get_coordinates (mainId, subId, success);
}
std::complex<float>
dabProcessor::get_coordinates (int16_t mainId, int16_t subId,
bool *success,
int16_t *pMainId, int16_t *pSubId,
int16_t *pTD) {
return my_ficHandler. get_coordinates (mainId, subId, success,
pMainId, pSubId, pTD);
}
uint8_t dabProcessor::getECC (bool *success) {
return my_ficHandler. getECC (success);
}
uint8_t dabProcessor::getInterTabId (bool *success) {
return my_ficHandler. getInterTabId (success);
}
void dabProcessor::set_audioChannel (audiodata *d) {
my_mscHandler. set_audioChannel (d);
}

View File

@@ -1515,28 +1515,6 @@ std::complex<float> fib_processor::get_coordinates (int16_t mainId,
return coordinates. get_coordinates (mainId, subId, success);
}
// mainId < 0 (-1) => don't check mainId
// subId == -1 => deliver first available offset
// subId == -2 => deliver coarse coordinates
std::complex<float>
fib_processor::get_coordinates (int16_t mainId,
int16_t subId, bool *success,
int16_t *pMainId,
int16_t *pSubId, int16_t *pTD) {
//coordinates. print_coordinates ();
return coordinates. get_coordinates (mainId, subId, success, pMainId, pSubId, pTD);
}
uint8_t fib_processor::getECC (bool *success) {
*success = ecc_Present;
return ecc_byte;
}
uint8_t fib_processor::getInterTabId (bool *success) {
*success = interTab_Present;
return interTabId;
}
void fib_processor::reset (void) {
dateFlag = false;
ecc_Present = false;

View File

@@ -42,7 +42,7 @@
programname_t programnameHandler,
fib_quality_t fib_qualityHandler,
void *userData):
viterbi_768 (768, true),
viterbiHandler (768),
fibProcessor (ensemblenameHandler,
programnameHandler,
userData),
@@ -239,41 +239,6 @@ std::complex<float> result;
return result;
}
//
// Alternative function (extended), contributed by Hayati Ayguen
// mainId < 0 (-1) => don't check mainId
// subId == -1 => deliver first available offset
// subId == -2 => deliver coarse coordinates
std::complex<float>
ficHandler::get_coordinates (int16_t mainId,
int16_t subId, bool *success,
int16_t *pMainId, int16_t *pSubId,
int16_t *pTD) {
std::complex<float> result;
fibProtector. lock ();
result = fibProcessor. get_coordinates (mainId, subId, success,
pMainId, pSubId, pTD);
fibProtector. unlock ();
return result;
}
uint8_t ficHandler::getECC (bool *success) {
uint8_t result;
fibProtector. lock ();
result = fibProcessor. getECC (success);
fibProtector. unlock ();
return result;
}
uint8_t ficHandler::getInterTabId (bool *success) {
uint8_t result;
fibProtector. lock ();
result = fibProcessor.getInterTabId(success);
fibProtector. unlock ();
return result;
}
int16_t ficHandler::get_ficRatio (void) {
return ficRatio;

View File

@@ -158,7 +158,7 @@ int16_t inputCounter = 0;
if (indexTable [i])
viterbiBlock [i] = v [inputCounter ++];
viterbi_768::deconvolve (viterbiBlock. data (), outBuffer);
viterbiHandler::deconvolve (viterbiBlock. data (), outBuffer);
return true;
}

View File

@@ -25,7 +25,7 @@
#include "protection.h"
protection::protection (int16_t bitRate, int16_t protLevel):
viterbi_768 (24 * bitRate, false),
viterbiHandler (24 * bitRate),
outSize (24 * bitRate),
indexTable (outSize * 4 + 24),
viterbiBlock (outSize * 4 + 24) {

View File

@@ -243,7 +243,7 @@ int16_t inputCounter = 0;
viterbiBlock [i] = v [inputCounter ++];
/// The actual deconvolution is done by the viterbi decoder
viterbi_768::deconvolve (viterbiBlock. data (), outBuffer);
viterbiHandler::deconvolve (viterbiBlock. data (), outBuffer);
return true;
}

View File

@@ -0,0 +1,244 @@
#
/*
* Copyright (C) 2014 .. 2017
* Jan van Katwijk (J.vanKatwijk@gmail.com)
* Lazy Chair Computing
*
* This file is part of DAB library
*
* DAB library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* DAB library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DAB library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "viterbi-handler.h"
#include <stdio.h>
#define K 7
#define Poly1 0133
#define Poly2 0171
#define Poly3 0145
#define Poly4 0133
#define numofStates (1 << (K - 1))
static int predecessor_for_0 [numofStates];
static int predecessor_for_1 [numofStates];
static int16_t indexTable [2 * numofStates];
viterbiHandler::viterbiHandler (int blockLength) {
int i, j;
this -> blockLength = blockLength;
transCosts = new int *[blockLength + 6 + 1];
history = new int *[blockLength + 6 + 1];
stateSequence = new int [blockLength + 6 + 1];
//
for (i = 0; i < blockLength + 6; i++) {
transCosts [i] = new int [numofStates];
history [i] = new int [numofStates];
stateSequence [i] = 0;
for (j = 0; j < numofStates; j ++) {
transCosts [i][j] = 0;
history [i][j] = 0;
}
}
// These tables give a mapping from (state * bit * Poly -> outputbit)
uint8_t poly1_table [2 * numofStates];
for (i = 0; i < 2; i ++)
for (j = 0; j < numofStates; j ++)
poly1_table [i * numofStates + j] = bitFor (j, Poly1, i);
int8_t poly2_table [2 * numofStates];
for (i = 0; i < 2; i ++)
for (j = 0; j < numofStates; j ++)
poly2_table [i * numofStates + j] = bitFor (j, Poly2, i);
uint8_t poly3_table [2 * numofStates];
for (i = 0; i < 2; i ++)
for (j = 0; j < numofStates; j ++)
poly3_table [i * numofStates + j] = bitFor (j, Poly3, i);
uint8_t poly4_table [2 * numofStates];
for (i = 0; i < 2; i ++)
for (j = 0; j < numofStates; j ++)
poly4_table [i * numofStates + j] = bitFor (j, Poly4, i);
// The indextable maps the four bits we get from the polynomes
// to an index, used in computing the costs
for (i = 0; i < 2 * numofStates; i ++)
indexTable [i] = (int16_t) (
((poly1_table [i] != 0) ? 8 : 0) +
((poly2_table [i] != 0) ? 4 : 0) +
((poly3_table [i] != 0) ? 2 : 0) +
((poly4_table [i] != 0) ? 1 : 0));
for (i = 0; i < numofStates; i ++) {
predecessor_for_0 [i] = ((i << 1) + 00) & (numofStates - 1);
predecessor_for_1 [i] = ((i << 1) + 01) & (numofStates - 1);
}
}
viterbiHandler::~viterbiHandler (void) {
int i;
//
for (int i = 0; i < blockLength + 6; i++) {
delete [] transCosts [i];
delete [] history [i];
}
delete [] transCosts;
delete [] history;
delete [] stateSequence;
}
// Note that the soft bits are such that
// they are int16_t -255 -> (bit)1, +255 -> (bit)0
void viterbiHandler::computeCostTable (int16_t sym_0,
int16_t sym_1,
int16_t sym_2, int16_t sym_3) {
costTable [0] = - sym_0 - sym_1 - sym_2 - sym_3;
costTable [1] = - sym_0 - sym_1 - sym_2 + sym_3;
costTable [2] = - sym_0 - sym_1 + sym_2 - sym_3;
costTable [3] = - sym_0 - sym_1 + sym_2 + sym_3;
costTable [4] = - sym_0 + sym_1 - sym_2 - sym_3;
costTable [5] = - sym_0 + sym_1 - sym_2 + sym_3;
costTable [6] = - sym_0 + sym_1 + sym_2 - sym_3;
costTable [7] = - sym_0 + sym_1 + sym_2 + sym_3;
costTable [8] = + sym_0 - sym_1 - sym_2 - sym_3;
costTable [9] = + sym_0 - sym_1 - sym_2 + sym_3;
costTable [10] = + sym_0 - sym_1 + sym_2 - sym_3;
costTable [11] = + sym_0 - sym_1 + sym_2 + sym_3;
costTable [12] = + sym_0 + sym_1 - sym_2 - sym_3;
costTable [13] = + sym_0 + sym_1 - sym_2 + sym_3;
costTable [14] = + sym_0 + sym_1 + sym_2 - sym_3;
costTable [15] = + sym_0 + sym_1 + sym_2 + sym_3;
}
// block is the sequence of soft bits
// its length = 4 * blockLength + 4 * 6
void viterbiHandler::deconvolve (int16_t *sym, uint8_t *bitBuffer) {
int prev_0, prev_1;
int costs_0, costs_1;
int i;
// first step is to "pump" the soft bits into the state machine
// and compute the cost matrix.
// we assume the overall costs for state 0 are zero
// and remain zero
for (i = 1; i < blockLength + 6; i ++) {
int16_t sym_0 = (int16_t)(- sym [4 * (i - 1) + 0]);
int16_t sym_1 = (int16_t)(- sym [4 * (i - 1) + 1]);
int16_t sym_2 = (int16_t)(- sym [4 * (i - 1) + 2]);
int16_t sym_3 = (int16_t)(- sym [4 * (i - 1) + 3]);
int *transCosts_i = transCosts [i];
int *history_i = history [i];
computeCostTable (sym_0, sym_1, sym_2, sym_3);
for (int cState = 0; cState < numofStates / 2; cState ++) {
uint8_t entrybit = 0;
prev_0 = predecessor_for_0 [cState];
prev_1 = predecessor_for_1 [cState];
// we compute the minimal costs, based on the costs of the
// prev states, and the additional costs of arriving from
// the previous state to the current state with the symbol "sym"
//
// entrybit = 0, so the index for the cost function is prev_xx
costs_0 = transCosts [i - 1] [prev_0] +
costTable [indexTable [prev_0]];
costs_1 = transCosts [i - 1] [prev_1] +
costTable [indexTable [prev_1]];
if (costs_0 < costs_1) {
transCosts_i [cState] = costs_0;
history_i [cState] = prev_0;
} else {
transCosts_i [cState] = costs_1;
history_i [cState] = prev_1;
}
}
for (int cState = numofStates / 2;
cState < numofStates; cState ++) {
uint8_t entrybit = 1;
prev_0 = predecessor_for_0 [cState];
prev_1 = predecessor_for_1 [cState];
// we compute the minimal costs, based on the costs of the
// prev states, and the additional costs of arriving from
// the previous state to the current state with the symbol row "sym"
//
// entrybit is here "1", so the index is id cost function
// is prev_xx + NumofStates
costs_0 = transCosts [i - 1] [prev_0] +
costTable [indexTable [prev_0 + numofStates]];
costs_1 = transCosts [i - 1] [prev_1] +
costTable [indexTable [prev_1 + numofStates]];
if (costs_0 < costs_1) {
transCosts_i [cState] = costs_0;
history_i [cState] = prev_0;
} else {
transCosts_i [cState] = costs_1;
history_i [cState] = prev_1;
}
}
}
// Once all costs are computed, we can look for the minimal cost
// Our "end state" is somewhere in column blockLength + 6
int minimalCosts = 1000000;
int bestState = 0;
for (i = 0; i < numofStates; i++) {
if (transCosts [blockLength + 6 - 1][i] < minimalCosts) {
minimalCosts = transCosts [blockLength + 6 - 1][i];
bestState = i;
}
}
stateSequence [blockLength + 6 - 1] = bestState;
/*
* Trace backgoes back to state 0, and builds up the
* sequence of decoded symbols
*/
for (i = blockLength + 6 - 1; i > 0; i --)
stateSequence [i - 1] = history [i][stateSequence[i]];
for (i = 1; i <= blockLength; i++)
bitBuffer [i - 1] =
(uint8_t) ((stateSequence [i] >= numofStates / 2) ? 01 : 00);
}
/*
* as an aid, we give a function "bitFor" that, given
* the register state, the polynome and the bit to be inserted
* returns the bit coming from the engine
*/
uint8_t viterbiHandler::bitFor (int state, int poly, int bit) {
int theRegister;
uint8_t resBit = 0;
int i;
//
// the register after shifting "bit" in would be:
theRegister = bit == 0 ? state : (state + numofStates);
theRegister &= poly;
/*
* now for the individual bits
*/
for (int i = 0; i <= K; i++) {
resBit ^= (uint8_t)(theRegister & 01);
theRegister >>= 1;
}
return resBit;
}

View File

@@ -1,4 +1,5 @@
>>>>>>>>>>>>>>>>>OBSOLETE<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
cmdline.py is a simple command line interface for use with the dab library.
Since we need an interface file between the DAB library and the python
program, a CMakeLists.txt file is include with which a library can be