Legacy session load tweak, modem type selection refresh fix
This commit is contained in:
parent
eb7986e25f
commit
cdddd5850f
|
@ -1193,11 +1193,12 @@ bool AppFrame::loadSession(std::string fileName) {
|
||||||
std::string output_device = demod->hasAnother("output_device") ? string(*(demod->getNext("output_device"))) : "";
|
std::string output_device = demod->hasAnother("output_device") ? string(*(demod->getNext("output_device"))) : "";
|
||||||
float gain = demod->hasAnother("gain") ? (float) *demod->getNext("gain") : 1.0;
|
float gain = demod->hasAnother("gain") ? (float) *demod->getNext("gain") : 1.0;
|
||||||
|
|
||||||
std::string type = demod->hasAnother("type") ? string(*demod->getNext("type")) : "FM";
|
std::string type = "FM";
|
||||||
std::istringstream typeCheck(type);
|
|
||||||
|
DataNode *demodTypeNode = demod->hasAnother("type")?demod->getNext("type"):nullptr;
|
||||||
|
|
||||||
int legacyType = 0;
|
if (demodTypeNode->element()->getDataType() == DATA_INT) {
|
||||||
if (!(typeCheck >> legacyType).fail()) {
|
int legacyType = *demodTypeNode;
|
||||||
int legacyStereo = demod->hasAnother("stereo") ? (int) *demod->getNext("stereo") : 0;
|
int legacyStereo = demod->hasAnother("stereo") ? (int) *demod->getNext("stereo") : 0;
|
||||||
switch (legacyType) { // legacy demod ID
|
switch (legacyType) { // legacy demod ID
|
||||||
case 1: type = legacyStereo?"FMS":"FM"; break;
|
case 1: type = legacyStereo?"FMS":"FM"; break;
|
||||||
|
@ -1218,9 +1219,10 @@ bool AppFrame::loadSession(std::string fileName) {
|
||||||
case 16: type = "I/Q"; break;
|
case 16: type = "I/Q"; break;
|
||||||
default: type = "FM"; break;
|
default: type = "FM"; break;
|
||||||
}
|
}
|
||||||
|
} else if (demodTypeNode->element()->getDataType() == DATA_STRING) {
|
||||||
|
demodTypeNode->element()->get(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ModemSettings mSettings;
|
ModemSettings mSettings;
|
||||||
|
|
||||||
if (demod->hasAnother("settings")) {
|
if (demod->hasAnother("settings")) {
|
||||||
|
|
|
@ -159,6 +159,7 @@ void ModeSelectorCanvas::setSelection(std::string label) {
|
||||||
for (int i = 0; i < numChoices; i++) {
|
for (int i = 0; i < numChoices; i++) {
|
||||||
if (selections[i].label == label) {
|
if (selections[i].label == label) {
|
||||||
currentSelection = i;
|
currentSelection = i;
|
||||||
|
Refresh();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue