128
134
if (numTracks > 0) {
131
136
return numTracks;
137
importPluginNode = importPluginNode->GetNext();
140
// no importPlugin that recognized the extension succeeded. However, the
141
// file might be misnamed. So this time we try all the importPlugins
142
//in order and see if any of them can handle the file
143
importPluginNode = mImportPluginList->GetFirst();
144
while(importPluginNode)
146
ImportPlugin *plugin = importPluginNode->GetData();
148
mInFile = plugin->Open(fName);
149
if( mInFile != NULL )
151
mInFile->SetProgressCallback(progressCallback, userData);
153
if(mInFile->Import(trackFactory, tracks, &numTracks))
163
// This will happen if the user cancelled, or if we
164
// tried and got an error partially through. Either way,
165
// no need to try any other formats at this point!
169
141
importPluginNode = importPluginNode->GetNext();
192
164
// if someone has sent us a .cda file, send them away
193
165
if (extension.IsSameAs(wxT("cda"), false)) {
194
errorMessage = wxT("\"") + fName + wxT("\"") +
195
_(" is an audio CD file. \nAudacity does not open this type of file.\nTry ripping it to a native audio format that Audacity can import.");
166
/* i18n-hint: %s will be the filename */
167
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());
199
171
// playlist type files
200
172
if ((extension.IsSameAs(wxT("m3u"), false))||(extension.IsSameAs(wxT("ram"), false))||(extension.IsSameAs(wxT("pls"), false))) {
201
errorMessage = wxT("\"") + fName + wxT("\"") +
202
_(" 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.");
173
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());
205
176
//WMA files of various forms
206
177
if ((extension.IsSameAs(wxT("wmv"), false))||(extension.IsSameAs(wxT("wma"), false))||(extension.IsSameAs(wxT("asf"), false))) {
207
errorMessage = wxT("\"") + fName + wxT("\"") +
208
_(" is a Windows Media Audio file. \nAudacity cannot open this type of file to due to patent restrictions.\nYou need to convert it to a supported audio format.");
178
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());
211
181
//AAC files of various forms (probably not encrypted)
212
182
if ((extension.IsSameAs(wxT("aac"), false))||(extension.IsSameAs(wxT("m4a"), false))||(extension.IsSameAs(wxT("mpa"), false))||(extension.IsSameAs(wxT("mp4"), false))) {
213
errorMessage = wxT("\"") + fName + wxT("\"") +
214
_(" is an Advanced Audio Coding file. \nAudacity cannot open this type of file.\nYou need to convert it to a supported audio format.");
183
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());
217
186
// encrypted itunes files
218
187
if ((extension.IsSameAs(wxT("m4p"), false))) {
219
errorMessage = wxT("\"") + fName + wxT("\"") +
220
_(" is an encrypted audio file, typically from an online music store. \nAudacity cannot open this type of file due to the encryption.\nYou need to convert it to a supported, unencrypted audio format.");
188
errorMessage.Printf(_("\"%s\" is an encrypted audio file. These 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());
223
191
// Real files of various sorts
224
192
if ((extension.IsSameAs(wxT("ra"), false))||(extension.IsSameAs(wxT("rm"), false))||(extension.IsSameAs(wxT("rpm"), false))||(extension.IsSameAs(wxT("rv"), false))) {
225
errorMessage = wxT("\"") + fName + wxT("\"") +
226
_(" is a RealPlayer media file. \nAudacity cannot open this proprietary format.\nYou need to convert it to a supported audio format.");
193
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());
198
// no importPlugin that recognized the extension succeeded. However, the
199
// file might be misnamed. So this time we try all the importPlugins
200
//in order and see if any of them can handle the file
201
importPluginNode = mImportPluginList->GetFirst();
202
while(importPluginNode)
204
ImportPlugin *plugin = importPluginNode->GetData();
206
mInFile = plugin->Open(fName);
207
if( mInFile != NULL )
209
mInFile->SetProgressCallback(progressCallback, userData);
211
if(mInFile->Import(trackFactory, tracks, &numTracks, tags))
216
errorMessage = _( "Audacity had to make a guess at the type of file.\nThe Audio may be bogus.\n\nIf the audio is bogus, try renaming the file\nso that it has the correct extension before opening it.");
222
// This will happen if the user cancelled, or if we
223
// tried and got an error partially through. Either way,
224
// no need to try any other formats at this point!
228
importPluginNode = importPluginNode->GetNext();
230
231
// we were not able to recognize the file type
231
232
errorMessage = _("Audacity did not recognize the type of this file.\nIf it is uncompressed, try importing it using \"Import Raw\"" );