1 /********************************************************************** 2 3 Audacity: A Digital Audio Editor 4 5 Fade.h 6 7 Dominic Mazzoni 8 9 **********************************************************************/ 10 11 #ifndef __AUDACITY_EFFECT_FADE__ 12 #define __AUDACITY_EFFECT_FADE__ 13 14 #include "Effect.h" 15 16 class EffectFade : public Effect 17 { 18 public: 19 EffectFade(bool fadeIn = false); 20 virtual ~EffectFade(); 21 22 // ComponentInterface implementation 23 24 ComponentInterfaceSymbol GetSymbol() override; 25 TranslatableString GetDescription() override; 26 27 // EffectDefinitionInterface implementation 28 29 EffectType GetType() override; 30 bool IsInteractive() override; 31 32 // EffectClientInterface implementation 33 34 unsigned GetAudioInCount() override; 35 unsigned GetAudioOutCount() override; 36 bool ProcessInitialize(sampleCount totalLen, ChannelNames chanMap = NULL) override; 37 size_t ProcessBlock(float **inBlock, float **outBlock, size_t blockLen) override; 38 39 private: 40 // EffectFade implementation 41 42 bool mFadeIn; 43 sampleCount mSample; 44 }; 45 46 class EffectFadeIn final : public EffectFade 47 { 48 public: 49 static const ComponentInterfaceSymbol Symbol; 50 EffectFadeIn()51 EffectFadeIn() : EffectFade{ true } {} 52 }; 53 54 55 class EffectFadeOut final : public EffectFade 56 { 57 public: 58 static const ComponentInterfaceSymbol Symbol; 59 EffectFadeOut()60 EffectFadeOut() : EffectFade{ false } {} 61 }; 62 63 #endif 64