Update of /cvsroot/audacity/audacity-src/src/effects
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv11223/effects
Modified Files:
EffectManager.cpp EffectManager.h
Log Message:
Refactor Effect retrieval from BatchCommands to... EffectManager. (Yes, I have
ulterior reasons for bothering with this, but it is better OOP.)
Index: EffectManager.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/effects/EffectManager.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- EffectManager.cpp 15 Aug 2008 06:21:34 -0000 1.5
+++ EffectManager.cpp 7 Nov 2008 10:01:05 -0000 1.6
@@ -107,6 +107,17 @@
return NULL;
}
+Effect* EffectManager::GetEffectByIdentifier(const wxString strTarget, const
int kFlags /*= ALL_EFFECTS*/)
+{
+ for (unsigned int i = 0; i < mEffects.GetCount(); i++)
+ {
+ int nFlags = mEffects[i]->GetEffectFlags();
+ if (((nFlags & kFlags) == nFlags) &&
strTarget.IsSameAs(mEffects[i]->GetEffectIdentifier()))
+ return mEffects[i];
+ }
+ return NULL;
+}
+
EffectArray *EffectManager::GetEffects(int flags /* = ALL_EFFECTS */)
{
EffectArray *results = new EffectArray();
Index: EffectManager.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/effects/EffectManager.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- EffectManager.h 23 Jun 2008 16:18:13 -0000 1.3
+++ EffectManager.h 7 Nov 2008 10:01:05 -0000 1.4
@@ -63,6 +63,8 @@
/** Return an effect by its numerical ID. */
Effect *GetEffect(int ID);
+ Effect* GetEffectByIdentifier(const wxString strTarget, const int kFlags =
ALL_EFFECTS);
+
/** Return the number of registered effects. */
int GetNumEffects();
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs