MCPcopy Create free account
hub / github.com/cjcliffe/CubicSDR / setAudioFileHandler

Method setAudioFileHandler

src/audio/AudioSinkFileThread.cpp:95–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95void AudioSinkFileThread::setAudioFileHandler(AudioFile * output) {
96 audioFileHandler = output;
97
98 //initialize the filename of the AudioFile with the current time
99 time_t t = std::time(nullptr);
100 tm ltm = *std::localtime(&t);
101
102 // GCC 5+
103 // fileName << "_" << std::put_time(&ltm, "%d-%m-%Y_%H-%M-%S");
104
105 char timeStr[512];
106 //International format: Year.Month.Day, also lexicographically sortable
107 strftime(timeStr, sizeof(timeStr), "%Y-%m-%d_%H-%M-%S", &ltm);
108
109 audioFileHandler->setOutputFileName(fileNameBase + std::string("_") + timeStr);
110
111 // reset Timer
112 durationMeasurement.start();
113}
114
115void AudioSinkFileThread::setSquelchOption(int squelchOptEnumValue) {
116

Callers 1

startRecordingMethod · 0.80

Calls 2

setOutputFileNameMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected