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

Modified Files:
        VampEffect.cpp VampEffect.h 
Log Message:
Several effects defined their own GetSamples() method, but they
were all the same, so I moved it to the Effect class and removed
it from the others.

Many effects defined a GetEffectFlags() method, but rather than
incur the extra class overhead for it, I removed the method and
replaced it with a call to SetEffectFlags().  This also put the
handling of the Effect flags into one class (Effect).


Index: VampEffect.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/effects/vamp/VampEffect.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- VampEffect.cpp      23 Mar 2009 00:32:54 -0000      1.12
+++ VampEffect.cpp      20 May 2009 06:22:49 -0000      1.13
@@ -42,14 +42,15 @@
    mName(name),
    mRate(0),
    mCategory(category),
-   mPlugin(0)
+   mPlugin(NULL)
 {
+   SetEffectFlags(PLUGIN_EFFECT | ANALYZE_EFFECT);
 }
 
 VampEffect::~VampEffect()
 {
    delete mPlugin;
-   mPlugin = 0;
+   mPlugin = NULL;
 }
 
 wxString VampEffect::GetEffectName()
@@ -81,11 +82,6 @@
                            GetEffectName().c_str());
 }
 
-int VampEffect::GetEffectFlags()
-{
-   return PLUGIN_EFFECT | ANALYZE_EFFECT;
-}
-
 bool VampEffect::Init()
 {
    Vamp::HostExt::PluginLoader *loader =
@@ -143,26 +139,6 @@
    return true;
 }
 
-void VampEffect::GetSamples(WaveTrack *track,
-                            sampleCount *start,
-                            sampleCount *len)
-{
-   double trackStart = track->GetStartTime();
-   double trackEnd = track->GetEndTime();
-   double t0 = mT0 < trackStart ? trackStart : mT0;
-   double t1 = mT1 > trackEnd ? trackEnd : mT1;
-
-   if (t1 > t0) {
-      *start = track->TimeToLongSamples(t0);
-      sampleCount end = track->TimeToLongSamples(t1);
-      *len = (sampleCount)(end - *start);
-   }
-   else {
-      *start = 0;
-      *len  = 0;
-   }
-}
-
 bool VampEffect::Process()
 {
    if (!mPlugin) return false;

Index: VampEffect.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/effects/vamp/VampEffect.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- VampEffect.h        30 Dec 2008 00:36:55 -0000      1.7
+++ VampEffect.h        20 May 2009 06:22:49 -0000      1.8
@@ -45,8 +45,6 @@
 
    virtual wxString GetEffectAction();
 
-   virtual int GetEffectFlags();
-
    virtual bool Init();
 
    virtual bool PromptUser();
@@ -69,10 +67,6 @@
    
    Vamp::Plugin *mPlugin;
 
-   void GetSamples(WaveTrack *track,
-                   sampleCount *start,
-                   sampleCount *len);
-
    void AddFeatures(LabelTrack *track,
                     Vamp::Plugin::FeatureSet &features);
 };


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to