mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-10 09:01:13 +02:00
John's fix missed many of the returns from Import::Import(), so it would have left the mbBusyImporting flag as true in all those cases, even though it was no longer true. This fixes those.
This commit is contained in:
parent
711a955ed6
commit
50c5760520
@ -514,6 +514,7 @@ int Importer::Import(wxString fName,
|
||||
if (ImportDlg.ShowModal() == wxID_CANCEL)
|
||||
{
|
||||
delete inFile;
|
||||
pProj->mbBusyImporting = false;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@ -531,16 +532,22 @@ int Importer::Import(wxString fName,
|
||||
{
|
||||
// LOF ("list-of-files") has different semantics
|
||||
if (extension.IsSameAs(wxT("lof"), false))
|
||||
{
|
||||
pProj->mbBusyImporting = false;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (numTracks > 0) {
|
||||
if (numTracks > 0)
|
||||
{
|
||||
// success!
|
||||
pProj->mbBusyImporting = false;
|
||||
return numTracks;
|
||||
}
|
||||
}
|
||||
|
||||
if (res == eProgressCancelled || res == eProgressFailed)
|
||||
{
|
||||
pProj->mbBusyImporting = false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -566,6 +573,7 @@ int Importer::Import(wxString fName,
|
||||
errorMessage.Printf(_("This version of Audacity was not compiled with %s support."),
|
||||
unusableImportPlugin->
|
||||
GetPluginFormatDescription().c_str());
|
||||
pProj->mbBusyImporting = false;
|
||||
return 0;
|
||||
}
|
||||
unusableImporterNode = unusableImporterNode->GetNext();
|
||||
@ -577,6 +585,7 @@ int Importer::Import(wxString fName,
|
||||
// MIDI files must be imported, not opened
|
||||
if ((extension.IsSameAs(wxT("midi"), false))||(extension.IsSameAs(wxT("mid"), false))) {
|
||||
errorMessage.Printf(_("\"%s\" \nis a MIDI file, not an audio file. \nAudacity cannot open this type of file for playing, but you can\nedit it by clicking File > Import > MIDI."), fName.c_str());
|
||||
pProj->mbBusyImporting = false;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
@ -587,68 +596,80 @@ int Importer::Import(wxString fName,
|
||||
if (extension.IsSameAs(wxT("cda"), false)) {
|
||||
/* i18n-hint: %s will be the filename */
|
||||
errorMessage.Printf(_("\"%s\" is an audio CD track. \nAudacity cannot open audio CDs directly. \nExtract (rip) the CD tracks to an audio format that \nAudacity can import, such as WAV or AIFF."), fName.c_str());
|
||||
pProj->mbBusyImporting = false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// playlist type files
|
||||
if ((extension.IsSameAs(wxT("m3u"), false))||(extension.IsSameAs(wxT("ram"), false))||(extension.IsSameAs(wxT("pls"), false))) {
|
||||
errorMessage.Printf(_("\"%s\" is a playlist file. \nAudacity cannot open this file because it only contains links to other files. \nYou may be able to open it in a text editor and download the actual audio files."), fName.c_str());
|
||||
pProj->mbBusyImporting = false;
|
||||
return 0;
|
||||
}
|
||||
//WMA files of various forms
|
||||
if ((extension.IsSameAs(wxT("wma"), false))||(extension.IsSameAs(wxT("asf"), false))) {
|
||||
errorMessage.Printf(_("\"%s\" is a Windows Media Audio file. \nAudacity cannot open this type of file due to patent restrictions. \nYou need to convert it to a supported audio format, such as WAV or AIFF."), fName.c_str());
|
||||
pProj->mbBusyImporting = false;
|
||||
return 0;
|
||||
}
|
||||
//AAC files of various forms (probably not encrypted)
|
||||
if ((extension.IsSameAs(wxT("aac"), false))||(extension.IsSameAs(wxT("m4a"), false))||(extension.IsSameAs(wxT("m4r"), false))||(extension.IsSameAs(wxT("mp4"), false))) {
|
||||
errorMessage.Printf(_("\"%s\" is an Advanced Audio Coding file. \nAudacity cannot open this type of file. \nYou need to convert it to a supported audio format, such as WAV or AIFF."), fName.c_str());
|
||||
pProj->mbBusyImporting = false;
|
||||
return 0;
|
||||
}
|
||||
// encrypted itunes files
|
||||
if ((extension.IsSameAs(wxT("m4p"), false))) {
|
||||
errorMessage.Printf(_("\"%s\" is an encrypted audio file. \nThese typically are from an online music store. \nAudacity cannot open this type of file due to the encryption. \nTry recording the file into Audacity, or burn it to audio CD then \nextract the CD track to a supported audio format such as WAV or AIFF."), fName.c_str());
|
||||
pProj->mbBusyImporting = false;
|
||||
return 0;
|
||||
}
|
||||
// Real Inc. files of various sorts
|
||||
if ((extension.IsSameAs(wxT("ra"), false))||(extension.IsSameAs(wxT("rm"), false))||(extension.IsSameAs(wxT("rpm"), false))) {
|
||||
errorMessage.Printf(_("\"%s\" is a RealPlayer media file. \nAudacity cannot open this proprietary format. \nYou need to convert it to a supported audio format, such as WAV or AIFF."), fName.c_str());
|
||||
pProj->mbBusyImporting = false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Other notes-based formats
|
||||
if ((extension.IsSameAs(wxT("kar"), false))||(extension.IsSameAs(wxT("mod"), false))||(extension.IsSameAs(wxT("rmi"), false))) {
|
||||
errorMessage.Printf(_("\"%s\" is a notes-based file, not an audio file. \nAudacity cannot open this type of file. \nTry converting it to an audio file such as WAV or AIFF and \nthen import it, or record it into Audacity."), fName.c_str());
|
||||
pProj->mbBusyImporting = false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// MusePack files
|
||||
if ((extension.IsSameAs(wxT("mp+"), false))||(extension.IsSameAs(wxT("mpc"), false))||(extension.IsSameAs(wxT("mpp"), false))) {
|
||||
errorMessage.Printf(_("\"%s\" is a Musepack audio file. \nAudacity cannot open this type of file. \nIf you think it might be an mp3 file, rename it to end with \".mp3\" \nand try importing it again. Otherwise you need to convert it to a supported audio \nformat, such as WAV or AIFF."), fName.c_str());
|
||||
pProj->mbBusyImporting = false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// WavPack files
|
||||
if ((extension.IsSameAs(wxT("wv"), false))||(extension.IsSameAs(wxT("wvc"), false))) {
|
||||
errorMessage.Printf(_("\"%s\" is a Wavpack audio file. \nAudacity cannot open this type of file. \nYou need to convert it to a supported audio format, such as WAV or AIFF."), fName.c_str());
|
||||
pProj->mbBusyImporting = false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// AC3 files
|
||||
if ((extension.IsSameAs(wxT("ac3"), false))) {
|
||||
errorMessage.Printf(_("\"%s\" is a Dolby Digital audio file. \nAudacity cannot currently open this type of file. \nYou need to convert it to a supported audio format, such as WAV or AIFF."), fName.c_str());
|
||||
pProj->mbBusyImporting = false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Speex files
|
||||
if ((extension.IsSameAs(wxT("spx"), false))) {
|
||||
errorMessage.Printf(_("\"%s\" is an Ogg Speex audio file. \nAudacity cannot currently open this type of file. \nYou need to convert it to a supported audio format, such as WAV or AIFF."), fName.c_str());
|
||||
pProj->mbBusyImporting = false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Video files of various forms
|
||||
if ((extension.IsSameAs(wxT("mpg"), false))||(extension.IsSameAs(wxT("mpeg"), false))||(extension.IsSameAs(wxT("avi"), false))||(extension.IsSameAs(wxT("wmv"), false))||(extension.IsSameAs(wxT("rv"), false))) {
|
||||
errorMessage.Printf(_("\"%s\" is a video file. \nAudacity cannot currently open this type of file. \nYou need to extract the audio to a supported format, such as WAV or AIFF."), fName.c_str());
|
||||
pProj->mbBusyImporting = false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -675,7 +696,6 @@ int Importer::Import(wxString fName,
|
||||
}
|
||||
|
||||
pProj->mbBusyImporting = false;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user