diff 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
line wrap: on
line diff
--- a/data/fileio/FileFinder.cpp	Mon Oct 01 13:48:38 2007 +0000
+++ b/data/fileio/FileFinder.cpp	Thu Oct 04 11:52:38 2007 +0000
@@ -76,6 +76,11 @@
         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());
         break;
 
+    case LayerFileNoMidi:
+        settingsKey = "layerpath";
+        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());
+        break;
+
     case SessionOrAudioFile:
         settingsKey = "lastpath";
         filter = tr("All supported files (*.sv %1)\nSonic Visualiser session files (*.sv)\nAudio files (%1)\nAll files (*.*)")
@@ -194,6 +199,12 @@
     case LayerFile:
         settingsKey = "savelayerpath";
         title = tr("Select a file to export to");
+        filter = tr("Sonic Visualiser Layer XML files (*.svl)\nComma-separated data files (*.csv)\nMIDI files (*.mid)\nText files (*.txt)\nAll files (*.*)");
+        break;
+
+    case LayerFileNoMidi:
+        settingsKey = "savelayerpath";
+        title = tr("Select a file to export to");
         filter = tr("Sonic Visualiser Layer XML files (*.svl)\nComma-separated data files (*.csv)\nText files (*.txt)\nAll files (*.*)");
         break;
 
@@ -271,6 +282,8 @@
                 expectedExtension = "txt";
             } else if (selectedFilter.contains(".csv")) {
                 expectedExtension = "csv";
+            } else if (selectedFilter.contains(".mid")) {
+                expectedExtension = "mid";
             }
             if (expectedExtension != "") {
                 path = QString("%1.%2").arg(path).arg(expectedExtension);
@@ -322,6 +335,10 @@
         settingsKey = "layerpath";
         break;
 
+    case LayerFileNoMidi:
+        settingsKey = "layerpath";
+        break;
+
     case SessionOrAudioFile:
         settingsKey = "lastpath";
         break;