mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-10 16:43:33 +02:00
Never permit import of MIDI as audio...
... It was seen to happen, at least for some MIDI files on Windows, because the FFmpeg library may render them without reporting an error, but the rendering was really bad!
This commit is contained in:
@@ -340,6 +340,15 @@ bool Importer::Import(const wxString &fName,
|
||||
|
||||
wxString extension = fName.AfterLast(wxT('.'));
|
||||
|
||||
// Always refuse to import MIDI, even though the FFmpeg plugin pretends to know how (but makes very bad renderings)
|
||||
#ifdef USE_MIDI
|
||||
// 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());
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
using ImportPluginPtrs = std::vector< ImportPlugin* >;
|
||||
|
||||
// This list is used to call plugins in correct order
|
||||
@@ -562,14 +571,6 @@ bool Importer::Import(const wxString &fName,
|
||||
|
||||
/* warnings for unsupported data types */
|
||||
|
||||
#ifdef USE_MIDI
|
||||
// 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());
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (compatiblePlugins.empty())
|
||||
{
|
||||
// if someone has sent us a .cda file, send them away
|
||||
|
Reference in New Issue
Block a user