Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add demodulation mode to recorder filename template #1166

Closed
wants to merge 1 commit into from

Conversation

rs1729
Copy link
Contributor

@rs1729 rs1729 commented Aug 18, 2023

#893 (comment)

Recorder filename

If $r is used in name template, it adds the demodulation type of "Radio" to the filename.
For "Baseband" it would be "IQ",
for "Audio" one of
"NFM", "WFM", "AM", "DSB", "USB", "CW", "LSB", "RAW".

(If radio "RAW" is selected, recording "Stereo" is recommended.)

@AlexandreRouma
Copy link
Owner

AlexandreRouma commented Sep 6, 2023

Many things wrong here:

  1. Why get the selected VFO when the name is based on the recorded VFO and its name is already given (see line 448 for example).
  2. Why a huge if/else statement when std::map<int, const char*> exists?

I'll implement this myself

@AlexandreRouma
Copy link
Owner

Seems that the huge switch statement is because it was copied from the rigctl_server code, my bad. I'll fix that too, it's unacceptable/

@rs1729
Copy link
Contributor Author

rs1729 commented Sep 6, 2023

Sorry, I don't know the code very well. Yes, I believe I took rigctl_server as an example, and the if/else style. There is another module, discord_integration

if (core::modComManager.interfaceExists(selectedName)) {
if (core::modComManager.getModuleName(selectedName) == "radio") {
int modeNum;
core::modComManager.callInterface(selectedName, RADIO_IFACE_CMD_GET_MODE, NULL, &modeNum);
if (modeNum == RADIO_IFACE_MODE_NFM) { strcpy(mode, "NFM"); }
else if (modeNum == RADIO_IFACE_MODE_WFM) {
strcpy(mode, "FM");
}
else if (modeNum == RADIO_IFACE_MODE_AM) {
strcpy(mode, "AM");
}
else if (modeNum == RADIO_IFACE_MODE_DSB) {
strcpy(mode, "DSB");
}
else if (modeNum == RADIO_IFACE_MODE_USB) {
strcpy(mode, "USB");
}
else if (modeNum == RADIO_IFACE_MODE_CW) {
strcpy(mode, "CW");
}
else if (modeNum == RADIO_IFACE_MODE_LSB) {
strcpy(mode, "LSB");
}
}
}

that is very similar.

My idea was: If recording baseband, append "IQ", else if recording the selected VFO audio, append the selected mode.
"RAW" audio would be like "IQ", but only the 48k IF. Also I was wondering if "stereo" should be default for RAW?

Thanks.

@rs1729
Copy link
Contributor Author

rs1729 commented Sep 6, 2023

Just tested, now if I record baseband, I get e.g.:
baseband_20230906_114527_403500066Hz_Unknown.wav

Would rather set

const char* modeStr = "Unknown";

to modeStr = "IQ",
such that
baseband_20230906_114527_403500066Hz_IQ.wav.
"baseband"..."IQ" is a bit redundant, but the default if radio/audio is not selected.

Another question:
What if the returned mode in

            core::modComManager.callInterface(name, RADIO_IFACE_CMD_GET_MODE, NULL, &mode);
            modeStr = radioModeToString[mode];

is not found in radioModeToString[mode]?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants