Update of /cvsroot/audacity/audacity-src/src
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv27019/src

Modified Files:
        Menus.cpp Menus.h Project.cpp 
Log Message:
Fix Stereo To Mono issue

Index: Project.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Project.cpp,v
retrieving revision 1.397
retrieving revision 1.398
diff -u -d -r1.397 -r1.398
--- Project.cpp 19 Feb 2009 09:21:51 -0000      1.397
+++ Project.cpp 26 Feb 2009 02:30:18 -0000      1.398
@@ -3041,7 +3041,8 @@
       //TODO: All we want is a SelectAll()
       SelectNone();
       SelectAllIfNone();
-      OnEffect(ALL_EFFECTS | CONFIGURED_EFFECT, mNormalizeIndex ); // 
gNormalize);
+      OnEffect(ALL_EFFECTS | CONFIGURED_EFFECT,
+               EffectManager::Get().GetEffectByIdentifier(wxT("Normalize")));
    }
 
    GetDirManager()->FillBlockfilesCache();

Index: Menus.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Menus.cpp,v
retrieving revision 1.440
retrieving revision 1.441
diff -u -d -r1.440 -r1.441
--- Menus.cpp   21 Feb 2009 21:56:26 -0000      1.440
+++ Menus.cpp   26 Feb 2009 02:30:17 -0000      1.441
@@ -939,12 +939,6 @@
       c->EndMenu();
    }
    
-   // Resolve from list of all effects, 
-   effects = em.GetEffects(ALL_EFFECTS);
-   ResolveEffectIndices(effects);
-   delete effects;
-
-
    #ifdef __WXMAC__
    wxGetApp().s_macHelpMenuTitleName = _("&Help");
    #endif
@@ -1171,31 +1165,6 @@
    c->AddSeparator();
 }
 
-// TIDY-ME: Replace indices by function pointers.
-// This function is currently (July 2005) required because
-// menus get to effect functions in a messy way.
-// It would be much cleaner if each menu item already
-// stored both the function pointer and the class pointer.
-// so menus, and other dispatching, can dispatch to 'any' 
-// function in 'any' class instance directly,
-// rather than having to look up the class via an index
-// when calling an effect.
-void AudacityProject::ResolveEffectIndices(EffectArray *effects)
-{
-   mNormalizeIndex = -1;
-   mStereoToMonoIndex = -1;
-
-   for (unsigned int i = 0; i < effects->GetCount(); i++) {
-      wxString effectIdentifier = (*effects)[i]->GetEffectIdentifier();
-      if (effectIdentifier == wxT("Normalize")) {
-         mNormalizeIndex = i;
-      }
-      else if (effectIdentifier == wxT("StereoToMono")) {
-         mStereoToMonoIndex = i;
-      }
-   }
-}
-
 void AudacityProject::ModifyUndoMenus()
 {
    wxString desc;
@@ -2434,8 +2403,8 @@
 
 void AudacityProject::OnStereoToMono(int index)
 {
-   if (mStereoToMonoIndex >= 0)
-      OnEffect(ALL_EFFECTS, mStereoToMonoIndex);
+   OnEffect(ALL_EFFECTS,
+            EffectManager::Get().GetEffectByIdentifier(wxT("StereoToMono")));
 }
 
 void AudacityProject::OnProcessPlugin(int index)

Index: Menus.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Menus.h,v
retrieving revision 1.128
retrieving revision 1.129
diff -u -d -r1.128 -r1.129
--- Menus.h     21 Nov 2008 01:29:38 -0000      1.128
+++ Menus.h     26 Feb 2009 02:30:18 -0000      1.129
@@ -312,12 +312,8 @@
 void OnImportCleanSpeechPresets();
 void OnExportCleanSpeechPresets();
 void OnStereoToMono(int index);
-void ResolveEffectIndices(EffectArray *effects);
 wxString BuildCleanFileName(wxString fileName);
 
-int  mNormalizeIndex;
-int  mStereoToMonoIndex;
-
         // Help Menu
 
 void OnAbout();


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to