1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-15 23:59:37 +02:00

Fix autorecover to recover more than just 3 recording tracks

Also fix mac crash due to assertion where envelope len is zero after recovery.
This commit is contained in:
mchinen 2010-07-09 16:17:45 +00:00
parent cf3ba227f7
commit fb9e6e5f1a

View File

@ -282,7 +282,8 @@ bool RecordingRecoveryHandler::HandleXMLTag(const wxChar *tag,
return false;
}
WaveTrack* track = tracks.Item(index);
Sequence* seq = track->GetLastOrCreateClip()->GetSequence();
WaveClip* clip = track->GetLastOrCreateClip();
Sequence* seq = clip->GetSequence();
// Load the blockfile from the XML
BlockFile* blockFile = NULL;
@ -297,6 +298,7 @@ bool RecordingRecoveryHandler::HandleXMLTag(const wxChar *tag,
}
seq->AppendBlockFile(blockFile);
clip->UpdateEnvelopeTrackLen();
} else if (wxStrcmp(tag, wxT("recordingrecovery")) == 0)
{
@ -312,10 +314,11 @@ bool RecordingRecoveryHandler::HandleXMLTag(const wxChar *tag,
break;
const wxString strValue = value;
//this channels value does not correspond to WaveTrack::Left/Right/Mono, but which channel of the recording device
//it came from, and thus we can't use XMLValueChecker::IsValidChannel on it. Rather we compare to the next attribute value.
if (wxStrcmp(attr, wxT("channel")) == 0)
{
if (!XMLValueChecker::IsGoodInt(strValue) || !strValue.ToLong(&nValue) ||
!XMLValueChecker::IsValidChannel(nValue))
if (!XMLValueChecker::IsGoodInt(strValue) || !strValue.ToLong(&nValue) || nValue < 0)
return false;
mChannel = nValue;
}
@ -324,8 +327,11 @@ bool RecordingRecoveryHandler::HandleXMLTag(const wxChar *tag,
if (!XMLValueChecker::IsGoodInt(strValue) || !strValue.ToLong(&nValue) ||
(nValue < 1))
return false;
if(mChannel >= nValue )
return false;
mNumChannels = nValue;
}
}
}