1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-09-16 16:20:50 +02:00

Consistently use translated effect name in titles of message boxes...

... For built-in and Nyquist effects.
This commit is contained in:
Paul Licameli 2017-09-10 10:42:33 -04:00
parent d7574b799b
commit 378c96fda1
14 changed files with 92 additions and 95 deletions

View File

@ -230,12 +230,12 @@ bool EffectAutoDuck::Init()
} }
else else
{ {
wxMessageBox( Effect::MessageBox(
_("You selected a track which does not contain audio. AutoDuck can only process audio tracks."), _("You selected a track which does not contain audio. AutoDuck can only process audio tracks."),
/* i18n-hint: Auto duck is the name of an effect that 'ducks' (reduces the volume) /* i18n-hint: Auto duck is the name of an effect that 'ducks' (reduces the volume)
* of the audio automatically when there is sound on another track. Not as * of the audio automatically when there is sound on another track. Not as
* in 'Donald-Duck'!*/ * in 'Donald-Duck'!*/
_("Auto Duck"), wxICON_ERROR, mUIParent); wxICON_ERROR);
return false; return false;
} }
} }
@ -245,9 +245,9 @@ bool EffectAutoDuck::Init()
if (!controlTrackCandidate) if (!controlTrackCandidate)
{ {
wxMessageBox( Effect::MessageBox(
_("Auto Duck needs a control track which must be placed below the selected track(s)."), _("Auto Duck needs a control track which must be placed below the selected track(s)."),
_("Auto Duck"), wxICON_ERROR, mUIParent); wxICON_ERROR);
return false; return false;
} }

View File

@ -192,9 +192,8 @@ bool EffectClickRemoval::Process()
count++; count++;
} }
if (bGoodResult && !mbDidSomething) // Processing successful, but ineffective. if (bGoodResult && !mbDidSomething) // Processing successful, but ineffective.
wxMessageBox( Effect::MessageBox(
wxString::Format(_("Algorithm not effective on this audio. Nothing changed.")), wxString::Format(_("Algorithm not effective on this audio. Nothing changed.")),
GetName(),
wxOK | wxICON_ERROR); wxOK | wxICON_ERROR);
this->ReplaceProcessedTracks(bGoodResult && mbDidSomething); this->ReplaceProcessedTracks(bGoodResult && mbDidSomething);
@ -205,10 +204,9 @@ bool EffectClickRemoval::ProcessOne(int count, WaveTrack * track, sampleCount st
{ {
if (len <= windowSize / 2) if (len <= windowSize / 2)
{ {
wxMessageBox( Effect::MessageBox(
wxString::Format(_("Selection must be larger than %d samples."), wxString::Format(_("Selection must be larger than %d samples."),
windowSize / 2), windowSize / 2),
GetName(),
wxOK | wxICON_ERROR); wxOK | wxICON_ERROR);
return false; return false;
} }

View File

@ -104,7 +104,7 @@ bool EffectEcho::ProcessInitialize(sampleCount WXUNUSED(totalLen), ChannelNames
history.reinit(histLen, true); history.reinit(histLen, true);
} }
catch ( const std::bad_alloc& ) { catch ( const std::bad_alloc& ) {
wxMessageBox(_("Requested value exceeds memory capacity.")); Effect::MessageBox(_("Requested value exceeds memory capacity."));
return false; return false;
} }

View File

@ -372,10 +372,9 @@ bool EffectEqualization::ValidateUI()
// we offer to save it. // we offer to save it.
while (mDisallowCustom && mCurveName.IsSameAs(wxT("unnamed"))) while (mDisallowCustom && mCurveName.IsSameAs(wxT("unnamed")))
{ {
wxMessageBox(_("To use this EQ curve in a batch chain, please choose a new name for it.\nChoose the 'Save/Manage Curves...' button and rename the 'unnamed' curve, then use that one."), Effect::MessageBox(_("To use this EQ curve in a batch chain, please choose a new name for it.\nChoose the 'Save/Manage Curves...' button and rename the 'unnamed' curve, then use that one."),
_("EQ Curve needs a different name"),
wxOK | wxCENTRE, wxOK | wxCENTRE,
mUIParent); _("EQ Curve needs a different name"));
return false; return false;
} }
@ -484,7 +483,7 @@ bool EffectEqualization::Init()
} }
else { else {
if (track->GetRate() != rate) { if (track->GetRate() != rate) {
wxMessageBox(_("To apply Equalization, all selected tracks must have the same sample rate.")); Effect::MessageBox(_("To apply Equalization, all selected tracks must have the same sample rate."));
return(false); return(false);
} }
} }
@ -496,9 +495,9 @@ bool EffectEqualization::Init()
mHiFreq = rate / 2.0; mHiFreq = rate / 2.0;
// Unlikely, but better than crashing. // Unlikely, but better than crashing.
if (mHiFreq <= loFreqI) { if (mHiFreq <= loFreqI) {
wxMessageBox( _("Track sample rate is too low for this effect."), Effect::MessageBox( _("Track sample rate is too low for this effect."),
_("Effect Unavailable"), wxOK | wxCENTRE,
wxOK | wxCENTRE); _("Effect Unavailable"));
return(false); return(false);
} }
@ -1394,9 +1393,9 @@ void EffectEqualization::LoadCurves(const wxString &fileName, bool append)
/* i18n-hint: EQ stands for 'Equalization'.*/ /* i18n-hint: EQ stands for 'Equalization'.*/
msg.Printf(_("Error Loading EQ Curves from file:\n%s\nError message says:\n%s"), fullPath.c_str(), reader.GetErrorStr().c_str()); msg.Printf(_("Error Loading EQ Curves from file:\n%s\nError message says:\n%s"), fullPath.c_str(), reader.GetErrorStr().c_str());
// Inform user of load failure // Inform user of load failure
wxMessageBox( msg, Effect::MessageBox( msg,
_("Error Loading EQ Curves"), wxOK | wxCENTRE,
wxOK | wxCENTRE); _("Error Loading EQ Curves"));
mCurves.Add( _("unnamed") ); // we always need a default curve to use mCurves.Add( _("unnamed") ); // we always need a default curve to use
return; return;
} }
@ -1790,7 +1789,9 @@ void EffectEqualization::setCurve(const wxString &curveName)
break; break;
if( i == mCurves.GetCount()) if( i == mCurves.GetCount())
{ {
wxMessageBox( _("Requested curve not found, using 'unnamed'"), _("Curve not found"), wxOK|wxICON_ERROR ); Effect::MessageBox( _("Requested curve not found, using 'unnamed'"),
wxOK|wxICON_ERROR,
_("Curve not found") );
setCurve((int) mCurves.GetCount()-1); setCurve((int) mCurves.GetCount()-1);
} }
else else
@ -3220,7 +3221,9 @@ void EditCurvesDialog::OnUp(wxCommandEvent & WXUNUSED(event))
{ {
if ( item == mList->GetItemCount()-1) if ( item == mList->GetItemCount()-1)
{ // 'unnamed' always stays at the bottom { // 'unnamed' always stays at the bottom
wxMessageBox(_("'unnamed' always stays at the bottom of the list"), _("'unnamed' is special")); // these could get tedious! mEffect->Effect::MessageBox(_("'unnamed' always stays at the bottom of the list"),
Effect::DefaultMessageBoxStyle,
_("'unnamed' is special")); // these could get tedious!
return; return;
} }
state = mList->GetItemState(item-1, wxLIST_STATE_SELECTED); state = mList->GetItemState(item-1, wxLIST_STATE_SELECTED);
@ -3338,11 +3341,11 @@ void EditCurvesDialog::OnRename(wxCommandEvent & WXUNUSED(event))
bad = true; bad = true;
if( curve == item ) // trying to rename a curve with the same name if( curve == item ) // trying to rename a curve with the same name
{ {
wxMessageBox( _("Name is the same as the original one"), _("Same name"), wxOK ); mEffect->Effect::MessageBox( _("Name is the same as the original one"), wxOK, _("Same name") );
break; break;
} }
int answer = wxMessageBox( _("Overwrite existing curve '") + name +_("'?"), int answer = mEffect->Effect::MessageBox( _("Overwrite existing curve '") + name +_("'?"),
_("Curve exists"), wxYES_NO ); wxYES_NO, _("Curve exists") );
if (answer == wxYES) if (answer == wxYES)
{ {
bad = false; bad = false;
@ -3413,8 +3416,8 @@ void EditCurvesDialog::OnDelete(wxCommandEvent & WXUNUSED(event))
{ {
if(item == mList->GetItemCount()-1) //unnamed if(item == mList->GetItemCount()-1) //unnamed
{ {
wxMessageBox(_("You cannot delete the 'unnamed' curve."), mEffect->Effect::MessageBox(_("You cannot delete the 'unnamed' curve."),
_("Can't delete 'unnamed'"), wxOK | wxCENTRE, this); wxOK | wxCENTRE, _("Can't delete 'unnamed'"));
} }
else else
{ {
@ -3423,7 +3426,7 @@ void EditCurvesDialog::OnDelete(wxCommandEvent & WXUNUSED(event))
quest = wxString(_("Delete '")) + mEditCurves[ item-deleted ].Name + _("' ?"); quest = wxString(_("Delete '")) + mEditCurves[ item-deleted ].Name + _("' ?");
// Ask for confirmation before removal // Ask for confirmation before removal
int ans = wxMessageBox( quest, _("Confirm Deletion"), wxYES_NO | wxCENTRE, this ); int ans = mEffect->Effect::MessageBox( quest, wxYES_NO | wxCENTRE, _("Confirm Deletion") );
if( ans == wxYES ) if( ans == wxYES )
{ // Remove the curve from the array { // Remove the curve from the array
mEditCurves.RemoveAt( item-deleted ); mEditCurves.RemoveAt( item-deleted );
@ -3453,7 +3456,7 @@ void EditCurvesDialog::OnDelete(wxCommandEvent & WXUNUSED(event))
else else
return; return;
// Ask for confirmation before removal // Ask for confirmation before removal
int ans = wxMessageBox( quest, _("Confirm Deletion"), wxYES_NO | wxCENTRE, this ); int ans = mEffect->Effect::MessageBox( quest, wxYES_NO | wxCENTRE, _("Confirm Deletion") );
if( ans == wxYES ) if( ans == wxYES )
{ // Remove the curve(s) from the array { // Remove the curve(s) from the array
// Take care, mList and mEditCurves will get out of sync as curves are deleted // Take care, mList and mEditCurves will get out of sync as curves are deleted
@ -3462,8 +3465,9 @@ void EditCurvesDialog::OnDelete(wxCommandEvent & WXUNUSED(event))
{ {
if(item == mList->GetItemCount()-1) //unnamed if(item == mList->GetItemCount()-1) //unnamed
{ {
wxMessageBox(_("You cannot delete the 'unnamed' curve, it is special."), mEffect->Effect::MessageBox(_("You cannot delete the 'unnamed' curve, it is special."),
_("Can't delete 'unnamed'"), wxOK | wxCENTRE, this); Effect::DefaultMessageBoxStyle,
_("Can't delete 'unnamed'"));
} }
else else
{ {
@ -3521,7 +3525,9 @@ void EditCurvesDialog::OnExport( wxCommandEvent & WXUNUSED(event))
i++; i++;
} }
else else
wxMessageBox(_("You cannot export 'unnamed' curve, it is special."), _("Cannot Export 'unnamed'")); mEffect->Effect::MessageBox(_("You cannot export 'unnamed' curve, it is special."),
Effect::DefaultMessageBoxStyle,
_("Cannot Export 'unnamed'"));
// get next selected item // get next selected item
item = mList->GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); item = mList->GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
} }
@ -3532,10 +3538,14 @@ void EditCurvesDialog::OnExport( wxCommandEvent & WXUNUSED(event))
mEffect->mCurves = temp; mEffect->mCurves = temp;
wxString message; wxString message;
message.Printf(_("%d curves exported to %s"), i, fileName.c_str()); message.Printf(_("%d curves exported to %s"), i, fileName.c_str());
wxMessageBox(message, _("Curves exported")); mEffect->Effect::MessageBox(message,
Effect::DefaultMessageBoxStyle,
_("Curves exported"));
} }
else else
wxMessageBox(_("No curves exported"), _("No curves exported")); mEffect->Effect::MessageBox(_("No curves exported"),
Effect::DefaultMessageBoxStyle,
_("No curves exported"));
} }
void EditCurvesDialog::OnLibrary( wxCommandEvent & WXUNUSED(event)) void EditCurvesDialog::OnLibrary( wxCommandEvent & WXUNUSED(event))

View File

@ -506,7 +506,7 @@ bool EffectEqualization48x::Benchmark(EffectEqualization* effectEqualization)
wxTimeSpan tsDefaultThreaded(0, 0, 0, times[3]); wxTimeSpan tsDefaultThreaded(0, 0, 0, times[3]);
wxTimeSpan tsDefault(0, 0, 0, times[4]); wxTimeSpan tsDefault(0, 0, 0, times[4]);
wxMessageBox(wxString::Format(_("Benchmark times:\nOriginal: %s\nDefault Segmented: %s\nDefault Threaded: %s\nSSE: %s\nSSE Threaded: %s\n"),tsDefault.Format(wxT("%M:%S.%l")).c_str(), Effect::MessageBox(wxString::Format(_("Benchmark times:\nOriginal: %s\nDefault Segmented: %s\nDefault Threaded: %s\nSSE: %s\nSSE Threaded: %s\n"),tsDefault.Format(wxT("%M:%S.%l")).c_str(),
tsDefaultEnhanced.Format(wxT("%M:%S.%l")).c_str(), tsDefaultThreaded.Format(wxT("%M:%S.%l")).c_str(),tsSSE.Format(wxT("%M:%S.%l")).c_str(),tsSSEThreaded.Format(wxT("%M:%S.%l")).c_str())); tsDefaultEnhanced.Format(wxT("%M:%S.%l")).c_str(), tsDefaultThreaded.Format(wxT("%M:%S.%l")).c_str(),tsSSE.Format(wxT("%M:%S.%l")).c_str(),tsSSEThreaded.Format(wxT("%M:%S.%l")).c_str()));
return bBreakLoop; // return !bBreakLoop ? return bBreakLoop; // return !bBreakLoop ?
} }

View File

@ -172,7 +172,7 @@ bool EffectFindClipping::ProcessOne(LabelTrack * lt,
buffer.reinit(blockSize); buffer.reinit(blockSize);
} }
catch( const std::bad_alloc & ) { catch( const std::bad_alloc & ) {
wxMessageBox(_("Requested value exceeds memory capacity.")); Effect::MessageBox(_("Requested value exceeds memory capacity."));
return false; return false;
} }

