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

Modified Files:
        Export.cpp ExportCL.cpp ExportFLAC.cpp ExportMP3.cpp 
        ExportMultiple.cpp ExportOGG.cpp ExportPCM.cpp 
Log Message:
1) Rework of XML file writing.
2) Cleaned up old (FROM)FILENAME() macro usage and added OSFILENAME() usage 
only where needed.
3) Removed Mac specific filename encodings as it's handled by WX now.
4) Fixed a couple of missing wxT()s (one resulted in a day or so debugging 
session ;-)).
5) Commented all PACKAGE_* macros in configtemplate.h as they conflict with the 
latest SoundTouch.


Index: Export.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/export/Export.cpp,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- Export.cpp  3 Aug 2006 10:50:35 -0000       1.42
+++ Export.cpp  23 Sep 2006 02:26:41 -0000      1.43
@@ -179,7 +179,7 @@
    /* Prepare and display the filename selection dialog */
 
    wxString path = gPrefs->Read(wxT("/DefaultExportPath"),
-                                FROMFILENAME(::wxGetCwd()));
+                                ::wxGetCwd());
    wxString nameOnly;
    wxString extension;
    wxString defaultName = project->GetName();
@@ -321,7 +321,7 @@
    actualName = fName;
 
    int suffix = 0;
-   while(::wxFileExists(FILENAME(fName))) {
+   while(::wxFileExists(fName)) {
       fName = path + endOfPathSep + 
          nameOnly + wxString::Format(wxT("%d"), suffix) + wxT(".") + extension;
       suffix++;
@@ -361,7 +361,7 @@
       delete mixerSpec;
 
    if (success && actualName != fName)
-      ::wxRenameFile(FILENAME(fName), FILENAME(actualName));
+      ::wxRenameFile(fName, actualName);
 
    return success;
 }
@@ -439,7 +439,7 @@
    }
 
    if (success && actualName != fName)
-      ::wxRenameFile(FILENAME(fName), FILENAME(actualName));
+      ::wxRenameFile(fName, actualName);
 
    if( mixerSpec )
       delete mixerSpec;

Index: ExportOGG.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/export/ExportOGG.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- ExportOGG.cpp       8 Aug 2006 06:04:19 -0000       1.21
+++ ExportOGG.cpp       23 Sep 2006 02:26:41 -0000      1.22
@@ -49,7 +49,7 @@
    bool      cancelling = false;
    int       eos = 0;
 
