1 /********************************************************************** 2 3 Audacity: A Digital Audio Editor 4 5 SimpleMono.h 6 7 Dominic Mazzoni 8 9 This abstract class simplifies the implementation of a basic 10 monaural effect. Inherit from it if your effect doesn't just 11 modifies a track in place and doesn't care how many samples 12 it gets at a time. Your derived class only needs to implement 13 GetSymbol, GetEffectAction, and ProcessSimpleMono. 14 15 **********************************************************************/ 16 17 #ifndef __AUDACITY_EFFECT_SIMPLE_MONO__ 18 #define __AUDACITY_EFFECT_SIMPLE_MONO__ 19 20 #include "Effect.h" 21 22 class WaveTrack; 23 24 class EffectSimpleMono /* not final */ : public Effect 25 { 26 public: 27 bool Process() override; 28 29 protected: 30 31 // Override this method if you need to do things 32 // before every track (including the first one) 33 // NEW override 34 virtual bool NewTrackSimpleMono() = 0; 35 36 // Override this method to actually process audio 37 virtual bool ProcessSimpleMono(float *buffer, size_t len) = 0; 38 39 protected: 40 // Other useful information 41 int mCurTrackNum; 42 double mCurRate; 43 double mCurT0; 44 double mCurT1; 45 int mCurChannel; 46 47 private: 48 bool ProcessOne(WaveTrack * t, sampleCount start, sampleCount end); 49 }; 50 51 #endif 52