1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-02 17:09:26 +02:00
v.audacity 2011-11-16 05:59:48 +00:00
parent 618df78900
commit 59db8d4ad4
21 changed files with 77 additions and 81 deletions

View File

@ -1577,7 +1577,7 @@ bool AudacityApp::CreateSingleInstanceChecker(wxString dir)
runningTwoCopiesStr + runningTwoCopiesStr +
_("Do you still want to start Audacity?"); _("Do you still want to start Audacity?");
int action = wxMessageBox(prompt, int action = wxMessageBox(prompt,
_("Error locking temporary folder"), _("Error Locking Temporary Folder"),
wxYES_NO | wxICON_EXCLAMATION, wxYES_NO | wxICON_EXCLAMATION,
NULL); NULL);
if (action == wxNO) { if (action == wxNO) {

View File

@ -1754,7 +1754,7 @@ void AudioIO::StopStream()
if (recordingOffset < 0) if (recordingOffset < 0)
track->Clear(mT0, mT0 - recordingOffset); // cut the latency out track->Clear(mT0, mT0 - recordingOffset); // cut the latency out
else else
track->InsertSilence(mT0, recordingOffset); // put silence in wxASSERT(track->InsertSilence(mT0, recordingOffset)); // put silence in
} }
else else
{ // recording into a new track { // recording into a new track

View File

@ -423,7 +423,11 @@ void BenchmarkDialog::OnRun( wxCommandEvent &event )
if (mEditDetail) if (mEditDetail)
Printf(wxT("Paste: %d\n"), y0 * chunkSize); Printf(wxT("Paste: %d\n"), y0 * chunkSize);
t->Paste(double (y0 * chunkSize), tmp); if (!t->Paste((double)(y0 * chunkSize), tmp))
{
Printf(wxT("Trial %d\nFailed on Paste.\n"), z);
goto fail;
}
if (t->GetClipByIndex(0)->GetSequence()->GetNumSamples() != (sampleCount) nChunks * chunkSize) { if (t->GetClipByIndex(0)->GetSequence()->GetNumSamples() != (sampleCount) nChunks * chunkSize) {
Printf(wxT("Trial %d\n"), z); Printf(wxT("Trial %d\n"), z);

View File

@ -3465,7 +3465,7 @@ void AudacityProject::OnPaste()
}else{ }else{
WaveTrack *tmp; WaveTrack *tmp;
tmp = mTrackFactory->NewWaveTrack( ((WaveTrack*)n)->GetSampleFormat(), ((WaveTrack*)n)->GetRate()); tmp = mTrackFactory->NewWaveTrack( ((WaveTrack*)n)->GetSampleFormat(), ((WaveTrack*)n)->GetRate());
tmp->InsertSilence(0.0, msClipT1 - msClipT0); // MJS: Is this correct? wxASSERT(tmp->InsertSilence(0.0, msClipT1 - msClipT0)); // MJS: Is this correct?
tmp->Flush(); tmp->Flush();
bPastedSomething |= bPastedSomething |=
@ -3590,19 +3590,16 @@ bool AudacityProject::HandlePasteNothingSelected()
pNewTrack = mTrackFactory->NewTimeTrack(); pNewTrack = mTrackFactory->NewTimeTrack();
break; break;
default: default:
// Vaughan, 2010-08-05:
// This is probably an error, but was never checked...
// The only kinds of tracks not checked above are Track::None and Track::All.
pClip = iterClip.Next(); pClip = iterClip.Next();
continue; continue;
} }
wxASSERT(pClip);
pNewTrack->SetLinked(pClip->GetLinked()); pNewTrack->SetLinked(pClip->GetLinked());
pNewTrack->SetChannel(pClip->GetChannel()); pNewTrack->SetChannel(pClip->GetChannel());
pNewTrack->SetName(pClip->GetName()); pNewTrack->SetName(pClip->GetName());
// Vaughan, 2010-08-05: This code never checked the paste result... wxASSERT(pNewTrack->Paste(0.0, pClip));
pNewTrack->Paste(0.0, pClip);
mTracks->Add(pNewTrack); mTracks->Add(pNewTrack);
pNewTrack->SetSelected(true); pNewTrack->SetSelected(true);

View File

@ -2328,7 +2328,7 @@ void AudacityProject::OpenFile(wxString fileName, bool addtohistory)
int numRead = ff->Read(buf, 15); int numRead = ff->Read(buf, 15);
if (numRead != 15) { if (numRead != 15) {
wxMessageBox(wxString::Format(_("File may be invalid or corrupted: \n%s"), wxMessageBox(wxString::Format(_("File may be invalid or corrupted: \n%s"),
(const wxChar*)fileName), _("Error opening file or project"), (const wxChar*)fileName), _("Error Opening File or Project"),
wxOK | wxCENTRE, this); wxOK | wxCENTRE, this);
ff->Close(); ff->Close();
delete ff; delete ff;
@ -3043,7 +3043,7 @@ bool AudacityProject::Save(bool overwrite /* = true */ ,
{ {
if (mUndoManager.UnsavedChanges() && mEmptyCanBeDirty) { if (mUndoManager.UnsavedChanges() && mEmptyCanBeDirty) {
int result = wxMessageBox(_("Your project is now empty.\nIf saved, the project will have no tracks.\n\nTo save any previously open tracks:\nClick 'No', Edit > Undo until all tracks\nare open, then File > Save Project.\n\nSave anyway?"), int result = wxMessageBox(_("Your project is now empty.\nIf saved, the project will have no tracks.\n\nTo save any previously open tracks:\nClick 'No', Edit > Undo until all tracks\nare open, then File > Save Project.\n\nSave anyway?"),
_("Warning empty project"), _("Warning - Empty Project"),
wxYES_NO | wxICON_QUESTION, this); wxYES_NO | wxICON_QUESTION, this);
if (result == wxNO) if (result == wxNO)
return false; return false;
@ -3116,7 +3116,7 @@ bool AudacityProject::Save(bool overwrite /* = true */ ,
wxMessageBox(wxString::Format( wxMessageBox(wxString::Format(
_("Could not save project. Path not found. Try creating \ndirectory \"%s\" before saving project with this name."), _("Could not save project. Path not found. Try creating \ndirectory \"%s\" before saving project with this name."),
projPath.c_str()), projPath.c_str()),
_("Error saving project"), _("Error Saving Project"),
wxICON_ERROR, this); wxICON_ERROR, this);
return false; return false;
} }
@ -3153,7 +3153,7 @@ bool AudacityProject::Save(bool overwrite /* = true */ ,
wxRename(safetyFileName, mFileName); wxRename(safetyFileName, mFileName);
wxMessageBox(wxString::Format(_("Could not save project. Perhaps %s \nis not writable or the disk is full."), wxMessageBox(wxString::Format(_("Could not save project. Perhaps %s \nis not writable or the disk is full."),
project.c_str()), project.c_str()),
_("Error saving project"), _("Error Saving Project"),
wxICON_ERROR, this); wxICON_ERROR, this);
return false; return false;
} }
@ -3176,7 +3176,7 @@ bool AudacityProject::Save(bool overwrite /* = true */ ,
wxMessageBox(wxString::Format( wxMessageBox(wxString::Format(
_("Couldn't write to file \"%s\": %s"), _("Couldn't write to file \"%s\": %s"),
mFileName.c_str(), pException->GetMessage().c_str()), mFileName.c_str(), pException->GetMessage().c_str()),
_("Error saving project"), wxICON_ERROR); _("Error Saving Project"), wxICON_ERROR);
delete pException; delete pException;
@ -3443,10 +3443,10 @@ bool AudacityProject::Import(wxString fileName, WaveTrackArray* pTrackArray /*=
if (!errorMessage.IsEmpty()) { if (!errorMessage.IsEmpty()) {
// Version that goes to internet... // Version that goes to internet...
// ShowErrorDialog(this, _("Error importing"), // ShowErrorDialog(this, _("Error Importing"),
// errorMessage, wxT("http://audacity.sourceforge.net/help/faq?s=files&i=wma-proprietary")); // errorMessage, wxT("http://audacity.sourceforge.net/help/faq?s=files&i=wma-proprietary"));
// Version that looks locally for the text. // Version that looks locally for the text.
ShowErrorDialog(this, _("Error importing"), ShowErrorDialog(this, _("Error Importing"),
errorMessage, wxT("innerlink:wma-proprietary")); errorMessage, wxT("innerlink:wma-proprietary"));
} }
if (numTracks <= 0) if (numTracks <= 0)
@ -3539,7 +3539,11 @@ bool AudacityProject::SaveAs(bool bWantSaveCompressed /*= false*/)
//We should only overwrite it if this project already has the same name, where the user //We should only overwrite it if this project already has the same name, where the user
//simply chose to use the save as command although the save command would have the effect. //simply chose to use the save as command although the save command would have the effect.
if(mFileName!=fName+ext && wxFileExists(fName+ext)) { if(mFileName!=fName+ext && wxFileExists(fName+ext)) {
wxMessageDialog m(NULL, _("The project was not saved because the file name provided would overwrite another project.\nPlease try again and select an original name."), _("Error Saving Project"), wxOK|wxICON_ERROR); wxMessageDialog m(
NULL,
_("The project was not saved because the file name provided would overwrite another project.\nPlease try again and select an original name."),
_("Error Saving Project"),
wxOK|wxICON_ERROR);
m.ShowModal(); m.ShowModal();
return false; return false;
} }
@ -4190,7 +4194,7 @@ void AudacityProject::EditClipboardByLabel( WaveTrack::EditDestFunction action )
regions.Item(i+1)->start - regions.Item(i)->end); regions.Item(i+1)->start - regions.Item(i)->end);
} }
merged->Paste( 0.0 , dest ); wxASSERT(merged->Paste( 0.0 , dest ));
delete dest; delete dest;
} }
} }
@ -4392,7 +4396,7 @@ void AudacityProject::AutoSave()
wxMessageBox(wxString::Format( wxMessageBox(wxString::Format(
_("Couldn't write to file \"%s\": %s"), _("Couldn't write to file \"%s\": %s"),
(fn + wxT(".tmp")).c_str(), pException->GetMessage().c_str()), (fn + wxT(".tmp")).c_str(), pException->GetMessage().c_str()),
_("Error writing autosave file"), wxICON_ERROR, this); _("Error Writing Autosave File"), wxICON_ERROR, this);
delete pException; delete pException;

