Skip to content

Commit

Permalink
make the modulation field of a baseband recording 'IQ' instead of 'Un…
Browse files Browse the repository at this point in the history
…known'
  • Loading branch information
AlexandreRouma committed Oct 7, 2024
1 parent 9ce62f8 commit 08f3a7d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions misc_modules/recorder/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,9 @@ class RecorderModule : public ModuleManager::Instance {
writer.setSamplerate(samplerate);

// Open file
std::string type = (recMode == RECORDER_MODE_AUDIO) ? "audio" : "baseband";
std::string vfoName = (recMode == RECORDER_MODE_AUDIO) ? selectedStreamName : "";
std::string extension = ".wav";
std::string expandedPath = expandString(folderSelect.path + "/" + genFileName(nameTemplate, type, vfoName) + extension);
std::string expandedPath = expandString(folderSelect.path + "/" + genFileName(nameTemplate, recMode, vfoName) + extension);
if (!writer.open(expandedPath)) {
flog::error("Failed to open file for recording: {0}", expandedPath);
return;
Expand Down Expand Up @@ -452,7 +451,7 @@ class RecorderModule : public ModuleManager::Instance {
{ RADIO_IFACE_MODE_RAW, "RAW" }
};

std::string genFileName(std::string templ, std::string type, std::string name) {
std::string genFileName(std::string templ, int mode, std::string name) {
// Get data
time_t now = time(0);
tm* ltm = localtime(&now);
Expand All @@ -462,6 +461,9 @@ class RecorderModule : public ModuleManager::Instance {
freq += gui::waterfall.vfos[name]->generalOffset;
}

// Select the recording type string
std::string type = (recMode == RECORDER_MODE_AUDIO) ? "audio" : "baseband";

// Format to string
char freqStr[128];
char hourStr[128];
Expand All @@ -470,7 +472,7 @@ class RecorderModule : public ModuleManager::Instance {
char dayStr[128];
char monStr[128];
char yearStr[128];
const char* modeStr = "Unknown";
const char* modeStr = (recMode == RECORDER_MODE_AUDIO) ? "Unknown" : "IQ";
sprintf(freqStr, "%.0lfHz", freq);
sprintf(hourStr, "%02d", ltm->tm_hour);
sprintf(minStr, "%02d", ltm->tm_min);
Expand Down

0 comments on commit 08f3a7d

Please sign in to comment.