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

Modified Files:
        AudioUnitEffect.cpp AudioUnitEffect.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: AudioUnitEffect.h
===================================================================
RCS file: 
/cvsroot/audacity/audacity-src/src/effects/audiounits/AudioUnitEffect.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- AudioUnitEffect.h   12 Jul 2008 15:25:48 -0000      1.4
+++ AudioUnitEffect.h   20 May 2009 06:22:49 -0000      1.5
@@ -34,8 +34,6 @@
    
    virtual wxString GetEffectAction();
 
-   virtual int GetEffectFlags();
- 
    virtual bool Init();
 
    virtual bool PromptUser();
@@ -48,10 +46,6 @@
    bool SetRateAndChannels(AudioUnit unit,
                            int numChannels, Float64 sampleRate);
 
-   void GetSamples(WaveTrack *track,
-                   sampleCount *start,
-                   sampleCount *len);
-
    bool ProcessStereo(int count, WaveTrack * left, WaveTrack *right,
                       sampleCount lstart, sampleCount rstart,
                       sampleCount len);

Index: AudioUnitEffect.cpp
===================================================================
RCS file: 
/cvsroot/audacity/audacity-src/src/effects/audiounits/AudioUnitEffect.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- AudioUnitEffect.cpp 23 Mar 2009 00:32:54 -0000      1.14
+++ AudioUnitEffect.cpp 20 May 2009 06:22:49 -0000      1.15
@@ -95,6 +95,7 @@
    mName(name),
    mComponent(component)
 {
+   SetEffectFlags(PLUGIN_EFFECT | PROCESS_EFFECT);
    OSErr result;
 
    mUnit = NULL;
@@ -139,13 +140,6 @@
                            mName.c_str());
 }
 
-int AudioUnitEffect::GetEffectFlags()
-{
-   int flags = PLUGIN_EFFECT | PROCESS_EFFECT;
-
-   return flags;
-}
- 
 bool AudioUnitEffect::Init()
 {
    ComponentResult auResult;
@@ -244,26 +238,6 @@
    AudioUnitUninitialize(mUnit);
 }
 
-void AudioUnitEffect::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 AudioUnitEffect::SetRateAndChannels(AudioUnit unit,
                                          int numChannels,
                                          Float64 sampleRate)


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