64
wxString EffectNormalize::GetEffectDescription() // useful only after parameter values have been set
66
// Note: This is useful only after ratio has been set.
68
/* i18n-hint: First %s is the effect name, 2nd and 3rd are either true or
69
* false (translated below) if those options were selected */
70
wxString::Format(_("Applied effect: %s remove dc offset = %s, normalize amplitude = %s"),
71
this->GetEffectName().c_str(),
72
/* i18n-hint: true here means that the option was
73
* selected. Opposite false if not selected */
74
mDC ? _("true") : _("false"),
75
mGain ? _("true") : _("false"));
77
strResult += wxString::Format(_(", maximum amplitude = %.1f dB"), -mLevel);
63
82
bool EffectNormalize::TransferParameters( Shuttle & shuttle )
65
84
shuttle.TransferBool( wxT("ApplyGain"), mGain, true );
122
141
//Iterate over each track
123
TrackListIterator iter(mWaveTracks);
124
WaveTrack *track = (WaveTrack *) iter.First();
142
this->CopyInputWaveTracks(); // Set up m_pOutputWaveTracks.
143
bool bGoodResult = true;
145
TrackListIterator iter(m_pOutputWaveTracks);
146
WaveTrack *track = (WaveTrack *) iter.First();
125
147
mCurTrackNum = 0;
127
149
//Get start and end times from track
289
315
// NormalizeDialog
290
316
//----------------------------------------------------------------------------
292
#define ID_BUTTON_PREVIEW 10001
293
318
#define ID_NORMALIZE_AMPLITUDE 10002
294
319
#define ID_LEVEL_STATIC_MINUS 10003
295
320
#define ID_LEVEL_STATIC_DB 10004
298
323
BEGIN_EVENT_TABLE(NormalizeDialog,wxDialog)
299
324
EVT_BUTTON( wxID_OK, NormalizeDialog::OnOk )
300
325
EVT_BUTTON( wxID_CANCEL, NormalizeDialog::OnCancel )
301
EVT_BUTTON(ID_BUTTON_PREVIEW, NormalizeDialog::OnPreview)
326
EVT_BUTTON(ID_EFFECT_PREVIEW, NormalizeDialog::OnPreview)
302
327
EVT_CHECKBOX(ID_NORMALIZE_AMPLITUDE, NormalizeDialog::OnUpdateUI)
303
328
END_EVENT_TABLE()
313
338
wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL);
315
340
mainSizer->Add(new wxStaticText(this, -1,
316
_("Normalize by Dominic Mazzoni\n"
341
_("Normalize by Dominic Mazzoni"
318
343
wxDefaultPosition, wxDefaultSize,
343
368
wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
344
369
mainSizer->Add(levelSizer, 0, wxALIGN_LEFT|wxALIGN_TOP|wxALL, 0);
346
wxBoxSizer *hSizer = new wxBoxSizer(wxHORIZONTAL);
348
wxButton * pButton_Preview =
349
new wxButton(this, ID_BUTTON_PREVIEW, mEffect->GetPreviewName());
350
hSizer->Add(pButton_Preview, 0, wxALIGN_CENTER | wxALL, 5);
351
hSizer->Add(20, 10); // horizontal spacer
353
wxButton *cancel = new wxButton(this, wxID_CANCEL, _("&Cancel"));
354
hSizer->Add(cancel, 0, wxALIGN_CENTRE|wxALL, 5);
356
wxButton *ok = new wxButton(this, wxID_OK, _("&OK"));
358
hSizer->Add(ok, 0, wxALIGN_CENTRE|wxALL, 5);
360
mainSizer->Add(hSizer, 0, wxALIGN_CENTRE|wxALIGN_CENTER_VERTICAL|wxALL, 5);
371
// Preview, OK, & Cancel buttons
372
mainSizer->Add(CreateStdButtonSizer(this, ePreviewButton|eCancelButton|eOkButton), 0, wxEXPAND);
362
374
SetAutoLayout(true);
363
375
SetSizer(mainSizer);