mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-18 17:10:05 +02:00
(bug 451, P2) Improve specificity of one of the "Gap detected..." messages, so it includes blockfile name and extension if possible. Also changed some wxLogError calls to wxLogWarning, as the plan is to handle them rather than fail the load.
Also made the "...will not be loaded" messages in LoadModules.cpp consistently use wxLogError.
This commit is contained in:
parent
4d1e18d8fd
commit
5697e39ec0
@ -177,7 +177,7 @@ bool Module::Load()
|
|||||||
// Check version string matches. (For now, they must match exactly)
|
// Check version string matches. (For now, they must match exactly)
|
||||||
tVersionFn versionFn = (tVersionFn)(mLib->GetSymbol(wxT(versionFnName)));
|
tVersionFn versionFn = (tVersionFn)(mLib->GetSymbol(wxT(versionFnName)));
|
||||||
if (versionFn == NULL){
|
if (versionFn == NULL){
|
||||||
wxLogWarning(wxT("The module %s does not provide a version string. It will not be loaded."), mName.c_str());
|
wxLogError(wxT("The module %s does not provide a version string. It will not be loaded."), mName.c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -844,10 +844,10 @@ void Sequence::HandleXMLEndTag(const wxChar *tag)
|
|||||||
// This could be why the blockfile failed, so limit
|
// This could be why the blockfile failed, so limit
|
||||||
// the silent replacement to mMaxSamples.
|
// the silent replacement to mMaxSamples.
|
||||||
len = mMaxSamples;
|
len = mMaxSamples;
|
||||||
wxLogError(_(" Sequence has missing block file with length > mMaxSamples."));
|
wxLogWarning(_(" Sequence has missing block file with length > mMaxSamples."));
|
||||||
}
|
}
|
||||||
mBlock->Item(b)->f = new SilentBlockFile(len);
|
mBlock->Item(b)->f = new SilentBlockFile(len);
|
||||||
wxLogError(
|
wxLogWarning(
|
||||||
_("Gap detected in project file. Missing block file replaced with silence."));
|
_("Gap detected in project file. Missing block file replaced with silence."));
|
||||||
mErrorOpening = true;
|
mErrorOpening = true;
|
||||||
}
|
}
|
||||||
@ -858,14 +858,20 @@ void Sequence::HandleXMLEndTag(const wxChar *tag)
|
|||||||
for (b = 0; b < mBlock->Count(); b++) {
|
for (b = 0; b < mBlock->Count(); b++) {
|
||||||
if (mBlock->Item(b)->start != numSamples) {
|
if (mBlock->Item(b)->start != numSamples) {
|
||||||
mBlock->Item(b)->start = numSamples;
|
mBlock->Item(b)->start = numSamples;
|
||||||
wxLogError(_("Gap detected in project file.\n Block specification for block file started after end of previous block.\n Start has been moved back so blocks are contiguous."));
|
wxString sFileAndExtension = mBlock->Item(b)->f->GetFileName().GetFullName();
|
||||||
|
if (sFileAndExtension.IsEmpty())
|
||||||
|
sFileAndExtension = _("(replaced with silence)");
|
||||||
|
else
|
||||||
|
sFileAndExtension = wxT("\"") + sFileAndExtension + wxT("\"");
|
||||||
|
wxLogWarning(_("Gap detected in project file.\n Start for block file %s is more than one sample past end of previous block.\n Start has been moved back so blocks are contiguous."),
|
||||||
|
sFileAndExtension);
|
||||||
mErrorOpening = true;
|
mErrorOpening = true;
|
||||||
}
|
}
|
||||||
numSamples += mBlock->Item(b)->f->GetLength();
|
numSamples += mBlock->Item(b)->f->GetLength();
|
||||||
}
|
}
|
||||||
if (mNumSamples != numSamples) {
|
if (mNumSamples != numSamples) {
|
||||||
mNumSamples = numSamples;
|
mNumSamples = numSamples;
|
||||||
wxLogError(_("Gap detected in project file. Sequence sample count corrected."));
|
wxLogWarning(_("Gap detected in project file. Sequence sample count corrected."));
|
||||||
mErrorOpening = true;
|
mErrorOpening = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -959,7 +965,7 @@ bool Sequence::Read(samplePtr buffer, sampleFormat format,
|
|||||||
|
|
||||||
if (result != len)
|
if (result != len)
|
||||||
{
|
{
|
||||||
wxLogError(wxT("Expected to read %d samples, got %d samples."), len, result);
|
wxLogWarning(wxT("Expected to read %d samples, got %d samples."), len, result);
|
||||||
if (result < 0)
|
if (result < 0)
|
||||||
result = 0;
|
result = 0;
|
||||||
ClearSamples(buffer, format, result, len-result);
|
ClearSamples(buffer, format, result, len-result);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user