Mercurial > hg > svcore
comparison data/fileio/FileFinder.cpp @ 301:73537d900d4b
* Add MIDI file export (closes FR#1643721)
author | Chris Cannam |
---|---|
date | Thu, 04 Oct 2007 11:52:38 +0000 |
parents | 92e8dbde73cd |
children | 726b32522e3f |
comparison
equal
deleted
inserted
replaced
300:5877d68815c7 | 301:73537d900d4b |
---|---|
72 break; | 72 break; |
73 | 73 |
74 case LayerFile: | 74 case LayerFile: |
75 settingsKey = "layerpath"; | 75 settingsKey = "layerpath"; |
76 filter = tr("All supported files (%1)\nSonic Visualiser Layer XML files (*.svl)\nComma-separated data files (*.csv)\nSpace-separated .lab files (*.lab)\nMIDI files (*.mid)\nText files (*.txt)\nAll files (*.*)").arg(DataFileReaderFactory::getKnownExtensions()); | 76 filter = tr("All supported files (%1)\nSonic Visualiser Layer XML files (*.svl)\nComma-separated data files (*.csv)\nSpace-separated .lab files (*.lab)\nMIDI files (*.mid)\nText files (*.txt)\nAll files (*.*)").arg(DataFileReaderFactory::getKnownExtensions()); |
77 break; | |
78 | |
79 case LayerFileNoMidi: | |
80 settingsKey = "layerpath"; | |
81 filter = tr("All supported files (%1)\nSonic Visualiser Layer XML files (*.svl)\nComma-separated data files (*.csv)\nSpace-separated .lab files (*.lab)\nText files (*.txt)\nAll files (*.*)").arg(DataFileReaderFactory::getKnownExtensions()); | |
77 break; | 82 break; |
78 | 83 |
79 case SessionOrAudioFile: | 84 case SessionOrAudioFile: |
80 settingsKey = "lastpath"; | 85 settingsKey = "lastpath"; |
81 filter = tr("All supported files (*.sv %1)\nSonic Visualiser session files (*.sv)\nAudio files (%1)\nAll files (*.*)") | 86 filter = tr("All supported files (*.sv %1)\nSonic Visualiser session files (*.sv)\nAudio files (%1)\nAll files (*.*)") |
190 title = tr("Select a file to export to"); | 195 title = tr("Select a file to export to"); |
191 filter = tr("WAV audio files (*.wav)\nAll files (*.*)"); | 196 filter = tr("WAV audio files (*.wav)\nAll files (*.*)"); |
192 break; | 197 break; |
193 | 198 |
194 case LayerFile: | 199 case LayerFile: |
200 settingsKey = "savelayerpath"; | |
201 title = tr("Select a file to export to"); | |
202 filter = tr("Sonic Visualiser Layer XML files (*.svl)\nComma-separated data files (*.csv)\nMIDI files (*.mid)\nText files (*.txt)\nAll files (*.*)"); | |
203 break; | |
204 | |
205 case LayerFileNoMidi: | |
195 settingsKey = "savelayerpath"; | 206 settingsKey = "savelayerpath"; |
196 title = tr("Select a file to export to"); | 207 title = tr("Select a file to export to"); |
197 filter = tr("Sonic Visualiser Layer XML files (*.svl)\nComma-separated data files (*.csv)\nText files (*.txt)\nAll files (*.*)"); | 208 filter = tr("Sonic Visualiser Layer XML files (*.svl)\nComma-separated data files (*.csv)\nText files (*.txt)\nAll files (*.*)"); |
198 break; | 209 break; |
199 | 210 |
269 expectedExtension = "svl"; | 280 expectedExtension = "svl"; |
270 } else if (selectedFilter.contains(".txt")) { | 281 } else if (selectedFilter.contains(".txt")) { |
271 expectedExtension = "txt"; | 282 expectedExtension = "txt"; |
272 } else if (selectedFilter.contains(".csv")) { | 283 } else if (selectedFilter.contains(".csv")) { |
273 expectedExtension = "csv"; | 284 expectedExtension = "csv"; |
285 } else if (selectedFilter.contains(".mid")) { | |
286 expectedExtension = "mid"; | |
274 } | 287 } |
275 if (expectedExtension != "") { | 288 if (expectedExtension != "") { |
276 path = QString("%1.%2").arg(path).arg(expectedExtension); | 289 path = QString("%1.%2").arg(path).arg(expectedExtension); |
277 fi = QFileInfo(path); | 290 fi = QFileInfo(path); |
278 } | 291 } |
317 case AudioFile: | 330 case AudioFile: |
318 settingsKey = "audiopath"; | 331 settingsKey = "audiopath"; |
319 break; | 332 break; |
320 | 333 |
321 case LayerFile: | 334 case LayerFile: |
335 settingsKey = "layerpath"; | |
336 break; | |
337 | |
338 case LayerFileNoMidi: | |
322 settingsKey = "layerpath"; | 339 settingsKey = "layerpath"; |
323 break; | 340 break; |
324 | 341 |
325 case SessionOrAudioFile: | 342 case SessionOrAudioFile: |
326 settingsKey = "lastpath"; | 343 settingsKey = "lastpath"; |