View File

@ -54,9 +54,10 @@ bool Generator::Process()
track->IsEmpty(mT0, mT1+1.0/track->GetRate()) && track->IsEmpty(mT0, mT1+1.0/track->GetRate()) &&
!track->IsEmpty(mT0, mT0+GetDuration()-(mT1-mT0)-1.0/track->GetRate())) !track->IsEmpty(mT0, mT0+GetDuration()-(mT1-mT0)-1.0/track->GetRate()))
{ {
wxMessageBox( Effect::MessageBox(
_("There is not enough room available to generate the audio"), _("There is not enough room available to generate the audio"),
_("Error"), wxICON_STOP); wxICON_STOP,
_("Error"));
Failure(); Failure();
return false; return false;
} }

View File

@ -206,7 +206,7 @@ public:
bool PromptUser(EffectNoiseReduction *effect, bool PromptUser(EffectNoiseReduction *effect,
wxWindow *parent, bool bHasProfile, bool bAllowTwiddleSettings); wxWindow *parent, bool bHasProfile, bool bAllowTwiddleSettings);
bool PrefsIO(bool read); bool PrefsIO(bool read);
bool Validate() const; bool Validate(EffectNoiseReduction *effect) const;
size_t WindowSize() const { return 1u << (3 + mWindowSizeChoice); } size_t WindowSize() const { return 1u << (3 + mWindowSizeChoice); }
unsigned StepsPerWindow() const { return 1u << (1 + mStepsPerWindowChoice); } unsigned StepsPerWindow() const { return 1u << (1 + mStepsPerWindowChoice); }
@ -576,20 +576,20 @@ bool EffectNoiseReduction::Settings::PrefsIO(bool read)
} }
} }
bool EffectNoiseReduction::Settings::Validate() const bool EffectNoiseReduction::Settings::Validate(EffectNoiseReduction *effect) const
{ {
if (StepsPerWindow() < windowTypesInfo[mWindowTypes].minSteps) { if (StepsPerWindow() < windowTypesInfo[mWindowTypes].minSteps) {
::wxMessageBox(_("Steps per block are too few for the window types.")); effect->Effect::MessageBox(_("Steps per block are too few for the window types."));
return false; return false;
} }
if (StepsPerWindow() > WindowSize()) { if (StepsPerWindow() > WindowSize()) {
::wxMessageBox(_("Steps per block cannot exceed the window size.")); effect->Effect::MessageBox(_("Steps per block cannot exceed the window size."));
return false; return false;
} }
if (mMethod == DM_MEDIAN && StepsPerWindow() > 4) { if (mMethod == DM_MEDIAN && StepsPerWindow() > 4) {
::wxMessageBox(_("Median method is not implemented for more than four steps per window.")); effect->Effect::MessageBox(_("Median method is not implemented for more than four steps per window."));
return false; return false;
} }
@ -616,12 +616,12 @@ bool EffectNoiseReduction::Process()
} }
else if (mStatistics->mWindowSize != mSettings->WindowSize()) { else if (mStatistics->mWindowSize != mSettings->WindowSize()) {
// possible only with advanced settings // possible only with advanced settings
::wxMessageBox(_("You must specify the same window size for steps 1 and 2.")); ::Effect::MessageBox(_("You must specify the same window size for steps 1 and 2."));
return false; return false;
} }
else if (mStatistics->mWindowTypes != mSettings->mWindowTypes) { else if (mStatistics->mWindowTypes != mSettings->mWindowTypes) {
// A warning only // A warning only
::wxMessageBox(_("Warning: window types are not the same as for profiling.")); ::Effect::MessageBox(_("Warning: window types are not the same as for profiling."));
} }
Worker worker(*mSettings, mStatistics->mRate Worker worker(*mSettings, mStatistics->mRate
@ -653,9 +653,9 @@ bool EffectNoiseReduction::Worker::Process
while (track) { while (track) {
if (track->GetRate() != mSampleRate) { if (track->GetRate() != mSampleRate) {
if (mDoProfile) if (mDoProfile)
::wxMessageBox(_("All noise profile data must have the same sample rate.")); effect.Effect::MessageBox(_("All noise profile data must have the same sample rate."));
else else
::wxMessageBox(_("The sample rate of the noise profile must match that of the sound to be processed.")); effect.Effect::MessageBox(_("The sample rate of the noise profile must match that of the sound to be processed."));
return false; return false;
} }
@ -679,7 +679,7 @@ bool EffectNoiseReduction::Worker::Process
if (mDoProfile) { if (mDoProfile) {
if (statistics.mTotalWindows == 0) { if (statistics.mTotalWindows == 0) {
::wxMessageBox(_("Selected noise profile is too short.")); effect.Effect::MessageBox(_("Selected noise profile is too short."));
return false; return false;
} }
} }
@ -1851,7 +1851,7 @@ bool EffectNoiseReduction::Dialog::TransferDataFromWindow()
wxCommandEvent dummy; wxCommandEvent dummy;
OnNoiseReductionChoice(dummy); OnNoiseReductionChoice(dummy);
return mTempSettings.Validate(); return mTempSettings.Validate(m_pEffect);
} }
void EffectNoiseReduction::Dialog::OnText(wxCommandEvent &event) void EffectNoiseReduction::Dialog::OnText(wxCommandEvent &event)

View File

@ -255,7 +255,7 @@ bool EffectPaulstretch::ProcessOne(WaveTrack *track,double t0,double t1,int coun
const auto stretch_buf_size = GetBufferSize(track->GetRate()); const auto stretch_buf_size = GetBufferSize(track->GetRate());
if (stretch_buf_size == 0) { if (stretch_buf_size == 0) {
::wxMessageBox( badAllocMessage ); ::Effect::MessageBox( badAllocMessage );
return false; return false;
} }
@ -268,7 +268,7 @@ bool EffectPaulstretch::ProcessOne(WaveTrack *track,double t0,double t1,int coun
const auto minDuration = stretch_buf_size * 2 + 1; const auto minDuration = stretch_buf_size * 2 + 1;
if (minDuration < stretch_buf_size) { if (minDuration < stretch_buf_size) {
// overflow! // overflow!
::wxMessageBox( badAllocMessage ); ::Effect::MessageBox( badAllocMessage );
return false; return false;
} }
@ -284,30 +284,30 @@ bool EffectPaulstretch::ProcessOne(WaveTrack *track,double t0,double t1,int coun
/* i18n-hint: 'Time Resolution' is the name of a control in the Paulstretch effect.*/ /* i18n-hint: 'Time Resolution' is the name of a control in the Paulstretch effect.*/
if ((minDuration / mProjectRate) < defaultPreviewLen) { if ((minDuration / mProjectRate) < defaultPreviewLen) {
::wxMessageBox (wxString::Format(_("Audio selection too short to preview.\n\n" ::Effect::MessageBox (wxString::Format(_("Audio selection too short to preview.\n\n"
"Try increasing the audio selection to at least %.1f seconds,\n" "Try increasing the audio selection to at least %.1f seconds,\n"
"or reducing the 'Time Resolution' to less than %.1f seconds."), "or reducing the 'Time Resolution' to less than %.1f seconds."),
(minDuration / track->GetRate()) + 0.05, // round up to 1/10 s. (minDuration / track->GetRate()) + 0.05, // round up to 1/10 s.
floor(maxTimeRes * 10.0) / 10.0), floor(maxTimeRes * 10.0) / 10.0),
GetName(), wxOK | wxICON_EXCLAMATION); wxOK | wxICON_EXCLAMATION);
} }
else { else {
/* i18n-hint: 'Time Resolution' is the name of a control in the Paulstretch effect.*/ /* i18n-hint: 'Time Resolution' is the name of a control in the Paulstretch effect.*/
::wxMessageBox (wxString::Format(_("Unable to Preview.\n\n" ::Effect::MessageBox (wxString::Format(_("Unable to Preview.\n\n"
"For the current audio selection, the maximum\n" "For the current audio selection, the maximum\n"
"'Time Resolution' is %.1f seconds."), "'Time Resolution' is %.1f seconds."),
floor(maxTimeRes * 10.0) / 10.0), floor(maxTimeRes * 10.0) / 10.0),
GetName(), wxOK | wxICON_EXCLAMATION); wxOK | wxICON_EXCLAMATION);
} }
} }
else { else {
/* i18n-hint: 'Time Resolution' is the name of a control in the Paulstretch effect.*/ /* i18n-hint: 'Time Resolution' is the name of a control in the Paulstretch effect.*/
::wxMessageBox (wxString::Format(_("The 'Time Resolution' is too long for the selection.\n\n" ::Effect::MessageBox (wxString::Format(_("The 'Time Resolution' is too long for the selection.\n\n"
"Try increasing the audio selection to at least %.1f seconds,\n" "Try increasing the audio selection to at least %.1f seconds,\n"
"or reducing the 'Time Resolution' to less than %.1f seconds."), "or reducing the 'Time Resolution' to less than %.1f seconds."),
(minDuration / track->GetRate()) + 0.05, // round up to 1/10 s. (minDuration / track->GetRate()) + 0.05, // round up to 1/10 s.
floor(maxTimeRes * 10.0) / 10.0), floor(maxTimeRes * 10.0) / 10.0),
GetName(), wxOK | wxICON_EXCLAMATION); wxOK | wxICON_EXCLAMATION);
} }
return false; return false;
@ -394,7 +394,7 @@ bool EffectPaulstretch::ProcessOne(WaveTrack *track,double t0,double t1,int coun
return !cancelled; return !cancelled;
} }
catch ( const std::bad_alloc& ) { catch ( const std::bad_alloc& ) {
::wxMessageBox( badAllocMessage ); ::Effect::MessageBox( badAllocMessage );
return false; return false;
} }
}; };

