Clean-up unused stereo states.

This commit is contained in:
Charles J. Cliffe 2015-11-20 21:55:37 -05:00
parent 703e281d76
commit 63ea642c88
6 changed files with 6 additions and 52 deletions

View File

@ -642,7 +642,6 @@ void AppFrame::OnMenu(wxCommandEvent& event) {
wxGetApp().getDemodMgr().setLastDemodulatorType("FM");
demodModeSelector->setSelection(1);
wxGetApp().getDemodMgr().setLastMuted(false);
wxGetApp().getDemodMgr().setLastStereo(false);
wxGetApp().getDemodMgr().setLastBandwidth(DEFAULT_DEMOD_BW);
wxGetApp().getDemodMgr().setLastGain(1.0);
wxGetApp().getDemodMgr().setLastSquelchLevel(0);
@ -1129,7 +1128,6 @@ void AppFrame::saveSession(std::string fileName) {
*demod->newChild("type") = (*instance_i)->getDemodulatorType();
*demod->newChild("squelch_level") = (*instance_i)->getSquelchLevel();
*demod->newChild("squelch_enabled") = (*instance_i)->isSquelchEnabled() ? 1 : 0;
*demod->newChild("stereo") = (*instance_i)->isStereo() ? 1 : 0;
*demod->newChild("output_device") = outputDevices[(*instance_i)->getOutputDevice()].name;
*demod->newChild("gain") = (*instance_i)->getGain();
*demod->newChild("muted") = (*instance_i)->isMuted() ? 1 : 0;
@ -1179,7 +1177,6 @@ bool AppFrame::loadSession(std::string fileName) {
std::string type = demod->hasAnother("type") ? string(*demod->getNext("type")) : "FM";
float squelch_level = demod->hasAnother("squelch_level") ? (float) *demod->getNext("squelch_level") : 0;
int squelch_enabled = demod->hasAnother("squelch_enabled") ? (int) *demod->getNext("squelch_enabled") : 0;
int stereo = demod->hasAnother("stereo") ? (int) *demod->getNext("stereo") : 0;
int muted = demod->hasAnother("muted") ? (int) *demod->getNext("muted") : 0;
std::string output_device = demod->hasAnother("output_device") ? string(*(demod->getNext("output_device"))) : "";
float gain = demod->hasAnother("gain") ? (float) *demod->getNext("gain") : 1.0;
@ -1216,10 +1213,7 @@ bool AppFrame::loadSession(std::string fileName) {
newDemod->setSquelchEnabled(true);
newDemod->setSquelchLevel(squelch_level);
}
if (stereo) {
newDemod->setStereo(true);
}
bool found_device = false;
std::map<int, RtAudio::DeviceInfo>::iterator i;
for (i = outputDevices.begin(); i != outputDevices.end(); i++) {
@ -1241,7 +1235,6 @@ bool AppFrame::loadSession(std::string fileName) {
std::cout << "\t\tBandwidth: " << bandwidth << std::endl;
std::cout << "\t\tSquelch Level: " << squelch_level << std::endl;
std::cout << "\t\tSquelch Enabled: " << (squelch_enabled ? "true" : "false") << std::endl;
std::cout << "\t\tStereo: " << (stereo ? "true" : "false") << std::endl;
std::cout << "\t\tOutput Device: " << output_device << std::endl;
}

View File

@ -9,7 +9,6 @@ DemodulatorInstance::DemodulatorInstance() :
preDemodTerminated.store(true);
active.store(false);
squelch.store(false);
stereo.store(false);
muted.store(false);
tracking.store(false);
follow.store(false);
@ -195,15 +194,6 @@ void DemodulatorInstance::setActive(bool state) {
active = state;
}
bool DemodulatorInstance::isStereo() {
return stereo;
}
void DemodulatorInstance::setStereo(bool state) {
stereo = state;
// demodulatorThread->setStereo(state);
}
void DemodulatorInstance::squelchAuto() {
DemodulatorThreadControlCommand command;
command.cmd = DemodulatorThreadControlCommand::DEMOD_THREAD_CMD_CTL_SQUELCH_ON;

View File

@ -42,9 +42,6 @@ public:
bool isActive();
void setActive(bool state);
bool isStereo();
void setStereo(bool state);
void squelchAuto();
bool isSquelchEnabled();
void setSquelchEnabled(bool state);
@ -109,7 +106,6 @@ private:
std::atomic_bool preDemodTerminated;
std::atomic_bool active;
std::atomic_bool squelch;
std::atomic_bool stereo;
std::atomic_bool muted;
std::atomic_llong currentFrequency;

View File

@ -7,7 +7,7 @@
DemodulatorMgr::DemodulatorMgr() :
activeDemodulator(NULL), lastActiveDemodulator(NULL), activeVisualDemodulator(NULL), lastBandwidth(DEFAULT_DEMOD_BW), lastDemodType(
DEFAULT_DEMOD_TYPE), lastSquelchEnabled(false), lastSquelch(0), lastGain(1.0), lastStereo(false), lastMuted(false) {
DEFAULT_DEMOD_TYPE), lastSquelchEnabled(false), lastSquelch(0), lastGain(1.0), lastMuted(false) {
}
@ -166,7 +166,6 @@ void DemodulatorMgr::updateLastState() {
lastSquelchEnabled = lastActiveDemodulator->isSquelchEnabled();
lastSquelch = lastActiveDemodulator->getSquelchLevel();
lastGain = lastActiveDemodulator->getGain();
lastStereo = lastActiveDemodulator->isStereo();
}
}
@ -224,15 +223,6 @@ void DemodulatorMgr::setLastSquelchEnabled(bool lastSquelchEnabled) {
this->lastSquelchEnabled = lastSquelchEnabled;
}
bool DemodulatorMgr::isLastStereo() const {
return lastStereo;
}
void DemodulatorMgr::setLastStereo(bool lastStereo) {
this->lastStereo = lastStereo;
}
bool DemodulatorMgr::isLastMuted() const {
return lastMuted;
}

View File

@ -39,10 +39,7 @@ public:
bool isLastSquelchEnabled() const;
void setLastSquelchEnabled(bool lastSquelchEnabled);
bool isLastStereo() const;
void setLastStereo(bool lastStereo);
bool isLastMuted() const;
void setLastMuted(bool lastMuted);
@ -63,5 +60,5 @@ private:
bool lastSquelchEnabled;
float lastSquelch;
float lastGain;
bool lastStereo, lastMuted;
bool lastMuted;
};

View File

@ -416,16 +416,6 @@ void WaterfallCanvas::OnKeyDown(wxKeyEvent& event) {
}
activeDemod->setMuted(!activeDemod->isMuted());
break;
case 'S':
if (!activeDemod) {
break;
}
if (activeDemod->isStereo()) {
activeDemod->setStereo(false);
} else {
activeDemod->setStereo(true);
}
break;
case 'B':
if (spectrumCanvas) {
spectrumCanvas->setShowDb(!spectrumCanvas->getShowDb());
@ -578,14 +568,14 @@ void WaterfallCanvas::OnMouseMoved(wxMouseEvent& event) {
mouseTracker.setVertDragLock(true);
mouseTracker.setHorizDragLock(false);
setStatusText("Click and drag to change demodulator bandwidth. SPACE for direct frequency input. M for mute, D to delete, S for stereo.");
setStatusText("Click and drag to change demodulator bandwidth. SPACE for direct frequency input. M for mute, D to delete.");
} else {
SetCursor(wxCURSOR_SIZING);
nextDragState = WF_DRAG_FREQUENCY;
mouseTracker.setVertDragLock(true);
mouseTracker.setHorizDragLock(false);
setStatusText("Click and drag to change demodulator frequency; SPACE for direct input. M for mute, D to delete, S for stereo.");
setStatusText("Click and drag to change demodulator frequency; SPACE for direct input. M for mute, D to delete.");
}
} else {
SetCursor(wxCURSOR_CROSS);
@ -671,7 +661,6 @@ void WaterfallCanvas::OnMouseReleased(wxMouseEvent& event) {
demod->setBandwidth(mgr->getLastBandwidth());
demod->setSquelchLevel(mgr->getLastSquelchLevel());
demod->setSquelchEnabled(mgr->isLastSquelchEnabled());
demod->setStereo(mgr->isLastStereo());
demod->setGain(mgr->getLastGain());
demod->setMuted(mgr->isLastMuted());
@ -759,7 +748,6 @@ void WaterfallCanvas::OnMouseReleased(wxMouseEvent& event) {
demod->setBandwidth(bw);
demod->setSquelchLevel(mgr->getLastSquelchLevel());
demod->setSquelchEnabled(mgr->isLastSquelchEnabled());
demod->setStereo(mgr->isLastStereo());
demod->setGain(mgr->getLastGain());
demod->run();