Update of /cvsroot/audacity/audacity-src/src/export
In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv8999

Modified Files:
        Export.cpp Export.h 
Log Message:
Fix mask creation and allow proper description translation

Index: Export.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/export/Export.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- Export.h    15 Apr 2007 02:23:36 -0000      1.10
+++ Export.h    18 Apr 2007 05:15:58 -0000      1.11
@@ -50,20 +50,20 @@
 
    ExportType();
 
-   void Set(ExportRoutine routine,
+   void Set(wxString description,
+            ExportRoutine routine,
             ExportOptions options,
             wxString extension,
             int maxchannels,
-            bool canmetadata = false,
-            wxString description = wxEmptyString);
-   
-   void Set(ExportRoutine routine,
+            bool canmetadata = false);
+
+   void Set(wxString description,
+            ExportRoutine routine,
             ExportOptions options,
             wxArrayString extensions,
             wxString extension,
             int maxchannels,
-            bool canmetadata = false,
-            wxString description = wxEmptyString);
+            bool canmetadata = false);
    
    ExportRoutine GetRoutine();
    ExportOptions GetOptions();

Index: Export.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/export/Export.cpp,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- Export.cpp  16 Apr 2007 07:31:55 -0000      1.51
+++ Export.cpp  18 Apr 2007 05:15:58 -0000      1.52
@@ -85,24 +85,31 @@
    mMaxChannels = 0;
 }
 
-void ExportType::Set(ExportRoutine routine,
+void ExportType::Set(wxString description,
+                     ExportRoutine routine,
                      ExportOptions options,
                      wxArrayString extensions,
                      wxString extension,
                      int maxchannels,
-                     bool canmetadata,
-                     wxString description)
+                     bool canmetadata)
 {
+   mRoutine = routine;
+   mOptions = options;
+   mFormat = extension.MakeUpper();
+   mExtension = extension.MakeLower();
+   mMaxChannels = maxchannels;
+   mCanMetaData = canmetadata;
+   mDescription = description;
+
    mExtensions = extensions;
-   Set(routine, options, extension, maxchannels, canmetadata);
 }
 
-void ExportType::Set(ExportRoutine routine,
+void ExportType::Set(wxString description,
+                     ExportRoutine routine,
                      ExportOptions options,
                      wxString extension,
                      int maxchannels,
-                     bool canmetadata,
-                     wxString description)
+                     bool canmetadata)
 {
    mRoutine = routine;
    mOptions = options;
@@ -112,9 +119,8 @@
    mCanMetaData = canmetadata;
    mDescription = description;
 
-   if (mExtensions.GetCount() == 0) {
-      mExtensions.Add(mExtension);
-   }
+   mExtensions.Clear();
+   mExtensions.Add(mExtension);
 }
 
 ExportRoutine ExportType::GetRoutine()
@@ -159,14 +165,7 @@
 
 wxString ExportType::GetMask()
 {
-   wxString mask;
-   
-   if (mDescription.IsEmpty()) {
-      mask = mFormat + wxT(" files|");
-   }
-   else {
-      mask = mDescription + wxT("|");
-   }
+   wxString mask = mDescription + wxT("|");
 
    // Build the mask, but cater to the Mac FileDialog and put the default
    // extension at the end of the mask.
@@ -240,30 +239,30 @@
    ExportTypeArray types;
    ExportType et;
 
-   et.Set(ExportPCM, ExportPCMOptions, sf_get_all_extensions(), wxT("wav"), 2);
+   et.Set(_("WAV, AIFF, and other PCM Files"), ExportPCM, ExportPCMOptions, 
sf_get_all_extensions(), wxT("wav"), 2);
    types.Add(et);
 
-   et.Set(ExportMP3, ExportMP3Options, wxT("mp3"), 2, true);
+   et.Set(_("MP3 Files"), ExportMP3, ExportMP3Options, wxT("mp3"), 2, true);
    types.Add(et);
 
 #ifdef USE_LIBVORBIS
-   et.Set(ExportOGG, ExportOGGOptions, wxT("ogg"), 32);
+   et.Set(_("OGG Files"), ExportOGG, ExportOGGOptions, wxT("ogg"), 32);
    types.Add(et);
 #endif
 
 #ifdef USE_LIBFLAC
-   et.Set(ExportFLAC, ExportFLACOptions, wxT("flac"), 8, true);
+   et.Set(_("FLAC Files"), ExportFLAC, ExportFLACOptions, wxT("flac"), 8, 
true);
    types.Add(et);
 #endif
 
 #if USE_LIBTWOLAME
-   et.Set(ExportMP2, ExportMP2Options, wxT("mp2"), 2);
+   et.Set(_("MP2 Files"), ExportMP2, ExportMP2Options, wxT("mp2"), 2);
    types.Add(et);
 #endif
 
 #if !defined(__WXMSW__) && !defined(__WXMAC__)
    // Command line export not available on Windows and Mac platforms
-   et.Set(ExportCL, ExportCLOptions, wxT("*"), 2, false, _("Command Line"));
+   et.Set(_("(external program)"), ExportCL, ExportCLOptions, wxT("*"), 2, 
false);
    types.Add(et);
 #endif
 
@@ -412,7 +411,7 @@
       }
    }
    maskString.RemoveLast();
-
+wxLogDebug(wxT("mask '%s'\n"), maskString);
    mFilename.SetPath(gPrefs->Read(wxT("/Export/Path"), ::wxGetCwd()));
    mFilename.SetName(mProject->GetName());
    mFilename.SetExt(mTypes[mFormat].GetExtension());


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to