mirror of
https://github.com/JvanKatwijk/dab-cmdline
synced 2025-10-05 15:42:46 +02:00
Example 5 Example 5 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). It is an experimental extension of example 2. In example 5 a small keyboard listener is added such that touching the "return" key will select the "next" program. All other keys are ignored. With 'a' key visibility of the DLS is controlled, with the 'b' key the visibility of the quality indicator. 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: The "-W" parameter (to specify Waiting time) is changed into two parameters "-d" to indicate the time within which timesynchronization must be accomplished; "-D" to indicate the time within (after time sync) freq Sync must be reached 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). Added is the possibility to use xml files as input device.