Update of /cvsroot/audacity/audacity-src/src/effects
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv15972/effects
Modified Files:
Tag: Audacity_1_3_5-Camp_Jam
Effect.cpp Effect.h
Log Message:
Refactor Effect results to Effect class.
Index: Effect.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/effects/Effect.cpp,v
retrieving revision 1.50
retrieving revision 1.50.2.1
diff -u -d -r1.50 -r1.50.2.1
--- Effect.cpp 6 May 2008 03:22:40 -0000 1.50
+++ Effect.cpp 3 Nov 2008 05:23:37 -0000 1.50.2.1
@@ -101,6 +101,37 @@
return NULL;
}
+Effect* Effect::GetEffectByName(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]->GetEffectName()))
+ {
+ return mEffects[i];
+ }
+ }
+ return NULL;
+}
+
+Effect* Effect::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];
+ //}
+ wxString strJunk = mEffects[i]->GetEffectIdentifier();
+ if (strTarget.IsSameAs(mEffects[i]->GetEffectIdentifier()))
+ return mEffects[i];
+ }
+ return NULL;
+}
+
EffectArray *Effect::GetEffects(int flags /* = ALL_EFFECTS */)
{
EffectArray *results = new EffectArray();
Index: Effect.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/effects/Effect.h,v
retrieving revision 1.33
retrieving revision 1.33.2.1
diff -u -d -r1.33 -r1.33.2.1
--- Effect.h 5 May 2008 19:35:26 -0000 1.33
+++ Effect.h 3 Nov 2008 05:23:37 -0000 1.33.2.1
@@ -68,6 +68,8 @@
static void RegisterEffect(Effect *f, int AdditionalFlags=0);
static void UnregisterEffects();
static Effect *GetEffect(int ID);
+ static Effect* GetEffectByName(const wxString strTarget, const int kFlags =
ALL_EFFECTS);
+ static Effect* GetEffectByIdentifier(const wxString strTarget, const int
kFlags = ALL_EFFECTS);
static int GetNumEffects();
// Returns a sorted array of effects, which may be filtered
-------------------------------------------------------------------------
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