View File

@ -80,7 +80,7 @@ Sequence::Sequence(const Sequence &orig, DirManager *projDirManager)
mBlock = new BlockArray(); mBlock = new BlockArray();
Paste(0, &orig); wxASSERT(Paste(0, &orig));
} }
Sequence::~Sequence() Sequence::~Sequence()
@ -533,6 +533,7 @@ bool Sequence::Paste(sampleCount s, const Sequence *src)
insertBlock->f = mDirManager->CopyBlockFile(srcBlock->Item(i)->f); insertBlock->f = mDirManager->CopyBlockFile(srcBlock->Item(i)->f);
if (!insertBlock->f) { if (!insertBlock->f) {
// TODO error: Could not paste! (Out of disk space?) // TODO error: Could not paste! (Out of disk space?)
wxASSERT(false);
return false; return false;
} }
@ -622,6 +623,7 @@ bool Sequence::InsertSilence(sampleCount s0, sampleCount len)
sTrack->mNumSamples = pos; sTrack->mNumSamples = pos;
bool bResult = Paste(s0, sTrack); bool bResult = Paste(s0, sTrack);
wxASSERT(bResult);
delete sTrack; delete sTrack;
@ -936,7 +938,7 @@ void Sequence::WriteXML(XMLWriter &xmlFile)
_("Sequence has block file with length %s > mMaxSamples %s.\nTruncating to mMaxSamples."), _("Sequence has block file with length %s > mMaxSamples %s.\nTruncating to mMaxSamples."),
Internat::ToString(((wxLongLong)(bb->f->GetLength())).ToDouble(), 0).c_str(), Internat::ToString(((wxLongLong)(bb->f->GetLength())).ToDouble(), 0).c_str(),
Internat::ToString(((wxLongLong)mMaxSamples).ToDouble(), 0).c_str()); Internat::ToString(((wxLongLong)mMaxSamples).ToDouble(), 0).c_str());
::wxMessageBox(sMsg, _("Warning Writing Sequence"), wxICON_EXCLAMATION | wxOK); ::wxMessageBox(sMsg, _("Warning - Length in Writing Sequence"), wxICON_EXCLAMATION | wxOK);
::wxLogWarning(sMsg); ::wxLogWarning(sMsg);
bb->f->SetLength(mMaxSamples); bb->f->SetLength(mMaxSamples);
} }

View File

@ -1086,7 +1086,7 @@ void TagsEditor::OnLoad(wxCommandEvent & event)
if (!reader.Parse(&mLocal, fn)) { if (!reader.Parse(&mLocal, fn)) {
// Inform user of load failure // Inform user of load failure
wxMessageBox(reader.GetErrorStr(), wxMessageBox(reader.GetErrorStr(),
_("Error loading metadata"), _("Error Loading Metadata"),
wxOK | wxCENTRE, wxOK | wxCENTRE,
this); this);
} }
@ -1170,7 +1170,7 @@ void TagsEditor::OnSave(wxCommandEvent & event)
wxMessageBox(wxString::Format( wxMessageBox(wxString::Format(
_("Couldn't write to file \"%s\": %s"), _("Couldn't write to file \"%s\": %s"),
fn.c_str(), pException->GetMessage().c_str()), fn.c_str(), pException->GetMessage().c_str()),
_("Error saving tags file"), wxICON_ERROR, this); _("Error Saving Tags File"), wxICON_ERROR, this);
delete pException; delete pException;
} }

View File

@ -244,6 +244,7 @@ bool Track::SyncLockAdjust(double oldT1, double newT1)
if (!ret) return false; if (!ret) return false;
ret = Paste(newT1, tmp); ret = Paste(newT1, tmp);
wxASSERT(ret);
delete tmp; delete tmp;
return ret; return ret;

View File

@ -4885,7 +4885,7 @@ bool TrackPanel::HandleTrackLocationMouseEvent(WaveTrack * track, wxRect &r, wxM
{ {
WaveTrack* linked = (WaveTrack*)mTracks->GetLink(track); WaveTrack* linked = (WaveTrack*)mTracks->GetLink(track);
if (linked) if (linked)
linked->ExpandCutLine(mCapturedTrackLocation.pos); wxASSERT(linked->ExpandCutLine(mCapturedTrackLocation.pos));
mViewInfo->sel0 = cutlineStart; mViewInfo->sel0 = cutlineStart;
mViewInfo->sel1 = cutlineEnd; mViewInfo->sel1 = cutlineEnd;
DisplaySelection(); DisplaySelection();
@ -4894,10 +4894,10 @@ bool TrackPanel::HandleTrackLocationMouseEvent(WaveTrack * track, wxRect &r, wxM
} }
} else if (mCapturedTrackLocation.typ == WaveTrack::locationMergePoint) } else if (mCapturedTrackLocation.typ == WaveTrack::locationMergePoint)
{ {
track->MergeClips(mCapturedTrackLocation.clipidx1, mCapturedTrackLocation.clipidx2); wxASSERT(track->MergeClips(mCapturedTrackLocation.clipidx1, mCapturedTrackLocation.clipidx2));
WaveTrack* linked = (WaveTrack*)mTracks->GetLink(track); WaveTrack* linked = (WaveTrack*)mTracks->GetLink(track);
if (linked) if (linked)
linked->MergeClips(mCapturedTrackLocation.clipidx1, mCapturedTrackLocation.clipidx2); wxASSERT(linked->MergeClips(mCapturedTrackLocation.clipidx1, mCapturedTrackLocation.clipidx2));
MakeParentPushState(_("Merged Clips"),_("Merge"), PUSH_CONSOLIDATE|PUSH_CALC_SPACE); MakeParentPushState(_("Merged Clips"),_("Merge"), PUSH_CONSOLIDATE|PUSH_CALC_SPACE);
handled = true; handled = true;
} }
@ -7090,13 +7090,14 @@ void TrackPanel::OnFormatChange(wxCommandEvent & event)
break; break;
default: default:
// ERROR -- should not happen // ERROR -- should not happen
wxASSERT(false);
break; break;
} }
((WaveTrack *) mPopupMenuTarget)->ConvertToSampleFormat(newFormat); wxASSERT(((WaveTrack*)mPopupMenuTarget)->ConvertToSampleFormat(newFormat));
Track *partner = mTracks->GetLink(mPopupMenuTarget); Track *partner = mTracks->GetLink(mPopupMenuTarget);
if (partner) if (partner)
((WaveTrack *) partner)->ConvertToSampleFormat(newFormat); wxASSERT(((WaveTrack *) partner)->ConvertToSampleFormat(newFormat));
MakeParentPushState(wxString::Format(_("Changed '%s' to %s"), MakeParentPushState(wxString::Format(_("Changed '%s' to %s"),
mPopupMenuTarget->GetName(). mPopupMenuTarget->GetName().
@ -7577,6 +7578,7 @@ bool TrackPanel::MoveClipToTrack(WaveClip *clip, WaveTrack* dst)
#ifdef USE_MIDI #ifdef USE_MIDI
// dst could be a note track. Can't move clip to a note track. // dst could be a note track. Can't move clip to a note track.
// EXPLAIN: How could dst be a note track (pointer)? It's declared to be a WaveTrack*. I think this test is pointless.
if (dst->GetKind() != Track::Wave) return false; if (dst->GetKind() != Track::Wave) return false;
#endif #endif

View File

@ -576,7 +576,7 @@ bool WaveTrack::ClearAndPaste(double t0, // Start of time to clear
// falls within it and this isn't the first clip in the track. // falls within it and this isn't the first clip in the track.
if (fabs(t1 - clip->GetStartTime()) < WAVETRACK_MERGE_POINT_TOLERANCE) { if (fabs(t1 - clip->GetStartTime()) < WAVETRACK_MERGE_POINT_TOLERANCE) {
if (i > 0) { if (i > 0) {
MergeClips(GetClipIndex(clips[i - 1]), GetClipIndex(clip)); wxASSERT(MergeClips(GetClipIndex(clips[i - 1]), GetClipIndex(clip)));
} }
break; break;
} }
@ -594,7 +594,7 @@ bool WaveTrack::ClearAndPaste(double t0, // Start of time to clear
// falls within it and this isn't the last clip in the track. // falls within it and this isn't the last clip in the track.
if (fabs(t0 - clip->GetEndTime()) < WAVETRACK_MERGE_POINT_TOLERANCE) { if (fabs(t0 - clip->GetEndTime()) < WAVETRACK_MERGE_POINT_TOLERANCE) {
if (i < clips.GetCount() - 1) { if (i < clips.GetCount() - 1) {
MergeClips(GetClipIndex(clip), GetClipIndex(clips[i + 1])); wxASSERT(MergeClips(GetClipIndex(clip), GetClipIndex(clips[i + 1])));
} }
break; break;
} }
@ -638,8 +638,7 @@ bool WaveTrack::ClearAndPaste(double t0, // Start of time to clear
} }
// If we created a default time warper, we need to delete it // If we created a default time warper, we need to delete it
if (effectWarper == NULL) delete warper;
delete warper;
return true; return true;
} }
@ -814,6 +813,7 @@ bool WaveTrack::SyncLockAdjust(double oldT1, double newT1)
if (!ret) return false; if (!ret) return false;
ret = Paste(newT1, tmp); ret = Paste(newT1, tmp);
wxASSERT(ret);
delete tmp; delete tmp;
} }
@ -828,9 +828,9 @@ bool WaveTrack::SyncLockAdjust(double oldT1, double newT1)
if (!f) return false; if (!f) return false;
WaveTrack *tmp = f->NewWaveTrack(GetSampleFormat(), GetRate()); WaveTrack *tmp = f->NewWaveTrack(GetSampleFormat(), GetRate());
tmp->InsertSilence(0.0, newT1 - oldT1); wxASSERT(tmp->InsertSilence(0.0, newT1 - oldT1));
tmp->Flush(); tmp->Flush();
Paste(oldT1, tmp); wxASSERT(Paste(oldT1, tmp));
delete tmp; delete tmp;
} }
} }
@ -846,18 +846,13 @@ bool WaveTrack::Paste(double t0, Track *src)
{ {
bool editClipCanMove = true; bool editClipCanMove = true;
gPrefs->Read(wxT("/GUI/EditClipCanMove"), &editClipCanMove); gPrefs->Read(wxT("/GUI/EditClipCanMove"), &editClipCanMove);
//printf("paste: entering WaveTrack::Paste\n");
// JKC Added...
if( src == NULL ) if( src == NULL )
return false; return false;
if (src->GetKind() != Track::Wave) if (src->GetKind() != Track::Wave)
return false; return false;
//printf("paste: we have a wave track\n");
WaveTrack* other = (WaveTrack*)src; WaveTrack* other = (WaveTrack*)src;
// //
@ -902,7 +897,7 @@ bool WaveTrack::Paste(double t0, Track *src)
if (!IsEmpty(t0, GetEndTime())) { if (!IsEmpty(t0, GetEndTime())) {
Track *tmp = NULL; Track *tmp = NULL;
Cut(t0, GetEndTime()+1.0/mRate, &tmp); Cut(t0, GetEndTime()+1.0/mRate, &tmp);
Paste(t0 + insertDuration, tmp); wxASSERT(Paste(t0 + insertDuration, tmp));
delete tmp; delete tmp;
} }
} else } else
@ -1206,12 +1201,12 @@ bool WaveTrack::Join(double t0, double t1)
if (clip->GetOffset() - t > (1.0 / mRate)) { if (clip->GetOffset() - t > (1.0 / mRate)) {
double addedSilence = (clip->GetOffset() - t); double addedSilence = (clip->GetOffset() - t);
//printf("Adding %.6f seconds of silence\n"); //printf("Adding %.6f seconds of silence\n");
newClip->InsertSilence(t, addedSilence); wxASSERT(newClip->InsertSilence(t, addedSilence));
t += addedSilence; t += addedSilence;
} }
//printf("Pasting at %.6f\n", t); //printf("Pasting at %.6f\n", t);
newClip->Paste(t, clip); wxASSERT(newClip->Paste(t, clip));
t = newClip->GetEndTime(); t = newClip->GetEndTime();
mClips.DeleteObject(clip); mClips.DeleteObject(clip);
@ -2114,6 +2109,7 @@ bool WaveTrack::MergeClips(int clipidx1, int clipidx2)
WaveClip* clip1 = GetClipByIndex(clipidx1); WaveClip* clip1 = GetClipByIndex(clipidx1);
WaveClip* clip2 = GetClipByIndex(clipidx2); WaveClip* clip2 = GetClipByIndex(clipidx2);
wxASSERT(clip2);
if(clip2 == NULL) // could happen if one track of a linked pair had a split and the other didn't if(clip2 == NULL) // could happen if one track of a linked pair had a split and the other didn't
return false; return false;

View File

@ -264,11 +264,10 @@ bool EffectChangeSpeed::ProcessOne(WaveTrack * track,
// Take the output track and insert it in place of the original // Take the output track and insert it in place of the original
// sample data // sample data
double newLength = outputTrack->GetEndTime(); double newLength = outputTrack->GetEndTime();
if (bLoopSuccess) { if (bLoopSuccess)
SetTimeWarper(new LinearTimeWarper( {
mCurT0, mCurT0, mCurT1, mCurT0 + newLength )); SetTimeWarper(new LinearTimeWarper(mCurT0, mCurT0, mCurT1, mCurT0 + newLength));
track->ClearAndPaste(mCurT0, mCurT1, outputTrack, true, false, wxASSERT(track->ClearAndPaste(mCurT0, mCurT1, outputTrack, true, false, GetTimeWarper()));
GetTimeWarper());
} }
if (newLength > mMaxNewLength) if (newLength > mMaxNewLength)

View File

@ -189,7 +189,7 @@ void Effect::GetSamples(WaveTrack *track, sampleCount *start, sampleCount *len)
t1 = t0 + mLength; t1 = t0 + mLength;
if (mT0 == mT1) { if (mT0 == mT1) {
// Not really part of the calculation, but convenient to put here // Not really part of the calculation, but convenient to put here
track->InsertSilence(t0, t1); wxASSERT(track->InsertSilence(t0, t1));
} }
} }

View File

@ -531,7 +531,7 @@ bool EffectEqualization::ProcessOne(int count, WaveTrack * t,
if(toClipOutput) if(toClipOutput)
{ {
//put the processed audio in //put the processed audio in
t->Paste(clipStartEndTimes[i].first,toClipOutput); wxASSERT(t->Paste(clipStartEndTimes[i].first,toClipOutput));
//if the clip was only partially selected, the Paste will have created a split line. Join is needed to take care of this //if the clip was only partially selected, the Paste will have created a split line. Join is needed to take care of this
//This is not true when the selection is fully contained within one clip (second half of conditional) //This is not true when the selection is fully contained within one clip (second half of conditional)
if( (clipRealStartEndTimes[i].first != clipStartEndTimes[i].first || if( (clipRealStartEndTimes[i].first != clipStartEndTimes[i].first ||
@ -1020,7 +1020,7 @@ void EqualizationDialog::LoadCurves(wxString fileName, bool append)
{ {
// Inform user of load failure // Inform user of load failure
wxMessageBox( reader.GetErrorStr(), wxMessageBox( reader.GetErrorStr(),
_("Error loading EQ curve"), _("ErrorLoading EQ Curve"),
wxOK | wxCENTRE, wxOK | wxCENTRE,
this ); this );
} }
@ -1085,7 +1085,7 @@ void EqualizationDialog::SaveCurves(wxString fileName)
wxMessageBox(wxString::Format( wxMessageBox(wxString::Format(
_("Couldn't write to file \"%s\": %s"), _("Couldn't write to file \"%s\": %s"),
fn.GetFullPath().c_str(), pException->GetMessage().c_str()), fn.GetFullPath().c_str(), pException->GetMessage().c_str()),
_("Error saving equalization curves"), wxICON_ERROR, this); _("Error Saving Equalization Curves"), wxICON_ERROR, this);
delete pException; delete pException;
} }

View File

@ -708,7 +708,7 @@ bool EffectNoiseRemoval::ProcessOne(int count, WaveTrack * track,
double tLen = mOutputTrack->LongSamplesToTime(len); double tLen = mOutputTrack->LongSamplesToTime(len);
// Filtering effects always end up with more data than they started with. Delete this 'tail'. // Filtering effects always end up with more data than they started with. Delete this 'tail'.
mOutputTrack->HandleClear(tLen, mOutputTrack->GetEndTime(), false, false); mOutputTrack->HandleClear(tLen, mOutputTrack->GetEndTime(), false, false);
track->ClearAndPaste(t0, t0 + tLen, mOutputTrack, true, false); wxASSERT(track->ClearAndPaste(t0, t0 + tLen, mOutputTrack, true, false));
} }
// Delete the outputTrack now that its data is inserted in place // Delete the outputTrack now that its data is inserted in place

View File

@ -363,13 +363,14 @@ bool EffectSBSMS::Process()
if(rightTrack) if(rightTrack)
rb.outputRightTrack->Flush(); rb.outputRightTrack->Flush();
leftTrack->ClearAndPaste(mCurT0, mCurT1, rb.outputLeftTrack, wxASSERT(leftTrack->ClearAndPaste(
true, false, GetTimeWarper()); mCurT0, mCurT1, rb.outputLeftTrack,
true, false, GetTimeWarper()));
if(rightTrack) { if(rightTrack)
rightTrack->ClearAndPaste(mCurT0, mCurT1, rb.outputRightTrack, wxASSERT(rightTrack->ClearAndPaste(
true, false, GetTimeWarper()); mCurT0, mCurT1, rb.outputRightTrack,
} true, false, GetTimeWarper()));
} }
mCurTrackNum++; mCurTrackNum++;
} }

View File

@ -56,17 +56,7 @@ bool EffectSilence::GenerateTrack(WaveTrack *tmp,
const WaveTrack &track, const WaveTrack &track,
int ntrack) int ntrack)
{ {
tmp->InsertSilence(0.0, mDuration); const bool bResult = tmp->InsertSilence(0.0, mDuration);
return true; wxASSERT(bResult);
return bResult;
} }
// Indentation settings for Vim and Emacs and unique identifier for Arch, a
// version control system. Please do not modify past this point.
//
// Local Variables:
// c-basic-offset: 3
// indent-tabs-mode: nil
// End:
//
// vim: et sts=3 sw=3
// arch-tag: 78c8d521-815a-4fdb-830a-f9655cd4f529

View File

@ -96,7 +96,7 @@ bool EffectStereoToMono::ProcessOne(int count)
double minStart = wxMin(mLeftTrack->GetStartTime(), mRightTrack->GetStartTime()); double minStart = wxMin(mLeftTrack->GetStartTime(), mRightTrack->GetStartTime());
mLeftTrack->Clear(mLeftTrack->GetStartTime(), mLeftTrack->GetEndTime()); mLeftTrack->Clear(mLeftTrack->GetStartTime(), mLeftTrack->GetEndTime());
mOutTrack->Flush(); mOutTrack->Flush();
mLeftTrack->Paste(minStart, mOutTrack); wxASSERT(mLeftTrack->Paste(minStart, mOutTrack));
mLeftTrack->SetLinked(false); mLeftTrack->SetLinked(false);
mRightTrack->SetLinked(false); mRightTrack->SetLinked(false);
mLeftTrack->SetChannel(Track::MonoChannel); mLeftTrack->SetChannel(Track::MonoChannel);