View File

@ -91,7 +91,7 @@ bool EffectRepair::Process()
const auto repair1 = track->TimeToLongSamples(repair_t1); const auto repair1 = track->TimeToLongSamples(repair_t1);
const auto repairLen = repair1 - repair0; const auto repairLen = repair1 - repair0;
if (repairLen > 128) { if (repairLen > 128) {
::wxMessageBox(_("The Repair effect is intended to be used on very short sections of damaged audio (up to 128 samples).\n\nZoom in and select a tiny fraction of a second to repair.")); ::Effect::MessageBox(_("The Repair effect is intended to be used on very short sections of damaged audio (up to 128 samples).\n\nZoom in and select a tiny fraction of a second to repair."));
bGoodResult = false; bGoodResult = false;
break; break;
} }
@ -108,7 +108,7 @@ bool EffectRepair::Process()
const auto len = s1 - s0; const auto len = s1 - s0;
if (s0 == repair0 && s1 == repair1) { if (s0 == repair0 && s1 == repair1) {
::wxMessageBox(_("Repair works by using audio data outside the selection region.\n\nPlease select a region that has audio touching at least one side of it.\n\nThe more surrounding audio, the better it performs.")); ::Effect::MessageBox(_("Repair works by using audio data outside the selection region.\n\nPlease select a region that has audio touching at least one side of it.\n\nThe more surrounding audio, the better it performs."));
/// The Repair effect needs some data to go on.\n\nPlease select an area to repair with some audio on at least one side (the more the better).")); /// The Repair effect needs some data to go on.\n\nPlease select an area to repair with some audio on at least one side (the more the better)."));
bGoodResult = false; bGoodResult = false;
break; break;

View File

@ -348,7 +348,7 @@ bool EffectScienFilter::Init()
{ {
if (t->GetRate() != rate) if (t->GetRate() != rate)
{ {
wxMessageBox(_("To apply a filter, all selected tracks must have the same sample rate.")); Effect::MessageBox(_("To apply a filter, all selected tracks must have the same sample rate."));
return false; return false;
} }
} }

View File

@ -288,7 +288,7 @@ bool EffectTruncSilence::ProcessIndependently()
if (track2->GetKind() == Track::Wave && if (track2->GetKind() == Track::Wave &&
!(track2 == track || track2 == link) && !(track2 == track || track2 == link) &&
track2->GetSelected()) { track2->GetSelected()) {
::wxMessageBox(_("When truncating independently, there may only be one selected audio track in each Sync-Locked Track Group.")); ::Effect::MessageBox(_("When truncating independently, there may only be one selected audio track in each Sync-Locked Track Group."));
return false; return false;
} }
} }

