changeset 250:40db5491bcf8 sv1-1.0pre2 sv1-1.0pre3

* Add basics of an Export Image File function
author Chris Cannam
date Mon, 12 Mar 2007 15:36:31 +0000
parents d3ac9f953ebf
children db0dd744fa8d
files data/fileio/FileFinder.cpp data/fileio/FileFinder.h
diffstat 2 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/data/fileio/FileFinder.cpp	Thu Mar 08 16:53:08 2007 +0000
+++ b/data/fileio/FileFinder.cpp	Mon Mar 12 15:36:31 2007 +0000
@@ -82,6 +82,11 @@
             .arg(AudioFileReaderFactory::getKnownExtensions());
         break;
 
+    case ImageFile:
+        settingsKey = "imagepath";
+        filter = tr("Portable Network Graphics files (*.png)\nAll files (*.*)");
+        break;
+
     case AnyFile:
         settingsKey = "lastpath";
         filter = tr("All supported files (*.sv %1 %2)\nSonic Visualiser session files (*.sv)\nAudio files (%1)\nLayer files (%2)\nAll files (*.*)")
@@ -196,6 +201,12 @@
         std::cerr << "ERROR: Internal error: FileFinder::getSaveFileName: SessionOrAudioFile cannot be used here" << std::endl;
         abort();
 
+    case ImageFile:
+        settingsKey = "saveimagepath";
+        title = tr("Select a file to export to");
+        filter = tr("Portable Network Graphics files (*.png)\nAll files (*.*)");
+        break;
+
     case AnyFile:
         std::cerr << "ERROR: Internal error: FileFinder::getSaveFileName: AnyFile cannot be used here" << std::endl;
         abort();
@@ -233,6 +244,8 @@
         dialog.setDefaultSuffix("sv");
     } else if (type == AudioFile) {
         dialog.setDefaultSuffix("wav");
+    } else if (type == ImageFile) {
+        dialog.setDefaultSuffix("png");
     }
 
     bool good = false;
@@ -313,6 +326,10 @@
         settingsKey = "lastpath";
         break;
 
+    case ImageFile:
+        settingsKey = "imagepath";
+        break;
+
     case AnyFile:
         settingsKey = "lastpath";
         break;
--- a/data/fileio/FileFinder.h	Thu Mar 08 16:53:08 2007 +0000
+++ b/data/fileio/FileFinder.h	Mon Mar 12 15:36:31 2007 +0000
@@ -31,6 +31,7 @@
         AudioFile,
         LayerFile,
         SessionOrAudioFile,
+        ImageFile,
         AnyFile
     };