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

Modified Files:
        Menus.cpp 
Log Message:
Fixed crash when StereoToMono is executed on a non-English system

Index: Menus.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Menus.cpp,v
retrieving revision 1.292
retrieving revision 1.293
diff -u -d -r1.292 -r1.293
--- Menus.cpp   25 Jan 2007 02:53:04 -0000      1.292
+++ Menus.cpp   22 Feb 2007 06:56:42 -0000      1.293
@@ -942,12 +942,15 @@
 // when calling an effect.
 void AudacityProject::ResolveEffectIndices(EffectArray *effects)
 {
+   mNormalizeIndex = -1;
+   mStereoToMonoIndex = -1;
+
    for (unsigned int i = 0; i < effects->GetCount(); i++) {
-      wxString effectName = (*effects)[i]->GetEffectName();
-      if (effectName == wxT("Normalize...")) {
+      wxString effectIdentifier = (*effects)[i]->GetEffectIdentifier();
+      if (effectIdentifier == wxT("Normalize")) {
          mNormalizeIndex = i;
       }
-      else if (effectName == wxT("Stereo To Mono")) {
+      else if (effectIdentifier == wxT("StereoToMono")) {
          mStereoToMonoIndex = i;
       }
    }
@@ -1905,6 +1908,7 @@
    Effect *f = NULL;
 
    effects = Effect::GetEffects(type);
+
    f = (*effects)[index];
    delete effects;
 
@@ -2031,7 +2035,8 @@
 
 void AudacityProject::OnStereoToMono(int index)
 {
-   OnEffect(ALL_EFFECTS, mStereoToMonoIndex);
+   if (mStereoToMonoIndex >= 0)
+      OnEffect(ALL_EFFECTS, mStereoToMonoIndex);
 }
 
 void AudacityProject::OnProcessPlugin(int index)


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