View File

@ -451,10 +451,10 @@ bool NyquistEffect::Init()
} }
if (!bAllowSpectralEditing || ((mF0 < 0.0) && (mF1 < 0.0))) { if (!bAllowSpectralEditing || ((mF0 < 0.0) && (mF1 < 0.0))) {
wxMessageBox(_("To use 'Spectral effects', enable 'Spectral Selection'\n" Effect::MessageBox(_("To use 'Spectral effects', enable 'Spectral Selection'\n"
"in the track Spectrogram settings and select the\n" "in the track Spectrogram settings and select the\n"
"frequency range for the effect to act on."), "frequency range for the effect to act on."),
_("Error"), wxOK | wxICON_EXCLAMATION | wxCENTRE); wxOK | wxICON_EXCLAMATION | wxCENTRE, _("Error"));
return false; return false;
} }
@ -665,9 +665,8 @@ bool NyquistEffect::Process()
mCurTrack[1] = (WaveTrack *)iter.Next(); mCurTrack[1] = (WaveTrack *)iter.Next();
if (mCurTrack[1]->GetRate() != mCurTrack[0]->GetRate()) { if (mCurTrack[1]->GetRate() != mCurTrack[0]->GetRate()) {
wxMessageBox(_("Sorry, cannot apply effect on stereo tracks where the tracks don't match."), Effect::MessageBox(_("Sorry, cannot apply effect on stereo tracks where the tracks don't match."),
wxT("Nyquist"), wxOK | wxCENTRE);
wxOK | wxCENTRE, mUIParent);
success = false; success = false;
goto finish; goto finish;
} }
@ -690,7 +689,7 @@ bool NyquistEffect::Process()
_("Selection too long for Nyquist code.\nMaximum allowed selection is %ld samples\n(about %.1f hours at 44100 Hz sample rate)."), _("Selection too long for Nyquist code.\nMaximum allowed selection is %ld samples\n(about %.1f hours at 44100 Hz sample rate)."),
(long)NYQ_MAX_LEN, hours (long)NYQ_MAX_LEN, hours
); );
wxMessageBox(message, _("Nyquist Error"), wxOK | wxCENTRE); Effect::MessageBox(message, wxOK | wxCENTRE, _("Nyquist Error"));
if (!mProjectChanged) if (!mProjectChanged)
em.SetSkipStateFlag(true); em.SetSkipStateFlag(true);
return false; return false;
@ -1213,7 +1212,7 @@ bool NyquistEffect::ProcessOne()
if (rval == nyx_string) { if (rval == nyx_string) {
wxString msg = NyquistToWxString(nyx_get_string()); wxString msg = NyquistToWxString(nyx_get_string());
if (!msg.IsEmpty()) // Not currently a documented feature, but could be useful as a No-Op. if (!msg.IsEmpty()) // Not currently a documented feature, but could be useful as a No-Op.
wxMessageBox(msg, mName, wxOK | wxCENTRE, mUIParent); Effect::MessageBox(msg);
// True if not process type. // True if not process type.
// If not returning audio from process effect, // If not returning audio from process effect,
@ -1226,8 +1225,7 @@ bool NyquistEffect::ProcessOne()
wxString str; wxString str;
str.Printf(_("Nyquist returned the value:") + wxString(wxT(" %f")), str.Printf(_("Nyquist returned the value:") + wxString(wxT(" %f")),
nyx_get_double()); nyx_get_double());
wxMessageBox(str, wxT("Nyquist"), Effect::MessageBox(str);
wxOK | wxCENTRE, mUIParent);
return (GetType() != EffectTypeProcess || mIsPrompt); return (GetType() != EffectTypeProcess || mIsPrompt);
} }
@ -1235,8 +1233,7 @@ bool NyquistEffect::ProcessOne()
wxString str; wxString str;
str.Printf(_("Nyquist returned the value:") + wxString(wxT(" %d")), str.Printf(_("Nyquist returned the value:") + wxString(wxT(" %d")),
nyx_get_int()); nyx_get_int());
wxMessageBox(str, wxT("Nyquist"), Effect::MessageBox(str);
wxOK | wxCENTRE, mUIParent);
return (GetType() != EffectTypeProcess || mIsPrompt); return (GetType() != EffectTypeProcess || mIsPrompt);
} }
@ -1275,23 +1272,17 @@ bool NyquistEffect::ProcessOne()
int outChannels = nyx_get_audio_num_channels(); int outChannels = nyx_get_audio_num_channels();
if (outChannels > (int)mCurNumChannels) { if (outChannels > (int)mCurNumChannels) {
wxMessageBox(_("Nyquist returned too many audio channels.\n"), Effect::MessageBox(_("Nyquist returned too many audio channels.\n"));
wxT("Nyquist"),
wxOK | wxCENTRE, mUIParent);
return false; return false;
} }
if (outChannels == -1) { if (outChannels == -1) {
wxMessageBox(_("Nyquist returned one audio channel as an array.\n"), Effect::MessageBox(_("Nyquist returned one audio channel as an array.\n"));
wxT("Nyquist"),
wxOK | wxCENTRE, mUIParent);
return false; return false;
} }
if (outChannels == 0) { if (outChannels == 0) {
wxMessageBox(_("Nyquist returned an empty array.\n"), Effect::MessageBox(_("Nyquist returned an empty array.\n"));
wxT("Nyquist"),
wxOK | wxCENTRE, mUIParent);
return false; return false;
} }
@ -1340,9 +1331,7 @@ bool NyquistEffect::ProcessOne()
mOutputTime = outputTrack[i]->GetEndTime(); mOutputTime = outputTrack[i]->GetEndTime();
if (mOutputTime <= 0) { if (mOutputTime <= 0) {
wxMessageBox(_("Nyquist returned nil audio.\n"), Effect::MessageBox(_("Nyquist returned nil audio.\n"));
wxT("Nyquist"),
wxOK | wxCENTRE, mUIParent);
return true; return true;
} }
} }
@ -1740,7 +1729,7 @@ void NyquistEffect::Parse(const wxString &line)
tokens[3].c_str(), mFileName.GetFullPath().c_str()); tokens[3].c_str(), mFileName.GetFullPath().c_str());
// Too disturbing to show alert before Audacity frame is up. // Too disturbing to show alert before Audacity frame is up.
// wxMessageBox(str, wxT("Nyquist Warning"), wxOK | wxICON_EXCLAMATION); // Effect::MessageBox(str, wxT("Nyquist Warning"), wxOK | wxICON_EXCLAMATION);
// Note that the AudacityApp's mLogger has not yet been created, // Note that the AudacityApp's mLogger has not yet been created,
// so this brings up an alert box, but after the Audacity frame is up. // so this brings up an alert box, but after the Audacity frame is up.
@ -1854,11 +1843,11 @@ bool NyquistEffect::ParseProgram(wxInputStream & stream)
{ {
/* i1n-hint: SAL and LISP are names for variant syntaxes for the /* i1n-hint: SAL and LISP are names for variant syntaxes for the
Nyquist programming language. Leave them, and 'return', untranslated. */ Nyquist programming language. Leave them, and 'return', untranslated. */
wxMessageBox(_("Your code looks like SAL syntax, but there is no \'return\' statement.\n\ Effect::MessageBox(_("Your code looks like SAL syntax, but there is no \'return\' statement.\n\
For SAL, use a return statement such as:\n\treturn *track* * 0.1\n\ For SAL, use a return statement such as:\n\treturn *track* * 0.1\n\
or for LISP, begin with an open parenthesis such as:\n\t(mult *track* 0.1)\n ."), or for LISP, begin with an open parenthesis such as:\n\t(mult *track* 0.1)\n ."),
_("Error in Nyquist code"), Effect::DefaultMessageBoxStyle,
wxOK | wxCENTRE); _("Error in Nyquist code"));
/* i18n-hint: refers to programming "languages" */ /* i18n-hint: refers to programming "languages" */
mInitError = _("Could not determine language"); mInitError = _("Could not determine language");
return false; return false;
@ -2311,8 +2300,7 @@ void NyquistEffect::OnLoad(wxCommandEvent & WXUNUSED(evt))
{ {
if (mCommandText->IsModified()) if (mCommandText->IsModified())
{ {
if (wxMessageBox(_("Current program has been modified.\nDiscard changes?"), if (Effect::MessageBox(_("Current program has been modified.\nDiscard changes?"),
GetName(),
wxYES_NO) == wxNO) wxYES_NO) == wxNO)
{ {
return; return;
@ -2335,7 +2323,7 @@ void NyquistEffect::OnLoad(wxCommandEvent & WXUNUSED(evt))
if (!mCommandText->LoadFile(mFileName.GetFullPath())) if (!mCommandText->LoadFile(mFileName.GetFullPath()))
{ {
wxMessageBox(_("File could not be loaded"), GetName()); Effect::MessageBox(_("File could not be loaded"));
} }
} }
@ -2357,7 +2345,7 @@ void NyquistEffect::OnSave(wxCommandEvent & WXUNUSED(evt))
if (!mCommandText->SaveFile(mFileName.GetFullPath())) if (!mCommandText->SaveFile(mFileName.GetFullPath()))
{ {
wxMessageBox(_("File could not be saved"), GetName()); Effect::MessageBox(_("File could not be saved"));
} }
} }

View File

@ -324,7 +324,7 @@ bool VampEffect::Init()
if (left->GetRate() != right->GetRate()) if (left->GetRate() != right->GetRate())
{ {
wxMessageBox(_("Sorry, Vamp Plug-ins cannot be run on stereo tracks where the individual channels of the track do not match.")); Effect::MessageBox(_("Sorry, Vamp Plug-ins cannot be run on stereo tracks where the individual channels of the track do not match."));
return false; return false;
} }
} }
@ -343,7 +343,7 @@ bool VampEffect::Init()
mPlugin.reset(loader->loadPlugin(mKey, mRate, Vamp::HostExt::PluginLoader::ADAPT_ALL)); mPlugin.reset(loader->loadPlugin(mKey, mRate, Vamp::HostExt::PluginLoader::ADAPT_ALL));
if (!mPlugin) if (!mPlugin)
{ {
wxMessageBox(_("Sorry, failed to load Vamp Plug-in.")); Effect::MessageBox(_("Sorry, failed to load Vamp Plug-in."));
return false; return false;
} }
@ -437,7 +437,7 @@ bool VampEffect::Process()
{ {
if (!mPlugin->initialise(channels, step, block)) if (!mPlugin->initialise(channels, step, block))
{ {
wxMessageBox(_("Sorry, Vamp Plug-in failed to initialize.")); Effect::MessageBox(_("Sorry, Vamp Plug-in failed to initialize."));
return false; return false;
} }
} }