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

Modified Files:
        Equalization.cpp Equalization.h NoiseRemoval.cpp 
        SimplePairedTwoTrack.h 
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: Equalization.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/effects/Equalization.cpp,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- Equalization.cpp    20 Sep 2006 22:42:55 -0000      1.44
+++ Equalization.cpp    23 Sep 2006 02:26:25 -0000      1.45
@@ -850,7 +850,8 @@
    }
 
    // Create/Open the file
-   wxFFile eqFile( fn.GetFullPath().c_str(), wxT("wb") );
+   XMLFileWriter eqFile;
+   eqFile.Open( fn.GetFullPath(), wxT("wb") );
 
    // Complain if open failed
    if( !eqFile.IsOpened() )
@@ -860,7 +861,7 @@
    }
 
    // Write the curves
-   WriteXML( 0, eqFile.fp() );
+   WriteXML( eqFile );
 
    // Close the file
    eqFile.Close();
@@ -1521,11 +1522,10 @@
 //
 // Write all of the curves to the XML file
 //
-void EqualizationDialog::WriteXML(int depth, FILE *fp)
+void EqualizationDialog::WriteXML(XMLWriter &xmlFile)
 {
    // Start our heirarchy
-   fprintf( fp,
-            "<equalizationeffect>\n" );
+   xmlFile.StartTag( wxT( "equalizationeffect" ) );
 
    // Write all curves
    int numCurves = mCurves.GetCount();
@@ -1533,34 +1533,27 @@
    for( curve = 0; curve < numCurves; curve++ )
    {
       // Start a new curve
-      fprintf( fp,
-               "\t<curve name='%s'>\n",
-               (const char *)mCurves[ curve ].Name.mb_str() );
+      xmlFile.StartTag( wxT( "curve" ) );
+      xmlFile.WriteAttr( wxT( "name" ), mCurves[ curve ].Name );
 
       // Write all points
       int numPoints = mCurves[ curve ].points.GetCount();
       int point;
       for( point = 0; point < numPoints; point++ )
       {
-         // Convert to external format
-         wxString freq = Internat::ToString( mCurves[ curve ].points[ point 
].Freq, 12 );
-         wxString db = Internat::ToString( mCurves[ curve ].points[ point 
].dB, 12 );
-
          // Write new point
-         fprintf( fp,
-                  "\t\t<point f='%s' d='%s'/>\n",
-                  (const char *)freq.mb_str(),
-                  (const char *)db.mb_str() );
+         xmlFile.StartTag( wxT( "point" ) );
+         xmlFile.WriteAttr( wxT( "f" ), mCurves[ curve ].points[ point ].Freq, 
12 );
+         xmlFile.WriteAttr( wxT( "d" ), mCurves[ curve ].points[ point ].dB, 
12 );
+         xmlFile.EndTag( wxT( "point" ) );
       }
 
       // Terminate curve
-      fprintf( fp,
-               "\t</curve>\n" );
+      xmlFile.EndTag( wxT( "curve" ) );
    }
 
    // Terminate our heirarchy
-   fprintf( fp,
-            "</equalizationeffect>\n" );
+   xmlFile.EndTag( wxT( "equalizationeffect" ) );
 }
 
 // WDR: handler implementations for EqualizationDialog

Index: SimplePairedTwoTrack.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/effects/SimplePairedTwoTrack.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- SimplePairedTwoTrack.h      14 Nov 2004 12:00:53 -0000      1.6
+++ SimplePairedTwoTrack.h      23 Sep 2006 02:26:25 -0000      1.7
@@ -117,8 +117,8 @@
          GetSamples((WaveTrack *)right, &rstart, &rlen);
         
          if (llen != rlen || ((WaveTrack *)left)->GetRate() != ((WaveTrack 
*)right)->GetRate()) {
-            wxMessageBox("Sorry, This effect cannot be performed on stereo 
tracks where "
-                        "the individual channels of the track do not match.");
+            wxMessageBox(_("Sorry, This effect cannot be performed on stereo 
tracks where ")
+                        wxT("the individual channels of the track do not 
match."));
             return false;
                 }
       }

Index: Equalization.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/effects/Equalization.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- Equalization.h      19 Aug 2006 20:20:45 -0000      1.19
+++ Equalization.h      23 Sep 2006 02:26:25 -0000      1.20
@@ -235,7 +235,7 @@
    // XMLTagHandler callback methods for loading and saving
    bool HandleXMLTag(const wxChar *tag, const wxChar **attrs);
    XMLTagHandler *HandleXMLChild(const wxChar *tag);
-   void WriteXML(int depth, FILE *fp);
+   void WriteXML(XMLWriter &xmlFile);
 
 private:
    // WDR: member variable declarations for EqualizationDialog

Index: NoiseRemoval.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/effects/NoiseRemoval.cpp,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- NoiseRemoval.cpp    3 Jul 2006 19:15:47 -0000       1.33
+++ NoiseRemoval.cpp    23 Sep 2006 02:26:25 -0000      1.34
@@ -99,11 +99,11 @@
       }
    }
    // Try to open the file.
-   wxString filename = FILENAME(wxT("noisegate.nrp"));
+   wxString filename = wxT("noisegate.nrp");
    // if file doesn't exist, return quietly.
    if( !wxFile::Exists( filename ))
       return;
-       wxFFile   noiseGateFile((const wxChar*)filename, (const 
wxChar*)wxT("rb"));
+       wxFFile noiseGateFile(filename, wxT("rb"));
    bool flag = noiseGateFile.IsOpened();
    if (flag != true)
       return;
@@ -126,7 +126,7 @@
        AudacityProject * project = GetActiveProject();
        if( !project || !project->GetCleanSpeechMode() )
       return;
-   wxFFile   noiseGateFile((const wxChar*)FILENAME(wxT("noisegate.nrp")), 
(const wxChar*)wxT("wb"));
+   wxFFile noiseGateFile(wxT("noisegate.nrp"), wxT("wb"));
    bool flag = noiseGateFile.IsOpened();
    if (flag == true) {
       int expectedCount = (windowSize / 2) * sizeof(float);


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