View File

@ -610,7 +610,7 @@ void VSTEffectDialog::OnLoad(wxCommandEvent & evt)
if (!reader.Parse(this, fn)) { if (!reader.Parse(this, fn)) {
// Inform user of load failure // Inform user of load failure
wxMessageBox(reader.GetErrorStr(), wxMessageBox(reader.GetErrorStr(),
_("Error loading program"), _("Error Loading VST Program"),
wxOK | wxCENTRE, wxOK | wxCENTRE,
this); this);
} }

View File

@ -284,7 +284,7 @@ void KeyConfigPrefs::OnLoad(wxCommandEvent & e)
XMLFileReader reader; XMLFileReader reader;
if (!reader.Parse(mManager, file)) { if (!reader.Parse(mManager, file)) {
wxMessageBox(reader.GetErrorStr(), wxMessageBox(reader.GetErrorStr(),
_("Error loading keyboard shortcuts"), _("Error Loading Keyboard Shortcuts"),
wxOK | wxCENTRE, this); wxOK | wxCENTRE, this);
} }
@ -323,7 +323,7 @@ void KeyConfigPrefs::OnSave(wxCommandEvent & e)
catch (XMLFileWriterException* pException) catch (XMLFileWriterException* pException)
{ {
wxMessageBox(_("Couldn't write to file: ") + file, wxMessageBox(_("Couldn't write to file: ") + file,
_("Error saving keyboard shortcuts"), _("Error Saving Keyboard Shortcuts"),
wxOK | wxCENTRE, this); wxOK | wxCENTRE, this);
delete pException; delete pException;

View File

@ -856,7 +856,7 @@ void ControlToolBar::OnRecord(wxCommandEvent &evt)
newTrack->InsertSilence(0.0, t0 - t1); newTrack->InsertSilence(0.0, t0 - t1);
newTrack->Flush(); newTrack->Flush();
wt->Clear(t1, t0); wt->Clear(t1, t0);
wt->Paste(t1, newTrack); wxASSERT(wt->Paste(t1, newTrack));
delete newTrack; delete newTrack;
} }
newRecordingTracks.Add(wt); newRecordingTracks.Add(wt);

View File

@ -326,7 +326,7 @@ XMLFileWriter::~XMLFileWriter()
void XMLFileWriter::Open(const wxString &name, const wxString &mode) void XMLFileWriter::Open(const wxString &name, const wxString &mode)
{ {
if (!wxFFile::Open(name, mode)) if (!wxFFile::Open(name, mode))
throw new XMLFileWriterException(_("Error opening file")); throw new XMLFileWriterException(_("Error Opening File"));
} }
void XMLFileWriter::Close() void XMLFileWriter::Close()
@ -345,12 +345,12 @@ void XMLFileWriter::CloseWithoutEndingTags()
if (!wxFFile::Flush()) if (!wxFFile::Flush())
{ {
wxFFile::Close(); wxFFile::Close();
throw new XMLFileWriterException(_("Error flushing file")); throw new XMLFileWriterException(_("Error Flushing File"));
} }
// Note that this should never fail if flushing worked. // Note that this should never fail if flushing worked.
if (!wxFFile::Close()) if (!wxFFile::Close())
throw new XMLFileWriterException(_("Error closing file")); throw new XMLFileWriterException(_("Error Closing File"));
} }
void XMLFileWriter::Write(const wxString &data) void XMLFileWriter::Write(const wxString &data)
@ -360,7 +360,7 @@ void XMLFileWriter::Write(const wxString &data)
// When writing fails, we try to close the file before throwing the // When writing fails, we try to close the file before throwing the
// exception, so it can at least be deleted. // exception, so it can at least be deleted.
wxFFile::Close(); wxFFile::Close();
throw new XMLFileWriterException(_("Error writing to file")); throw new XMLFileWriterException(_("Error Writing to File"));
} }
} }