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

Modified Files:
        ExportPCM.cpp 
Log Message:
Options dialog remembers previous choice.

Index: ExportPCM.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/export/ExportPCM.cpp,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- ExportPCM.cpp       8 Jun 2008 16:29:40 -0000       1.44
+++ ExportPCM.cpp       22 Jun 2008 17:19:56 -0000      1.45
@@ -113,12 +113,13 @@
             wxDefaultPosition, wxDefaultSize,
             wxDEFAULT_DIALOG_STYLE | wxSTAY_ON_TOP)
 {
+   mOk = NULL;
    int format = ReadExportFormatPref();
 
    //----- Gather our strings used in choices.
 
    //TODO: clean the things up
-   format = sf_header_index_to_type(selformat);
+   //format = sf_header_index_to_type(selformat);
    int i;
    int num;
    int sel;
@@ -133,15 +134,24 @@
    }
    mHeaderFromChoice = sel;
 
+   mEncodingFormats.Clear();
    num = sf_num_encodings();
-   sel = 0;
+   mEncodingFromChoice = sel = 0;
    for (i = 0; i < num; i++) {
-      mEncodingNames.Add(sf_encoding_index_name(i));
-      if ((format & SF_FORMAT_SUBMASK) == sf_encoding_index_to_subtype(i)) {
-         sel = i;
+      int enc = sf_encoding_index_to_subtype(i);
+      int fmt = format | enc;
+      bool valid  = ValidatePair(fmt);
+      if (valid)
+      {
+
+         mEncodingNames.Add(sf_encoding_index_name(i));
+         mEncodingFormats.Add(enc);
+         if ((format & SF_FORMAT_SUBMASK) == sf_encoding_index_to_subtype(i)) {
+            mEncodingFromChoice = sel;
+         }
+         else sel++;
       }
    }
-   mEncodingFromChoice = sel;
 
    ShuttleGui S(this, eIsCreatingFromPrefs);
 
@@ -151,7 +161,6 @@
    Fit();
    Center();
 }
-
 /// 
 /// 
 void ExportPCMOptions::PopulateOrExchange(ShuttleGui & S)
@@ -182,9 +191,6 @@
    S.AddStandardButtons();
    mOk = (wxButton *)wxWindow::FindWindowById(wxID_OK, this);
 
-   wxCommandEvent nl;
-   OnHeaderChoice(nl);
-
    return;
 }
 
@@ -278,7 +284,8 @@
    info.seekable = 0;
 
    int valid = sf_format_check(&info);
-   mOk->Enable(valid != 0 ? true : false);
+   if (mOk)
+      mOk->Enable(valid != 0 ? true : false);
    return valid != 0 ? true : false;
 }
 


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Audacity-cvs mailing list
Audacity-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to