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

Modified Files:
        ExportCL.h Export.cpp Export.h ExportCL.cpp 
Log Message:
Fix localization problems with command chains

Index: Export.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/export/Export.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- Export.h    14 Apr 2007 06:58:30 -0000      1.9
+++ Export.h    15 Apr 2007 02:23:36 -0000      1.10
@@ -54,20 +54,23 @@
             ExportOptions options,
             wxString extension,
             int maxchannels,
-            bool canmetadata = false);
+            bool canmetadata = false,
+            wxString description = wxEmptyString);
    
    void Set(ExportRoutine routine,
             ExportOptions options,
             wxArrayString extensions,
             wxString extension,
             int maxchannels,
-            bool canmetadata = false);
+            bool canmetadata = false,
+            wxString description = wxEmptyString);
    
    ExportRoutine GetRoutine();
    ExportOptions GetOptions();
    wxString GetFormat();
    wxString GetExtension();
    wxArrayString GetExtensions();
+   wxString GetDescription();
    wxString GetMask();
    int GetMaxChannels();
    bool GetCanMetaData();
@@ -90,6 +93,7 @@
    wxString mFormat;
    wxString mExtension;
    wxArrayString mExtensions;
+   wxString mDescription;
    int mMaxChannels;
    bool mCanMetaData;
 };

Index: Export.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/export/Export.cpp,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- Export.cpp  14 Apr 2007 06:58:30 -0000      1.49
+++ Export.cpp  15 Apr 2007 02:23:36 -0000      1.50
@@ -90,7 +90,8 @@
                      wxArrayString extensions,
                      wxString extension,
                      int maxchannels,
-                     bool canmetadata)
+                     bool canmetadata,
+                     wxString description)
 {
    mExtensions = extensions;
    Set(routine, options, extension, maxchannels, canmetadata);
@@ -100,7 +101,8 @@
                      ExportOptions options,
                      wxString extension,
                      int maxchannels,
-                     bool canmetadata)
+                     bool canmetadata,
+                     wxString description)
 {
    mRoutine = routine;
    mOptions = options;
@@ -108,6 +110,7 @@
    mExtension = extension.MakeLower();
    mMaxChannels = maxchannels;
    mCanMetaData = canmetadata;
+   mDescription = description;
 
    if (mExtensions.GetCount() == 0) {
       mExtensions.Add(mExtension);
@@ -139,6 +142,11 @@
    return mExtensions;
 }
 
+wxString ExportType::GetDescription()
+{
+   return mDescription;
+}
+
 int ExportType::GetMaxChannels()
 {
    return mMaxChannels;
@@ -151,13 +159,19 @@
 
 wxString ExportType::GetMask()
 {
-   wxString mask = mFormat + wxT(" files|");
-   size_t i;
+   wxString mask;
+   
+   if (mDescription.IsEmpty()) {
+      mask = mFormat + wxT(" files|");
+   }
+   else {
+      mask = mDescription + wxT("|");
+   }
 
    // Build the mask, but cater to the Mac FileDialog and put the default
    // extension at the end of the mask.
 
-   for (i = 0; i < mExtensions.GetCount(); i++) {
+   for (size_t i = 0; i < mExtensions.GetCount(); i++) {
       if (mExtension != mExtensions[i]) {
          mask += wxT("*.") + mExtensions[i] + wxT(";");
       }
@@ -168,7 +182,7 @@
 
 bool ExportType::IsExtension(wxString & ext)
 {
-   return mExtensions.Index(ext, false) != wxNOT_FOUND;
+   return mExtension == wxT("*") || mExtensions.Index(ext, false) != 
wxNOT_FOUND;
 }
 
 bool ExportType::DisplayOptions(AudacityProject *project)
@@ -236,17 +250,20 @@
    et.Set(ExportOGG, ExportOGGOptions, wxT("ogg"), 32);
    types.Add(et);
 #endif
-   
+
 #ifdef USE_LIBFLAC
    et.Set(ExportFLAC, ExportFLACOptions, wxT("flac"), 8, true);
    types.Add(et);
 #endif
-   
+
 #if USE_LIBTWOLAME
    et.Set(ExportMP2, ExportMP2Options, wxT("mp2"), 2);
    types.Add(et);
 #endif
 
+   et.Set(ExportCL, ExportCLOptions, wxT("*"), 2, false, _("Command Line"));
+   types.Add(et);
+
    return types;
 }
 

Index: ExportCL.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/export/ExportCL.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- ExportCL.cpp        28 Mar 2007 04:14:04 -0000      1.15
+++ ExportCL.cpp        15 Apr 2007 02:23:36 -0000      1.16
@@ -13,8 +13,6 @@
 
 **********************************************************************/
 
-#ifdef __WXGTK__
-
 #include <stdio.h>
 #include <wx/progdlg.h>
 
@@ -46,8 +44,10 @@
    wxUint32 dataLen;          /* length of all samples in bytes */
 };
 
-bool ExportCL(AudacityProject *project, bool stereo, wxString fName,
-              bool selectionOnly, double t0, double t1, MixerSpec *mixerSpec)
+bool ExportCL(AudacityProject *project,
+              int channels, wxString fName,
+              bool selectionOnly, double t0, double t1, 
+              MixerSpec *mixerSpec)
 {
    int rate = int(project->GetRate() + 0.5);
    TrackList *tracks = project->GetTracks();
@@ -56,7 +56,6 @@
    command.Replace(wxT("%f"), fName);
 
    /* establish parameters */
-   int channels = stereo ? 2 : 1;
    unsigned long totalSamples = (unsigned long)((t1 - t0) * rate + 0.5);
    unsigned long sampleBytes = totalSamples * channels * 
SAMPLE_SIZE(int16Sample);
 
@@ -152,8 +151,92 @@
    return true;
 }
 
-#endif  /* __WXGTK__ */
+class CLOptionsDialog : public wxDialog
+{
+public:
+
+   /// 
+   /// 
+   CLOptionsDialog(wxWindow *parent)
+   : wxDialog(NULL, wxID_ANY, wxString(_("Specify Command Line Options")),
+      wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxSTAY_ON_TOP)
+   {
+      ShuttleGui S(this, eIsCreatingFromPrefs);
+
+      PopulateOrExchange(S);
+   }
 
+   /// 
+   /// 
+   void PopulateOrExchange(ShuttleGui & S)
+   {
+      S.StartHorizontalLay(wxEXPAND, 0);
+      {
+         S.StartStatic(_("Command Line Export Setup"), true);
+         {
+            S.StartMultiColumn(2, wxEXPAND);
+            {
+               S.SetStretchyCol(1);
+               S.TieTextBox(_("Command:"),
+                            wxT("/FileFormats/ExternalProgramExportCommand"),
+                            wxT("lame - '%f'"),
+                            64);
+            }
+            S.EndMultiColumn();
+            S.AddFixedText(_("Include \"%f\" where the output filename should 
be substituted."));
+         }
+         S.EndStatic();
+      }
+      S.EndHorizontalLay();
+      S.StartHorizontalLay(wxALIGN_CENTER, false);
+      {
+#if defined(__WXGTK20__) || defined(__WXMAC__)
+         S.Id(wxID_CANCEL).AddButton(_("&Cancel"));
+         S.Id(wxID_OK).AddButton(_("&OK"))->SetDefault();
+#else
+         S.Id(wxID_OK).AddButton(_("&OK"))->SetDefault();
+         S.Id(wxID_CANCEL).AddButton(_("&Cancel"));
+#endif
+      }
+      GetSizer()->AddSpacer(5);
+      Layout();
+      Fit();
+      SetMinSize(GetSize());
+      Center();
+
+      return;
+   }
+
+   /// 
+   /// 
+   void OnOK(wxCommandEvent& event)
+   {
+      ShuttleGui S(this, eIsSavingToPrefs);
+      PopulateOrExchange(S);
+
+      EndModal(wxID_OK);
+
+      return;
+   }
+
+private:
+   int mCLQualityUnscaled;
+
+   DECLARE_EVENT_TABLE()
+};
+
+BEGIN_EVENT_TABLE(CLOptionsDialog, wxDialog)
+   EVT_BUTTON(wxID_OK, CLOptionsDialog::OnOK)
+END_EVENT_TABLE()
+
+bool ExportCLOptions(AudacityProject *project)
+{
+   CLOptionsDialog od(project);
+
+   od.ShowModal();
+
+   return true;
+}
 
 // Indentation settings for Vim and Emacs and unique identifier for Arch, a
 // version control system. Please do not modify past this point.

Index: ExportCL.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/export/ExportCL.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- ExportCL.h  14 Apr 2006 18:12:51 -0000      1.3
+++ ExportCL.h  15 Apr 2007 02:23:36 -0000      1.4
@@ -15,9 +15,12 @@
 
 class MixerSpec;
 
-bool ExportCL(AudacityProject *project, bool stereo, wxString fName,
-              bool selectionOnly, double t0, double t1, 
-              MixerSpec *mixerSpec = NULL);
+bool ExportCL(AudacityProject *project,
+               int channels, wxString fName,
+               bool selectionOnly, double t0, double t1, 
+               MixerSpec *mixerSpec = NULL);
+
+bool ExportCLOptions(AudacityProject *project);
 
 #endif
 


-------------------------------------------------------------------------
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