Don't allow 'Classic Filters' to be applied to mixed sample-rate tracks, as we don't support that.

Fix a typo in the name of 'Classic Filters'.
Improve consistency layout as we switch filter types.
Remove a win warning in EQ.
Improve some code readability / change styles (please don't shoot me for that!).   OK, possibly increased the inconsistency.
This commit is contained in:
martynshaw99 2014-01-09 00:13:34 +00:00
parent 4dd1aa50ad
commit 3f1ebbe3dd
3 changed files with 42 additions and 20 deletions

View File

@ -255,7 +255,7 @@ EffectEqualization::~EffectEqualization()
bool EffectEqualization::Init()
{
int selcount = 0;
double rate;
double rate = 0.0;
TrackListIterator iter(GetActiveProject()->GetTracks());
Track *t = iter.First();
while (t) {

View File

@ -126,8 +126,27 @@ EffectScienFilter::~EffectScienFilter()
bool EffectScienFilter::Init()
{
return(true);
int selcount = 0;
double rate = 0.0;
TrackListIterator iter(GetActiveProject()->GetTracks());
Track *t = iter.First();
while (t) {
if (t->GetSelected() && t->GetKind() == Track::Wave) {
WaveTrack *track = (WaveTrack *)t;
if (selcount==0) {
rate = track->GetRate();
}
else {
if (track->GetRate() != rate) {
wxMessageBox(_("To apply a filter, all selected tracks must have the same sample rate."));
return(false);
}
}
selcount++;
}
t = iter.Next();
}
return(true);}
bool EffectScienFilter::PromptUser()
{
@ -613,9 +632,7 @@ void ScienFilterDialog::MakeScienFilterDialog()
// -------------------------------------------------------------------
// ROW 2 and 3: Type, Order, Ripple, Subtype, Cutoff
// -------------------------------------------------------------------
szr3 = new wxFlexGridSizer (6, 0, 0);
szr3->SetHGap(2);
szr3->SetVGap(5);
szr3 = new wxFlexGridSizer (6, 5, 2); // 6 columns, 5px Vertical gap, 2px Horizontal gap
flagslabel.Border(wxLEFT, 12).Align(wxALIGN_RIGHT | wxALIGN_CENTRE_VERTICAL );
flagsunits.Align( wxALIGN_LEFT | wxALIGN_CENTRE_VERTICAL );
@ -701,6 +718,11 @@ void ScienFilterDialog::MakeScienFilterDialog()
szrStop->Add(st, flagsunits);
szr3->Add(szrStop);
// Calculate the min size with both pass and stop-band attenuations showing, to stop them jumping around
szrPass->Show(true);
szrStop->Show(true);
szr3->SetMinSize(szr3->CalcMin());
// -------------------------------------------------------------------
// ROW 4: Subtype, Cutoff
// -------------------------------------------------------------------

View File

@ -48,7 +48,7 @@ public:
virtual ~EffectScienFilter();
virtual wxString GetEffectName() {
return wxString(_("Classic Filter..."));
return wxString(_("Classic Filters..."));
}
virtual std::set<wxString> GetEffectCategories() {