Standalone-Demodulators
Standalone-Demodulators copied to clipboard
WIP: Batch mode
Trying to decouple UI logic from processing. Will add code for a command line version.
I'm not sure how to end the program because the writing process doesn't have a "break" in the while(1). So what I did was wait for EOF on the input, then add a 1 second delay to let the worker processes finish, and finally finish the program. Ugly hack but it seems to work. I tried the 4 combinations of stdin to file, file to file, stdin to stdout and file to stdout with a random input file (a 500 meg noise only baseband recording) and then did a SHA hash of all 4 files. The 4 files matched. I haven't tried compiling this in Windows but there is a windows-specific call to put Windows' stdin/out in binary mode.
Indeed, a proper end sequence is something I had on my todo list. My idea was having bools for each loop, wait for each producer in the chain to stop, let the next worker finish up until the fifo is empty and then close off properly down to the last worker - that write data out. Now a 1s timeout is definitely enough to let things finish up, and should work in the meantime even if that's still a pretty ugly hack... Shame on me for not doing this earlier I guess!
I just tried building in my mingw environment, everything built and worked as expected.