mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-03 00:59:43 +02:00
Merge branch 'master'
* master: fewer #includes in TrackPanel.cpp Fix spacing on comment Add output gain control to Phaser effect Add output gain control to Wahwah effect Bug1115: click below vertical ruler deselects track now, just as... Rename some variables Save overwrite choice in Export Multiple
This commit is contained in:
commit
eeaaadb530
File diff suppressed because it is too large
Load Diff
@ -80,28 +80,28 @@ private:
|
||||
int GetTrackInfoWidth() const;
|
||||
void SetTrackInfoFont(wxDC *dc) const;
|
||||
|
||||
void DrawBackground(wxDC * dc, const wxRect & r, bool bSelected, bool bHasMuteSolo, const int labelw, const int vrul) const;
|
||||
void DrawBordersWithin(wxDC * dc, const wxRect & r, bool bHasMuteSolo ) const;
|
||||
void DrawCloseBox(wxDC * dc, const wxRect & r, bool down) const;
|
||||
void DrawTitleBar(wxDC * dc, const wxRect & r, Track * t, bool down) const;
|
||||
void DrawMuteSolo(wxDC * dc, const wxRect & r, Track * t, bool down, bool solo, bool bHasSoloButton) const;
|
||||
void DrawVRuler(wxDC * dc, const wxRect & r, Track * t) const;
|
||||
void DrawBackground(wxDC * dc, const wxRect & rect, bool bSelected, bool bHasMuteSolo, const int labelw, const int vrul) const;
|
||||
void DrawBordersWithin(wxDC * dc, const wxRect & rect, bool bHasMuteSolo ) const;
|
||||
void DrawCloseBox(wxDC * dc, const wxRect & rect, bool down) const;
|
||||
void DrawTitleBar(wxDC * dc, const wxRect & rect, Track * t, bool down) const;
|
||||
void DrawMuteSolo(wxDC * dc, const wxRect & rect, Track * t, bool down, bool solo, bool bHasSoloButton) const;
|
||||
void DrawVRuler(wxDC * dc, const wxRect & rect, Track * t) const;
|
||||
#ifdef EXPERIMENTAL_MIDI_OUT
|
||||
void DrawVelocitySlider(wxDC * dc, NoteTrack *t, wxRect r) const ;
|
||||
void DrawVelocitySlider(wxDC * dc, NoteTrack *t, wxRect rect) const ;
|
||||
#endif
|
||||
void DrawSliders(wxDC * dc, WaveTrack *t, wxRect r) const;
|
||||
void DrawSliders(wxDC * dc, WaveTrack *t, wxRect rect) const;
|
||||
|
||||
// Draw the minimize button *and* the sync-lock track icon, if necessary.
|
||||
void DrawMinimize(wxDC * dc, const wxRect & r, Track * t, bool down) const;
|
||||
void DrawMinimize(wxDC * dc, const wxRect & rect, Track * t, bool down) const;
|
||||
|
||||
void GetTrackControlsRect(const wxRect & r, wxRect &dest) const;
|
||||
void GetCloseBoxRect(const wxRect & r, wxRect &dest) const;
|
||||
void GetTitleBarRect(const wxRect & r, wxRect &dest) const;
|
||||
void GetMuteSoloRect(const wxRect & r, wxRect &dest, bool solo, bool bHasSoloButton) const;
|
||||
void GetGainRect(const wxRect & r, wxRect &dest) const;
|
||||
void GetPanRect(const wxRect & r, wxRect &dest) const;
|
||||
void GetMinimizeRect(const wxRect & r, wxRect &dest) const;
|
||||
void GetSyncLockIconRect(const wxRect & r, wxRect &dest) const;
|
||||
void GetTrackControlsRect(const wxRect & rect, wxRect &dest) const;
|
||||
void GetCloseBoxRect(const wxRect & rect, wxRect &dest) const;
|
||||
void GetTitleBarRect(const wxRect & rect, wxRect &dest) const;
|
||||
void GetMuteSoloRect(const wxRect & rect, wxRect &dest, bool solo, bool bHasSoloButton) const;
|
||||
void GetGainRect(const wxRect & rect, wxRect &dest) const;
|
||||
void GetPanRect(const wxRect & rect, wxRect &dest) const;
|
||||
void GetMinimizeRect(const wxRect & rect, wxRect &dest) const;
|
||||
void GetSyncLockIconRect(const wxRect & rect, wxRect &dest) const;
|
||||
|
||||
LWSlider * GainSlider(WaveTrack *t) const;
|
||||
LWSlider * PanSlider(WaveTrack *t) const;
|
||||
@ -243,7 +243,7 @@ class AUDACITY_DLL_API TrackPanel:public wxPanel {
|
||||
static void BuildVRulerMenuItems(wxMenu * menu, int firstId, const wxArrayString &names);
|
||||
virtual bool IsAudioActive();
|
||||
virtual bool IsUnsafe();
|
||||
virtual bool HandleLabelTrackMouseEvent(LabelTrack * lTrack, wxRect &r, wxMouseEvent & event);
|
||||
virtual bool HandleLabelTrackMouseEvent(LabelTrack * lTrack, wxRect &rect, wxMouseEvent & event);
|
||||
virtual bool HandleTrackLocationMouseEvent(WaveTrack * track, wxRect &rect, wxMouseEvent &event);
|
||||
virtual bool IsOverCutline(WaveTrack * track, wxRect &rect, wxMouseEvent &event);
|
||||
virtual void HandleTrackSpecificMouseEvent(wxMouseEvent & event);
|
||||
@ -259,9 +259,9 @@ class AUDACITY_DLL_API TrackPanel:public wxPanel {
|
||||
|
||||
// Working out where to dispatch the event to.
|
||||
virtual int DetermineToolToUse( ToolsToolBar * pTtb, wxMouseEvent & event);
|
||||
virtual bool HitTestEnvelope(Track *track, wxRect &r, wxMouseEvent & event);
|
||||
virtual bool HitTestSamples(Track *track, wxRect &r, wxMouseEvent & event);
|
||||
virtual bool HitTestSlide(Track *track, wxRect &r, wxMouseEvent & event);
|
||||
virtual bool HitTestEnvelope(Track *track, wxRect &rect, wxMouseEvent & event);
|
||||
virtual bool HitTestSamples(Track *track, wxRect &rect, wxMouseEvent & event);
|
||||
virtual bool HitTestSlide(Track *track, wxRect &rect, wxMouseEvent & event);
|
||||
#ifdef USE_MIDI
|
||||
// data for NoteTrack interactive stretch operations:
|
||||
// Stretching applies to a selected region after quantizing the
|
||||
@ -286,7 +286,7 @@ class AUDACITY_DLL_API TrackPanel:public wxPanel {
|
||||
double mStretchSel1; // initial sel1 (left) quantized to nearest beat
|
||||
double mStretchLeftBeats; // how many beats from left to cursor
|
||||
double mStretchRightBeats; // how many beats from cursor to right
|
||||
virtual bool HitTestStretch(Track *track, wxRect &r, wxMouseEvent & event);
|
||||
virtual bool HitTestStretch(Track *track, wxRect &rect, wxMouseEvent & event);
|
||||
virtual void Stretch(int mouseXCoordinate, int trackLeftEdge, Track *pTrack);
|
||||
#endif
|
||||
|
||||
@ -321,7 +321,7 @@ protected:
|
||||
#endif
|
||||
|
||||
virtual void SelectionHandleClick(wxMouseEvent &event,
|
||||
Track* pTrack, wxRect r);
|
||||
Track* pTrack, wxRect rect);
|
||||
virtual void StartSelection (int mouseXCoordinate, int trackLeftEdge);
|
||||
virtual void ExtendSelection(int mouseXCoordinate, int trackLeftEdge,
|
||||
Track *pTrack);
|
||||
@ -363,7 +363,7 @@ protected:
|
||||
virtual void SetCursorAndTipWhenInVResizeArea( bool blinked, wxString &tip );
|
||||
virtual void SetCursorAndTipWhenInLabelTrack( LabelTrack * pLT, wxMouseEvent & event, wxString &tip );
|
||||
virtual void SetCursorAndTipWhenSelectTool
|
||||
( Track * t, wxMouseEvent & event, wxRect &r, bool bMultiToolMode, wxString &tip, const wxCursor ** ppCursor );
|
||||
( Track * t, wxMouseEvent & event, wxRect &rect, bool bMultiToolMode, wxString &tip, const wxCursor ** ppCursor );
|
||||
virtual void SetCursorAndTipByTool( int tool, wxMouseEvent & event, wxString &tip );
|
||||
virtual void HandleCursor(wxMouseEvent & event);
|
||||
virtual void MaySetOnDemandTip( Track * t, wxString &tip );
|
||||
@ -427,19 +427,19 @@ protected:
|
||||
// These *Func methods are used in TrackPanel::HandleLabelClick to set up
|
||||
// for actual handling in methods called by TrackPanel::OnMouseEvent, and
|
||||
// to draw button-down states, etc.
|
||||
virtual bool CloseFunc(Track * t, wxRect r, int x, int y);
|
||||
virtual bool PopupFunc(Track * t, wxRect r, int x, int y);
|
||||
virtual bool CloseFunc(Track * t, wxRect rect, int x, int y);
|
||||
virtual bool PopupFunc(Track * t, wxRect rect, int x, int y);
|
||||
|
||||
// TrackSelFunc, unlike the other *Func methods, returns true if the click is not
|
||||
// set up to be handled, but click is on the sync-lock icon or the blank area to
|
||||
// the left of the minimize button, and we want to pass it forward to be a track select.
|
||||
virtual bool TrackSelFunc(Track * t, wxRect r, int x, int y);
|
||||
virtual bool TrackSelFunc(Track * t, wxRect rect, int x, int y);
|
||||
|
||||
virtual bool MuteSoloFunc(Track *t, wxRect r, int x, int f, bool solo);
|
||||
virtual bool MinimizeFunc(Track *t, wxRect r, int x, int f);
|
||||
virtual bool GainFunc(Track * t, wxRect r, wxMouseEvent &event,
|
||||
virtual bool MuteSoloFunc(Track *t, wxRect rect, int x, int f, bool solo);
|
||||
virtual bool MinimizeFunc(Track *t, wxRect rect, int x, int f);
|
||||
virtual bool GainFunc(Track * t, wxRect rect, wxMouseEvent &event,
|
||||
int x, int y);
|
||||
virtual bool PanFunc(Track * t, wxRect r, wxMouseEvent &event,
|
||||
virtual bool PanFunc(Track * t, wxRect rect, wxMouseEvent &event,
|
||||
int x, int y);
|
||||
|
||||
|
||||
@ -532,10 +532,10 @@ protected:
|
||||
#endif
|
||||
virtual void DrawZooming(wxDC* dc, const wxRect & clip);
|
||||
|
||||
virtual void HighlightFocusedTrack (wxDC* dc, const wxRect &r);
|
||||
virtual void DrawShadow (Track *t, wxDC* dc, const wxRect & r);
|
||||
virtual void DrawBordersAroundTrack(Track *t, wxDC* dc, const wxRect & r, const int labelw, const int vrul);
|
||||
virtual void DrawOutsideOfTrack (Track *t, wxDC* dc, const wxRect & r);
|
||||
virtual void HighlightFocusedTrack (wxDC* dc, const wxRect &rect);
|
||||
virtual void DrawShadow (Track *t, wxDC* dc, const wxRect & rect);
|
||||
virtual void DrawBordersAroundTrack(Track *t, wxDC* dc, const wxRect & rect, const int labelw, const int vrul);
|
||||
virtual void DrawOutsideOfTrack (Track *t, wxDC* dc, const wxRect & rect);
|
||||
|
||||
virtual int IdOfRate( int rate );
|
||||
virtual int IdOfFormat( int format );
|
||||
|
@ -37,7 +37,8 @@ enum
|
||||
ID_Freq,
|
||||
ID_Phase,
|
||||
ID_Depth,
|
||||
ID_Feedback
|
||||
ID_Feedback,
|
||||
ID_OutGain
|
||||
};
|
||||
|
||||
// Define keys, defaults, minimums, and maximums for the effect parameters
|
||||
@ -49,6 +50,7 @@ Param( Freq, double, XO("Freq"), 0.4, 0.001,4.0, 10.0 );
|
||||
Param( Phase, double, XO("Phase"), 0.0, 0.0, 360.0, 1 );
|
||||
Param( Depth, int, XO("Depth"), 100, 0, 255, 1 );
|
||||
Param( Feedback, int, XO("Feedback"), 0, -100, 100, 1 );
|
||||
Param( OutGain, double, XO("Gain"), -6.0, -30.0, 30.0, 1 );
|
||||
|
||||
//
|
||||
#define phaserlfoshape 4.0
|
||||
@ -70,12 +72,14 @@ BEGIN_EVENT_TABLE(EffectPhaser, wxEvtHandler)
|
||||
EVT_SLIDER(ID_Phase, EffectPhaser::OnPhaseSlider)
|
||||
EVT_SLIDER(ID_Depth, EffectPhaser::OnDepthSlider)
|
||||
EVT_SLIDER(ID_Feedback, EffectPhaser::OnFeedbackSlider)
|
||||
EVT_SLIDER(ID_OutGain, EffectPhaser::OnGainSlider)
|
||||
EVT_TEXT(ID_Stages, EffectPhaser::OnStagesText)
|
||||
EVT_TEXT(ID_DryWet, EffectPhaser::OnDryWetText)
|
||||
EVT_TEXT(ID_Freq, EffectPhaser::OnFreqText)
|
||||
EVT_TEXT(ID_Phase, EffectPhaser::OnPhaseText)
|
||||
EVT_TEXT(ID_Depth, EffectPhaser::OnDepthText)
|
||||
EVT_TEXT(ID_Feedback, EffectPhaser::OnFeedbackText)
|
||||
EVT_TEXT(ID_OutGain, EffectPhaser::OnGainText)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
EffectPhaser::EffectPhaser()
|
||||
@ -86,6 +90,7 @@ EffectPhaser::EffectPhaser()
|
||||
mPhase = DEF_Phase;
|
||||
mDepth = DEF_Depth;
|
||||
mFeedback = DEF_Feedback;
|
||||
mOutGain = DEF_OutGain;
|
||||
|
||||
SetLinearEffectFlag(true);
|
||||
}
|
||||
@ -194,6 +199,7 @@ bool EffectPhaser::GetAutomationParameters(EffectAutomationParameters & parms)
|
||||
parms.Write(KEY_Phase, mPhase);
|
||||
parms.Write(KEY_Depth, mDepth);
|
||||
parms.Write(KEY_Feedback, mFeedback);
|
||||
parms.Write(KEY_OutGain, mOutGain);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -206,6 +212,7 @@ bool EffectPhaser::SetAutomationParameters(EffectAutomationParameters & parms)
|
||||
ReadAndVerifyDouble(Phase);
|
||||
ReadAndVerifyInt(Depth);
|
||||
ReadAndVerifyInt(Feedback);
|
||||
ReadAndVerifyDouble(OutGain);
|
||||
|
||||
if (Stages & 1) // must be even, but don't complain about it
|
||||
{
|
||||
@ -218,6 +225,7 @@ bool EffectPhaser::SetAutomationParameters(EffectAutomationParameters & parms)
|
||||
mDryWet = DryWet;
|
||||
mDepth = Depth;
|
||||
mPhase = Phase;
|
||||
mOutGain = OutGain;
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -295,6 +303,16 @@ void EffectPhaser::PopulateOrExchange(ShuttleGui & S)
|
||||
mFeedbackS->SetName(_("Feedback in percent"));
|
||||
mFeedbackS->SetLineSize(10);
|
||||
mFeedbackS->SetMinSize(wxSize(100, -1));
|
||||
|
||||
FloatingPointValidator<double> vldoutgain(1, &mOutGain);
|
||||
vldoutgain.SetRange(MIN_OutGain, MAX_OutGain);
|
||||
mOutGainT = S.Id(ID_OutGain).AddTextBox(_("Output gain (dB):"), wxT(""), 12);
|
||||
mOutGainT->SetValidator(vldoutgain);
|
||||
|
||||
S.SetStyle(wxSL_HORIZONTAL);
|
||||
mOutGainS = S.Id(ID_OutGain).AddSlider(wxT(""), DEF_OutGain * SCL_OutGain, MAX_OutGain * SCL_OutGain, MIN_OutGain * SCL_OutGain);
|
||||
mOutGainS->SetName(_("Output gain (dB)"));
|
||||
mOutGainS->SetMinSize(wxSize(100, -1));
|
||||
}
|
||||
S.EndMultiColumn();
|
||||
}
|
||||
@ -312,6 +330,7 @@ bool EffectPhaser::TransferDataToWindow()
|
||||
mPhaseS->SetValue((int) (mPhase * SCL_Phase));
|
||||
mDepthS->SetValue((int) (mDepth * SCL_Depth));
|
||||
mFeedbackS->SetValue((int) (mFeedback * SCL_Feedback));
|
||||
mOutGainS->SetValue((int) (mOutGain * SCL_OutGain));
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -347,6 +366,7 @@ void EffectPhaser::InstanceInit(EffectPhaserState & data, float sampleRate)
|
||||
data.gain = 0;
|
||||
data.fbout = 0;
|
||||
data.laststages = 0;
|
||||
data.outgain = 0;
|
||||
|
||||
return;
|
||||
}
|
||||
@ -364,6 +384,7 @@ sampleCount EffectPhaser::InstanceProcess(EffectPhaserState & data, float **inBl
|
||||
|
||||
data.lfoskip = mFreq * 2 * M_PI / data.samplerate;
|
||||
data.phase = mPhase * M_PI / 180;
|
||||
data.outgain = DB_TO_LINEAR(mOutGain);
|
||||
|
||||
for (sampleCount i = 0; i < blockLen; i++)
|
||||
{
|
||||
@ -392,7 +413,7 @@ sampleCount EffectPhaser::InstanceProcess(EffectPhaserState & data, float **inBl
|
||||
}
|
||||
data.fbout = m;
|
||||
|
||||
obuf[i] = (float) ((m * mDryWet + in * (255 - mDryWet)) / 255);
|
||||
obuf[i] = (float) (data.outgain * (m * mDryWet + in * (255 - mDryWet)) / 255);
|
||||
}
|
||||
|
||||
return blockLen;
|
||||
@ -448,6 +469,13 @@ void EffectPhaser::OnFeedbackSlider(wxCommandEvent & evt)
|
||||
EnableApply(mUIParent->Validate());
|
||||
}
|
||||
|
||||
void EffectPhaser::OnGainSlider(wxCommandEvent & evt)
|
||||
{
|
||||
mOutGain = evt.GetInt() / SCL_OutGain;
|
||||
mOutGainT->GetValidator()->TransferToWindow();
|
||||
EnableApply(mUIParent->Validate());
|
||||
}
|
||||
|
||||
void EffectPhaser::OnStagesText(wxCommandEvent & WXUNUSED(evt))
|
||||
{
|
||||
if (!EnableApply(mUIParent->TransferDataFromWindow()))
|
||||
@ -507,3 +535,13 @@ void EffectPhaser::OnFeedbackText(wxCommandEvent & WXUNUSED(evt))
|
||||
|
||||
mFeedbackS->SetValue((int) (mFeedback * SCL_Feedback));
|
||||
}
|
||||
|
||||
void EffectPhaser::OnGainText(wxCommandEvent & WXUNUSED(evt))
|
||||
{
|
||||
if (!EnableApply(mUIParent->TransferDataFromWindow()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
mOutGainS->SetValue((int) (mOutGain * SCL_OutGain));
|
||||
}
|
@ -38,6 +38,7 @@ public:
|
||||
double old[NUM_STAGES]; // must be as large as MAX_STAGES
|
||||
double gain;
|
||||
double fbout;
|
||||
double outgain;
|
||||
double lfoskip;
|
||||
double phase;
|
||||
int laststages;
|
||||
@ -83,7 +84,7 @@ public:
|
||||
bool TransferDataToWindow();
|
||||
bool TransferDataFromWindow();
|
||||
|
||||
protected:
|
||||
private:
|
||||
// EffectPhaser implementation
|
||||
|
||||
void InstanceInit(EffectPhaserState & data, float sampleRate);
|
||||
@ -95,12 +96,15 @@ protected:
|
||||
void OnDepthSlider(wxCommandEvent & evt);
|
||||
void OnPhaseSlider(wxCommandEvent & evt);
|
||||
void OnFreqSlider(wxCommandEvent & evt);
|
||||
void OnGainSlider(wxCommandEvent & evt);
|
||||
|
||||
void OnStagesText(wxCommandEvent & evt);
|
||||
void OnDryWetText(wxCommandEvent & evt);
|
||||
void OnFeedbackText(wxCommandEvent & evt);
|
||||
void OnDepthText(wxCommandEvent & evt);
|
||||
void OnPhaseText(wxCommandEvent & evt);
|
||||
void OnFreqText(wxCommandEvent & evt);
|
||||
void OnGainText(wxCommandEvent & evt);
|
||||
/*
|
||||
Phaser Parameters
|
||||
|
||||
@ -124,6 +128,7 @@ private:
|
||||
double mPhase;
|
||||
int mDepth;
|
||||
int mFeedback;
|
||||
double mOutGain;
|
||||
|
||||
wxTextCtrl *mStagesT;
|
||||
wxTextCtrl *mDryWetT;
|
||||
@ -131,6 +136,7 @@ private:
|
||||
wxTextCtrl *mPhaseT;
|
||||
wxTextCtrl *mDepthT;
|
||||
wxTextCtrl *mFeedbackT;
|
||||
wxTextCtrl *mOutGainT;
|
||||
|
||||
wxSlider *mStagesS;
|
||||
wxSlider *mDryWetS;
|
||||
@ -138,6 +144,7 @@ private:
|
||||
wxSlider *mPhaseS;
|
||||
wxSlider *mDepthS;
|
||||
wxSlider *mFeedbackS;
|
||||
wxSlider *mOutGainS;
|
||||
|
||||
DECLARE_EVENT_TABLE();
|
||||
};
|
||||
|
@ -62,7 +62,7 @@ static const struct
|
||||
}
|
||||
FactoryPresets[] =
|
||||
{
|
||||
// Room Pre Hf Tone Tone Wet Dry Stereo Wet
|
||||
// Room Pre Hf Tone Tone Wet Dry Stereo Wet
|
||||
// Name Size, Delay, Reverb, Damping, Low, High, Gain, Gain, Width, Only
|
||||
XO("Vocal I" ), { 70, 20, 40, 99, 100, 50, -12, 0, 70, false },
|
||||
XO("Vocal II"), { 50, 0, 50, 99, 50, 100, -1, -1, 70, false },
|
||||
|
@ -34,17 +34,19 @@ enum
|
||||
ID_Phase,
|
||||
ID_Depth,
|
||||
ID_Res,
|
||||
ID_FreqOfs
|
||||
ID_FreqOfs,
|
||||
ID_OutGain
|
||||
};
|
||||
|
||||
// Define keys, defaults, minimums, and maximums for the effect parameters
|
||||
//
|
||||
// Name Type Key Def Min Max Scale
|
||||
Param( Freq, double, XO("Freq"), 1.5, 0.1, 4.0, 10 );
|
||||
Param( Phase, double, XO("Phase"), 0.0, 0.0, 359.0, 1 );
|
||||
Param( Phase, double, XO("Phase"), 0.0, 0.0, 360.0, 1 );
|
||||
Param( Depth, int, XO("Depth"), 70, 0, 100, 1 ); // scaled to 0-1 before processing
|
||||
Param( Res, double, XO("Resonance"), 2.5, 0.1, 10.0, 10 );
|
||||
Param( FreqOfs, int, XO("Offset"), 30, 0, 100, 1 ); // scaled to 0-1 before processing
|
||||
Param( OutGain, double, XO("Gain"), -6.0, -30.0, 30.0, 1 );
|
||||
|
||||
// How many samples are processed before recomputing the lfo value again
|
||||
#define lfoskipsamples 30
|
||||
@ -62,11 +64,13 @@ BEGIN_EVENT_TABLE(EffectWahwah, wxEvtHandler)
|
||||
EVT_SLIDER(ID_Depth, EffectWahwah::OnDepthSlider)
|
||||
EVT_SLIDER(ID_Res, EffectWahwah::OnResonanceSlider)
|
||||
EVT_SLIDER(ID_FreqOfs, EffectWahwah::OnFreqOffSlider)
|
||||
EVT_SLIDER(ID_OutGain, EffectWahwah::OnGainSlider)
|
||||
EVT_TEXT(ID_Freq, EffectWahwah::OnFreqText)
|
||||
EVT_TEXT(ID_Phase, EffectWahwah::OnPhaseText)
|
||||
EVT_TEXT(ID_Depth, EffectWahwah::OnDepthText)
|
||||
EVT_TEXT(ID_Res, EffectWahwah::OnResonanceText)
|
||||
EVT_TEXT(ID_FreqOfs, EffectWahwah::OnFreqOffText)
|
||||
EVT_TEXT(ID_OutGain, EffectWahwah::OnGainText)
|
||||
END_EVENT_TABLE();
|
||||
|
||||
EffectWahwah::EffectWahwah()
|
||||
@ -76,6 +80,7 @@ EffectWahwah::EffectWahwah()
|
||||
mDepth = DEF_Depth;
|
||||
mRes = DEF_Res;
|
||||
mFreqOfs = DEF_FreqOfs;
|
||||
mOutGain = DEF_OutGain;
|
||||
|
||||
SetLinearEffectFlag(true);
|
||||
}
|
||||
@ -184,6 +189,7 @@ bool EffectWahwah::GetAutomationParameters(EffectAutomationParameters & parms)
|
||||
parms.Write(KEY_Depth, mDepth);
|
||||
parms.Write(KEY_Res, mRes);
|
||||
parms.Write(KEY_FreqOfs, mFreqOfs);
|
||||
parms.Write(KEY_OutGain, mOutGain);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -195,12 +201,14 @@ bool EffectWahwah::SetAutomationParameters(EffectAutomationParameters & parms)
|
||||
ReadAndVerifyInt(Depth);
|
||||
ReadAndVerifyDouble(Res);
|
||||
ReadAndVerifyInt(FreqOfs);
|
||||
ReadAndVerifyDouble(OutGain);
|
||||
|
||||
mFreq = Freq;
|
||||
mPhase = Phase;
|
||||
mDepth = Depth;
|
||||
mRes = Res;
|
||||
mFreqOfs = FreqOfs;
|
||||
mOutGain = OutGain;
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -266,6 +274,16 @@ void EffectWahwah::PopulateOrExchange(ShuttleGui & S)
|
||||
mFreqOfsS = S.Id(ID_FreqOfs).AddSlider(wxT(""), DEF_FreqOfs * SCL_FreqOfs, MAX_FreqOfs * SCL_FreqOfs, MIN_FreqOfs * SCL_FreqOfs);
|
||||
mFreqOfsT->SetName(_("Wah frequency offset in percent"));
|
||||
mFreqOfsT->SetMinSize(wxSize(100, -1));
|
||||
|
||||
FloatingPointValidator<double> vldoutgain(1, &mOutGain);
|
||||
vldoutgain.SetRange(MIN_OutGain, MAX_OutGain);
|
||||
mOutGainT = S.Id(ID_OutGain).AddTextBox(_("Output gain (dB):"), wxT(""), 12);
|
||||
mOutGainT->SetValidator(vldoutgain);
|
||||
|
||||
S.SetStyle(wxSL_HORIZONTAL);
|
||||
mOutGainS = S.Id(ID_OutGain).AddSlider(wxT(""), DEF_OutGain * SCL_OutGain, MAX_OutGain * SCL_OutGain, MIN_OutGain * SCL_OutGain);
|
||||
mOutGainS->SetName(_("Output gain (dB)"));
|
||||
mOutGainS->SetMinSize(wxSize(100, -1));
|
||||
}
|
||||
S.EndMultiColumn();
|
||||
}
|
||||
@ -282,6 +300,7 @@ bool EffectWahwah::TransferDataToWindow()
|
||||
mDepthS->SetValue((int) (mDepth * SCL_Depth));
|
||||
mResS->SetValue((int) (mRes * SCL_Res));
|
||||
mFreqOfsS->SetValue((int) (mFreqOfs * SCL_FreqOfs));
|
||||
mOutGainS->SetValue((int) (mOutGain * SCL_OutGain));
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -316,8 +335,8 @@ void EffectWahwah::InstanceInit(EffectWahwahState & data, float sampleRate)
|
||||
|
||||
data.depth = mDepth / 100.0;
|
||||
data.freqofs = mFreqOfs / 100.0;
|
||||
|
||||
data.phase = mPhase * M_PI / 180.0;
|
||||
data.outgain = DB_TO_LINEAR(mOutGain);
|
||||
}
|
||||
|
||||
sampleCount EffectWahwah::InstanceProcess(EffectWahwahState & data, float **inBlock, float **outBlock, sampleCount blockLen)
|
||||
@ -332,6 +351,7 @@ sampleCount EffectWahwah::InstanceProcess(EffectWahwahState & data, float **inBl
|
||||
data.freqofs = mFreqOfs / 100.0;
|
||||
|
||||
data.phase = mPhase * M_PI / 180.0;
|
||||
data.outgain = DB_TO_LINEAR(mOutGain);
|
||||
|
||||
for (int i = 0; i < blockLen; i++)
|
||||
{
|
||||
@ -358,6 +378,7 @@ sampleCount EffectWahwah::InstanceProcess(EffectWahwahState & data, float **inBl
|
||||
data.xn1 = in;
|
||||
data.yn2 = data.yn1;
|
||||
data.yn1 = out;
|
||||
out *= data.outgain;
|
||||
|
||||
obuf[i] = (float) out;
|
||||
}
|
||||
@ -403,6 +424,13 @@ void EffectWahwah::OnFreqOffSlider(wxCommandEvent & evt)
|
||||
EnableApply(mUIParent->Validate());
|
||||
}
|
||||
|
||||
void EffectWahwah::OnGainSlider(wxCommandEvent & evt)
|
||||
{
|
||||
mOutGain = evt.GetInt() / SCL_OutGain;
|
||||
mOutGainT->GetValidator()->TransferToWindow();
|
||||
EnableApply(mUIParent->Validate());
|
||||
}
|
||||
|
||||
void EffectWahwah::OnFreqText(wxCommandEvent & WXUNUSED(evt))
|
||||
{
|
||||
if (!EnableApply(mUIParent->TransferDataFromWindow()))
|
||||
@ -452,3 +480,13 @@ void EffectWahwah::OnFreqOffText(wxCommandEvent & WXUNUSED(evt))
|
||||
|
||||
mFreqOfsS->SetValue((int) (mFreqOfs * SCL_FreqOfs));
|
||||
}
|
||||
|
||||
void EffectWahwah::OnGainText(wxCommandEvent & WXUNUSED(evt))
|
||||
{
|
||||
if (!EnableApply(mUIParent->TransferDataFromWindow()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
mOutGainS->SetValue((int) (mOutGain * SCL_OutGain));
|
||||
}
|
||||
|
@ -34,6 +34,7 @@ public:
|
||||
double depth;
|
||||
double freqofs;
|
||||
double phase;
|
||||
double outgain;
|
||||
double lfoskip;
|
||||
unsigned long skipcount;
|
||||
double xn1, xn2, yn1, yn2;
|
||||
@ -91,12 +92,14 @@ private:
|
||||
void OnDepthSlider(wxCommandEvent & evt);
|
||||
void OnResonanceSlider(wxCommandEvent & evt);
|
||||
void OnFreqOffSlider(wxCommandEvent & evt);
|
||||
void OnGainSlider(wxCommandEvent & evt);
|
||||
|
||||
void OnFreqText(wxCommandEvent & evt);
|
||||
void OnPhaseText(wxCommandEvent & evt);
|
||||
void OnDepthText(wxCommandEvent & evt);
|
||||
void OnResonanceText(wxCommandEvent & evt);
|
||||
void OnFreqOffText(wxCommandEvent & evt);
|
||||
void OnGainText(wxCommandEvent & evt);
|
||||
|
||||
private:
|
||||
EffectWahwahState mMaster;
|
||||
@ -108,6 +111,7 @@ private:
|
||||
mDepth - Wah depth
|
||||
mRes - Resonance
|
||||
mFreqOfs - Wah frequency offset
|
||||
mOutGain - output gain
|
||||
|
||||
!!!!!!!!!!!!! IMPORTANT!!!!!!!!! :
|
||||
mDepth and mFreqOfs should be from 0(min) to 1(max) !
|
||||
@ -118,18 +122,21 @@ private:
|
||||
int mDepth;
|
||||
double mRes;
|
||||
int mFreqOfs;
|
||||
double mOutGain;
|
||||
|
||||
wxTextCtrl *mFreqT;
|
||||
wxTextCtrl *mPhaseT;
|
||||
wxTextCtrl *mDepthT;
|
||||
wxTextCtrl *mResT;
|
||||
wxTextCtrl *mFreqOfsT;
|
||||
wxTextCtrl *mOutGainT;
|
||||
|
||||
wxSlider *mFreqS;
|
||||
wxSlider *mPhaseS;
|
||||
wxSlider *mDepthS;
|
||||
wxSlider *mResS;
|
||||
wxSlider *mFreqOfsS;
|
||||
wxSlider *mOutGainS;
|
||||
|
||||
DECLARE_EVENT_TABLE();
|
||||
};
|
||||
|
@ -352,8 +352,9 @@ void ExportMultiple::PopulateOrExchange(ShuttleGui& S)
|
||||
S.SetBorder(5);
|
||||
S.StartHorizontalLay(wxEXPAND, false);
|
||||
{
|
||||
mOverwrite = S.Id(OverwriteID)
|
||||
.AddCheckBox(_("Overwrite existing files"), wxT("true"));
|
||||
mOverwrite = S.Id(OverwriteID).TieCheckBox(_("Overwrite existing files"),
|
||||
wxT("/Export/OverwriteExisting"),
|
||||
false);
|
||||
}
|
||||
S.EndHorizontalLay();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user