Demodulator options persist and apply to newly created

This commit is contained in:
Charles J. Cliffe
2015-02-02 20:10:55 -05:00
parent b4e4f3017f
commit 524cfbe0df
9 changed files with 167 additions and 32 deletions
+12 -5
View File
@@ -48,7 +48,7 @@ void TuningCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
if (activeDemod != NULL) {
glContext->DrawDemodFreqBw(activeDemod->getFrequency(), activeDemod->getBandwidth(), wxGetApp().getFrequency());
} else {
glContext->DrawDemodFreqBw(0, 0, wxGetApp().getFrequency());
glContext->DrawDemodFreqBw(0, wxGetApp().getDemodMgr().getLastBandwidth(), wxGetApp().getFrequency());
}
if (mouseTracker.mouseDown()) {
@@ -76,10 +76,17 @@ void TuningCanvas::OnIdle(wxIdleEvent &event) {
wxGetApp().getFrequency()
+ (int) (dragAccum * fabs(dragAccum * 10.0) * fabs(dragAccum * 10.0) * (float) wxGetApp().getSampleRate()));
} else if (fabs(moveVal) >= 1.0) {
if (uxDown < -0.275 && activeDemod != NULL) {
activeDemod->setFrequency(activeDemod->getFrequency() + (int) (moveVal * fabs(moveVal) * fabs(moveVal) * fabs(moveVal)));
} else if (activeDemod != NULL) {
activeDemod->setBandwidth(activeDemod->getBandwidth() + (int) (moveVal * fabs(moveVal) * fabs(moveVal) * fabs(moveVal)));
if (uxDown < -0.275) {
if (activeDemod != NULL) {
activeDemod->setFrequency(activeDemod->getFrequency() + (int) (moveVal * fabs(moveVal) * fabs(moveVal) * fabs(moveVal)));
}
} else {
int amt = (int) (moveVal * fabs(moveVal) * fabs(moveVal) * fabs(moveVal));
if (activeDemod != NULL) {
activeDemod->setBandwidth(activeDemod->getBandwidth() + amt);
} else {
wxGetApp().getDemodMgr().setLastBandwidth(wxGetApp().getDemodMgr().getLastBandwidth() + amt);
}
}
}