-   wxFFile outFile(FILENAME(fName).c_str(), wxT("wb"));
+   wxFFile outFile(fName, wxT("wb"));
 
    if(!outFile.IsOpened()) {
       wxMessageBox(_("Unable to open target file for writing"));

Index: ExportMP3.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/export/ExportMP3.cpp,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- ExportMP3.cpp       8 Aug 2006 06:04:18 -0000       1.43
+++ ExportMP3.cpp       23 Sep 2006 02:26:41 -0000      1.44
@@ -110,7 +110,7 @@
 {
    mLibPath = gPrefs->Read(wxT("/MP3/MP3LibPath"), wxT(""));
 
-   if (mLibPath==wxT("") || !::wxFileExists(FILENAME(mLibPath))) {
+   if (mLibPath==wxT("") || !::wxFileExists(mLibPath)) {
    
       int action = wxMessageBox(GetLibraryMessage(),
                                 _("Export MP3"),
@@ -283,14 +283,14 @@
 
             //BG: I was unable to test the wxDynamicLibrary code on this 
platform
 
-            if (wxFileExists(FILENAME(mLibPath)))
+            if (wxFileExists(mLibPath))
             {
                if(lame_enc_lib.IsLoaded())
                {
                   lame_enc_lib.Unload();
                }
 
-               if(!lame_enc_lib.Load(FILENAME(mLibPath)))
+               if(!lame_enc_lib.Load(mLibPath))
                {
                   return false;
                }
@@ -590,10 +590,10 @@
             Str255 name;
             CFragSymbolClass symClass;
 
-            if (!wxFileExists(FILENAME(mLibPath)))
+            if (!wxFileExists(mLibPath))
                return false;
 
-            wxMacFilename2FSSpec(FILENAME(mLibPath), &spec);
+            wxMacFilename2FSSpec(mLibPath, &spec);
 
             name[0] = 0;
             err = GetDiskFragment(&spec, 0, kCFragGoesToEOF,
@@ -908,14 +908,14 @@
 
             //BG: I was unable to test the wxDynamicLibrary code on this 
platform
 
-            if (wxFileExists(FILENAME(mLibPath)))
+            if (wxFileExists(mLibPath))
             {
                if(lame_enc_lib.IsLoaded())
                {
                   lame_enc_lib.Unload();
                }
 
-               if(!lame_enc_lib.Load(FILENAME(mLibPath)))
+               if(!lame_enc_lib.Load(mLibPath))
                {
                   return false;
                }
@@ -1152,14 +1152,14 @@
    bool  LoadLibrary() {
       wxLogNull logNo;
 
-      if (wxFileExists(FILENAME(mLibPath)))
+      if (wxFileExists(mLibPath))
       {
          if(lame_enc_lib.IsLoaded())
          {
             lame_enc_lib.Unload();
          }
 
-         if(!lame_enc_lib.Load(FILENAME(mLibPath)))
+         if(!lame_enc_lib.Load(mLibPath))
          {
             return false;
          }
@@ -1362,7 +1362,7 @@
    
    /* Open file for writing */
 
-   wxFFile outFile(FILENAME(fName).c_str(), wxT("wb"));
+   wxFFile outFile(fName, wxT("wb"));
    if (!outFile.IsOpened()) {
       wxMessageBox(_("Unable to open target file for writing"));
       return false;
@@ -1467,7 +1467,7 @@
       
 #ifdef __WXMAC__
    FSSpec spec;
-   wxMacFilename2FSSpec(FILENAME(fName), &spec);
+   wxMacFilename2FSSpec(fName, &spec);
    FInfo finfo;
    if (FSpGetFInfo(&spec, &finfo) == noErr) {
       finfo.fdType = 'MP3 ';

Index: ExportCL.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/export/ExportCL.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- ExportCL.cpp        8 Aug 2006 06:04:18 -0000       1.12
+++ ExportCL.cpp        23 Sep 2006 02:26:41 -0000      1.13
@@ -21,6 +21,7 @@
 #include "../Project.h"
 #include "../Mix.h"
 #include "../Prefs.h"
+#include "../Internat.h"
 
 /* this structure combines the RIFF header, the format chunk, and the data
  * chunk header */
@@ -90,7 +91,7 @@
    header.dataID[3] = 'a';
    header.dataLen   = sampleBytes;
 
-   FILE *pipe = popen(command.mb_str(), "w");
+   FILE *pipe = popen(OSFILENAME(command), "w");
 
    /* write the header */
 

Index: ExportPCM.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/export/ExportPCM.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- ExportPCM.cpp       8 Aug 2006 06:04:18 -0000       1.25
+++ ExportPCM.cpp       23 Sep 2006 02:26:41 -0000      1.26
@@ -74,13 +74,7 @@
       return false;
    }
 
-   #ifdef _UNICODE
-      /* sf_open doesn't handle fn_Str() in Unicode build. May or may not 
actually work. */
-      sf = sf_open(FILENAME(fName).mb_str(), SFM_WRITE, &info);
-   #else // ANSI
-      sf = sf_open(FILENAME(fName).fn_str(), SFM_WRITE, &info);
-   #endif // Unicode/ANSI
-
+   sf = sf_open(OSFILENAME(fName), SFM_WRITE, &info);
    if (!sf) {
       wxMessageBox(wxString::Format(_("Cannot export audio to %s"),
                                     fName.c_str()));
@@ -151,7 +145,7 @@
 
    FSSpec spec;
 
-   wxMacFilename2FSSpec(FILENAME(fName), &spec);
+   wxMacFilename2FSSpec(fName, &spec);
 
    FInfo finfo;
    if (FSpGetFInfo(&spec, &finfo) == noErr) {

Index: ExportFLAC.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/export/ExportFLAC.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- ExportFLAC.cpp      3 Sep 2006 02:24:14 -0000       1.8
+++ ExportFLAC.cpp      23 Sep 2006 02:26:41 -0000      1.9
@@ -58,7 +58,7 @@
       gPrefs->Read(wxT("/FileFormats/FLACBitDepth"), wxT("16"));
    
    FLAC::Encoder::File *encoder= new FLAC::Encoder::File();
-   encoder->set_filename(fName.mb_str());
+   encoder->set_filename(OSFILENAME(fName));
    encoder->set_channels(numChannels);
    encoder->set_sample_rate(int(rate + 0.5));
 

Index: ExportMultiple.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/export/ExportMultiple.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- ExportMultiple.cpp  22 Aug 2006 07:54:11 -0000      1.18
+++ ExportMultiple.cpp  23 Sep 2006 02:26:41 -0000      1.19
@@ -265,7 +265,7 @@
 {
    wxString mMpgExePath = gPrefs->Read(wxT("/MP3/MpgExePath"), wxT(""));
 
-   if (mMpgExePath==wxT("") || !::wxFileExists(FILENAME(mMpgExePath))) {
+   if (mMpgExePath==wxT("") || !::wxFileExists(mMpgExePath)) {
          
       int action = wxMessageBox(
          _("Audacity needs to know the location of the TOMPG.EXE 
program.\nPlease download and save the freely available file in any 
convenient\nlocation such as the Plug-Ins subdir of Audacity and let 
Audacity\nknow about this path.  Would you like to help Audacity locate the 
file now?"),
@@ -365,13 +365,7 @@
             wxLogStatus(_T("command '%s' terminated with exit code %d."),
                tompgCmd.c_str(), code);
 
-            #ifdef _UNICODE
-               /* remove doesn't handle fn_Str() in Unicode build.  
-                  May or may not actually work. */
-               remove(tmpWavOuput.mb_str()); //delete the tmp wav file
-            #else // ANSI
-               remove(tmpWavOuput.fn_str()); //delete the tmp wav file
-            #endif // Unicode/ANSI
+            remove(OSFILENAME(tmpWavOuput)); //delete the tmp wav file
 
             wxEndBusyCursor();
 
@@ -891,7 +885,7 @@
 void ExportMultipleDialog::CopyDataToControls()
 {
    wxString defaultPath = gPrefs->Read(wxT("/DefaultExportPath"),
-                                       FROMFILENAME(::wxGetCwd()));
+                                       ::wxGetCwd());
    wxString path = gPrefs->Read(wxT("/DefaultMultiplExportPath"),
                                 defaultPath);
    mDir->SetValue(path);


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to