Exemple #1
0
bool BassBoostDialog::TransferDataFromWindow()
{
   boost = TrapLong(mBoostS->GetValue(), BOOST_MIN, BOOST_MAX);
   freq = TrapLong(mFreqS->GetValue(), FREQ_MIN, FREQ_MAX);

   return true;
}
Exemple #2
0
bool ClickRemovalDialog::TransferDataFromWindow()
{
   mWidth = TrapLong(mWidthS->GetValue(), MIN_CLICK_WIDTH, MAX_CLICK_WIDTH);
   mThresh = TrapLong(mThreshS->GetValue(), MIN_THRESHOLD, MAX_THRESHOLD);

   return true;
}
Exemple #3
0
bool ToneGenDialog::TransferDataFromWindow()
{
   wxTextCtrl *t;

   t = GetAmpText();
   if (t) {
      double d;
      t->GetValue().ToDouble(&d);
      amplitude = TrapDouble(d, AMP_MIN, AMP_MAX);
   }

   t = GetFreqText();
   if (t) {
      double d;
      t->GetValue().ToDouble(&d);
      frequency = TrapDouble(d, FREQ_MIN, FREQ_MAX);
   }

   wxChoice *c = GetWaveformChoice();
   if (c)
      waveform = TrapLong(c->GetSelection(), WAVEFORM_MIN, WAVEFORM_MAX);

   wxCheckBox *cb = GetMixChoice();
   if (cb)
      mix = cb->GetValue();

   return TRUE;
}
Exemple #4
0
bool NoiseRemovalDialog::TransferDataToWindow()
{
   mSensitivityT->SetValue(wxString::Format(wxT("%.2f"), mSensitivity));
   mGainT->SetValue(wxString::Format(wxT("%d"), (int)mGain));
   mFreqT->SetValue(wxString::Format(wxT("%d"), (int)mFreq));
   mTimeT->SetValue(wxString::Format(wxT("%.2f"), mTime));
   mKeepNoise->SetValue(mbLeaveNoise);
   mKeepSignal->SetValue(!mbLeaveNoise);

   mSensitivityS->SetValue(TrapLong(mSensitivity*100.0 + (SENSITIVITY_MAX-SENSITIVITY_MIN+1)/2.0, SENSITIVITY_MIN, SENSITIVITY_MAX));
   mGainS->SetValue(TrapLong(mGain, GAIN_MIN, GAIN_MAX));
   mFreqS->SetValue(TrapLong(mFreq / 10, FREQ_MIN, FREQ_MAX));
   mTimeS->SetValue(TrapLong(mTime * TIME_MAX + 0.5, TIME_MIN, TIME_MAX));

   return true;
}
Exemple #5
0
void BassBoostDialog::OnFreqText(wxCommandEvent & event)
{
   long val;

   mFreqT->GetValue().ToLong(&val);
   mFreqS->SetValue(TrapLong(val, FREQ_MIN, FREQ_MAX));
}
Exemple #6
0
void ClickRemovalDialog::OnWidthText(wxCommandEvent & event)
{
   long val;

   mWidthT->GetValue().ToLong(&val);
   mWidthS->SetValue(TrapLong(val, MIN_CLICK_WIDTH, MAX_CLICK_WIDTH));
}
Exemple #7
0
void ClickRemovalDialog::OnThreshText(wxCommandEvent & event)
{
   long val;

   mThreshT->GetValue().ToLong(&val);
   mThreshS->SetValue(TrapLong(val, MIN_THRESHOLD, MAX_THRESHOLD));
}
Exemple #8
0
void BassBoostDialog::OnBoostText(wxCommandEvent & event)
{
   long val;

   mBoostT->GetValue().ToLong(&val);
   mBoostS->SetValue(TrapLong(val, BOOST_MIN, BOOST_MAX));
}
Exemple #9
0
void DtmfDialog::Recalculate(void) {

   // remember that dDutyCycle is in range (0-1000)
   double slot;

   dString = mDtmfStringT->GetValue();
   dDuration = mDtmfDurationT->GetTimeValue();

   dNTones = wxStrlen(dString);
   dDutyCycle = TrapLong(mDtmfDutyS->GetValue(), DUTY_MIN, DUTY_MAX);

   if (dNTones==0) {
      // no tones, all zero: don't do anything
      // this should take care of the case where user got an empty
      // dtmf sequence into the generator: track won't be generated
      dTone = 0;
      dDuration = 0;
      dSilence = dDuration;
   } else
     if (dNTones==1) {
        // single tone, as long as the sequence
          dSilence = 0;
          dTone = dDuration;

     } else {
        // Don't be fooled by the fact that you divide the sequence into dNTones:
        // the last slot will only contain a tone, not ending with silence.
        // Given this, the right thing to do is to divide the sequence duration
        // by dNTones tones and (dNTones-1) silences each sized according to the duty
        // cycle: original division was:
        // slot=dDuration / (dNTones*(dDutyCycle/DUTY_MAX)+(dNTones-1)*(1.0-dDutyCycle/DUTY_MAX))
        // which can be simplified in the one below.
        // Then just take the part that belongs to tone or silence.
        //
        slot=dDuration/((double)dNTones+(dDutyCycle/DUTY_MAX)-1);
        dTone = slot * (dDutyCycle/DUTY_MAX); // seconds
        dSilence = slot * (1.0 - (dDutyCycle/DUTY_MAX)); // seconds

        // Note that in the extremes we have:
        // - dutyCycle=100%, this means no silence, so each tone will measure dDuration/dNTones
        // - dutyCycle=0%, this means no tones, so each silence slot will measure dDuration/(NTones-1)
        // But we always count:
        // - dNTones tones
        // - dNTones-1 silences
     }

   mDtmfDutyT->SetLabel(wxString::Format(wxT("%.1f %%"), (float)dDutyCycle/DUTY_SCALE));
   mDtmfDutyT->SetName(mDtmfDutyT->GetLabel()); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
   mDtmfSilenceT->SetLabel(wxString::Format(wxString(wxT("%d ")) + _("ms"),  (int) (dTone * 1000)));
   mDtmfSilenceT->SetName(mDtmfSilenceT->GetLabel()); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
   mDtmfToneT->SetLabel(wxString::Format(wxString(wxT("%d ")) + _("ms"),  (int) (dSilence * 1000)));
   mDtmfToneT->SetName(mDtmfToneT->GetLabel()); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
}
Exemple #10
0
bool WahwahDialog::TransferDataFromWindow()
{
   wxTextCtrl *c;
   long x;

   c = GetFreqText();
   if (c) {
      double d;
      c->GetValue().ToDouble(&d);
      freq = TrapDouble(d * 10, FREQ_MIN, FREQ_MAX) / 10;
   }

   c = GetFreqOffText();
   if (c) {
      double d;
      c->GetValue().ToDouble(&d);
      freqoff = TrapDouble(d, FREQOFF_MIN, FREQOFF_MAX);
   }

   c = GetPhaseText();
   if (c) {
      c->GetValue().ToLong(&x);
      startphase = TrapLong(x, PHASE_MIN, PHASE_MAX);
   }

   c = GetDepthText();
   if (c) {
      c->GetValue().ToLong(&x);
      depth = TrapLong(x, DEPTH_MIN, DEPTH_MAX);
   }

   c = GetResonanceText();
   if (c) {
      double d;
      c->GetValue().ToDouble(&d);
      res = TrapDouble(d * 10, RES_MIN, RES_MAX) / 10;
   }

   return TRUE;
}
Exemple #11
0
bool BassBoostDialog::TransferDataFromWindow()
{
   wxTextCtrl *c = GetBoostText();
   if (c) {
      long b;

      wxString val = c->GetValue();
      val.ToLong(&b);
      boost = TrapLong(b, BOOST_MIN, BOOST_MAX);
   }

   c = GetFreqText();
   if (c) {
      long f;

      wxString val = c->GetValue();
      val.ToLong(&f);
      freq = TrapLong(f, FREQ_MIN, FREQ_MAX);
   }

   return TRUE;
}
Exemple #12
0
void BassBoostDialog::OnFreqText(wxCommandEvent & event)
{
   wxTextCtrl *c = GetFreqText();
   if (c) {
      long freq;

      c->GetValue().ToLong(&freq);
      freq = TrapLong(freq, FREQ_MIN, FREQ_MAX);

      wxSlider *slider = GetFreqSlider();
      if (slider)
         slider->SetValue(freq);
   }
}
Exemple #13
0
void PhaserDialog::OnDepthText(wxCommandEvent & WXUNUSED(event))
{
   wxTextCtrl *c = GetDepthText();
   if (c) {
      long depth;

      c->GetValue().ToLong(&depth);
      depth = TrapLong(depth, DEPTH_MIN, DEPTH_MAX);

      wxSlider *slider = GetDepthSlider();
      if (slider)
         slider->SetValue(depth);
   }
}
Exemple #14
0
void PhaserDialog::OnPhaseText(wxCommandEvent & WXUNUSED(event))
{
   wxTextCtrl *c = GetPhaseText();
   if (c) {
      long phase;

      c->GetValue().ToLong(&phase);
      phase = TrapLong(phase, PHASE_MIN, PHASE_MAX);

      wxSlider *slider = GetPhaseSlider();
      if (slider)
         slider->SetValue(phase);
   }
}
Exemple #15
0
void PhaserDialog::OnDryWetText(wxCommandEvent & WXUNUSED(event))
{
   wxTextCtrl *c = GetDryWetText();
   if (c) {
      long drywet;

      c->GetValue().ToLong(&drywet);
      drywet = TrapLong(drywet, DRYWET_MIN, DRYWET_MAX);

      wxSlider *slider = GetDryWetSlider();
      if (slider)
         slider->SetValue(drywet);
   }
}
Exemple #16
0
void PhaserDialog::OnFeedbackText(wxCommandEvent & WXUNUSED(event))
{
   wxTextCtrl *c = GetFeedbackText();
   if (c) {
      long fb;

      c->GetValue().ToLong(&fb);
      fb = TrapLong(fb, FB_MIN, FB_MAX);

      wxSlider *slider = GetFeedbackSlider();
      if (slider)
         slider->SetValue(fb);
   }
}
Exemple #17
0
void PhaserDialog::OnStagesText(wxCommandEvent & WXUNUSED(event))
{
   wxTextCtrl *c = GetStagesText();
   if (c) {
      long stage;

      c->GetValue().ToLong(&stage);
      stage = TrapLong(stage, STAGES_MIN, STAGES_MAX);

      wxSlider *slider = GetStagesSlider();
      if (slider)
         slider->SetValue(stage);
   }
}
Exemple #18
0
void WahwahDialog::OnFreqText(wxCommandEvent & event)
{
   wxTextCtrl *c = GetFreqText();
   if (c) {
      long freql;
      double freqd = Internat::ToDouble(c->GetValue());

      freq = freqd;
      freql = TrapLong(((long) (freq * 10)), FREQ_MIN, FREQ_MAX);

      wxSlider *slider = GetFreqSlider();
      if (slider)
         slider->SetValue(freql);
   }
}
Exemple #19
0
void WahwahDialog::OnFreqText(wxCommandEvent & WXUNUSED(event))
{
   wxTextCtrl *c = GetFreqText();
   if (c) {
      long freql;
      double freqd;
      c->GetValue().ToDouble(&freqd);

      freq = freqd;
      freql = TrapLong(((long)floor(freq * 10 + .5)), FREQ_MIN, FREQ_MAX);

      wxSlider *slider = GetFreqSlider();
      if (slider)
         slider->SetValue(freql);
   }
}
Exemple #20
0
void BassBoostDialog::OnBoostText(wxCommandEvent & event)
{
   wxTextCtrl *c = GetBoostText();
   if (c) {
      long boost;

      c->GetValue().ToLong(&boost);
      freq = TrapLong(boost, BOOST_MIN, BOOST_MAX);

      if (boost < BOOST_MIN)
         boost = BOOST_MIN;
      else if (boost > BOOST_MAX)
         boost = BOOST_MAX;

      wxSlider *slider = GetBoostSlider();
      if (slider)
         slider->SetValue(boost);
   }
}
Exemple #21
0
bool PhaserDialog::TransferDataFromWindow()
{
   wxTextCtrl *c;
   long x;

   c = GetFreqText();
   if (c) {
      double d;
      c->GetValue().ToDouble(&d);
      freq = TrapDouble(d * 10, FREQ_MIN, FREQ_MAX) / 10;
   }

   c = GetPhaseText();
   if (c) {
      c->GetValue().ToLong(&x);
      startphase = TrapLong(x, PHASE_MIN, PHASE_MAX);
   }

   c = GetDepthText();
   if (c) {
      c->GetValue().ToLong(&x);
      depth = TrapLong(x, DEPTH_MIN, DEPTH_MAX);
   }

   c = GetFeedbackText();
   if (c) {
      c->GetValue().ToLong(&x);
      fb = TrapLong(x, FB_MIN, FB_MAX);
   }

   c = GetStagesText();
   if (c) {
      c->GetValue().ToLong(&x);
      stages = TrapLong(x, STAGES_MIN, STAGES_MAX);
      if ((stages % 2) == 1)    // must be even
         stages = TrapLong(stages - 1, STAGES_MIN, STAGES_MAX);
   }

   c = GetDryWetText();
   if (c) {
      c->GetValue().ToLong(&x);
      drywet = TrapLong(x, DRYWET_MIN, DRYWET_MAX);
   }

   return TRUE;
}
void NoiseRemovalDialog::OnGainText(wxCommandEvent & event)
{
   long val;
   mGainT->GetValue().ToLong(&val);
   mGainS->SetValue(TrapLong(val, GAIN_MIN, GAIN_MAX));
}
void NoiseRemovalDialog::OnFreqText(wxCommandEvent & event)
{
   long val;
   mFreqT->GetValue().ToLong(&val);
   mFreqS->SetValue(TrapLong(val/10, FREQ_MIN, FREQ_MAX));
}
Exemple #24
0
void NoiseRemovalDialog::OnSensitivityText(wxCommandEvent & WXUNUSED(event))
{
   mSensitivityT->GetValue().ToDouble(&mSensitivity);
   mSensitivityS->SetValue(TrapLong(mSensitivity*100.0 + (SENSITIVITY_MAX-SENSITIVITY_MIN+1)/2.0, SENSITIVITY_MIN, SENSITIVITY_MAX));
}
void NoiseRemovalDialog::OnTimeText(wxCommandEvent & event)
{
   long val;
   mTimeT->GetValue().ToLong(&val);
   mTimeS->SetValue(TrapLong(val*100, TIME_MIN, TIME_MAX));
}
Exemple #26
0
void NoiseRemovalDialog::OnFreqText(wxCommandEvent & WXUNUSED(event))
{
   mFreqT->GetValue().ToDouble(&mFreq);
   mFreqS->SetValue(TrapLong(mFreq / 10, FREQ_MIN, FREQ_MAX));
}
Exemple #27
0
void NoiseRemovalDialog::OnGainText(wxCommandEvent & WXUNUSED(event))
{
   mGainT->GetValue().ToDouble(&mGain);
   mGainS->SetValue(TrapLong(mGain, GAIN_MIN, GAIN_MAX));
}
Exemple #28
0
void NoiseRemovalDialog::OnTimeText(wxCommandEvent & WXUNUSED(event))
{
   mTimeT->GetValue().ToDouble(&mTime);
   mTimeS->SetValue(TrapLong(mTime * TIME_MAX + 0.5, TIME_MIN, TIME_MAX));
}