![]() |
Mixxx
|
00001 // enginepassthrough.h 00002 // created 4/8/2011 by Bill Good (bkgood@gmail.com) 00003 // unapologetically copied from enginemicrophone.h from RJ 00004 00005 #ifndef ENGINEPASSTHROUGH_H 00006 #define ENGINEPASSTHROUGH_H 00007 00008 #include "circularbuffer.h" 00009 #include "controlpushbutton.h" 00010 #include "engine/enginechannel.h" 00011 #include "engine/engineclipping.h" 00012 #include "engine/enginevumeter.h" 00013 #include "soundmanagerutil.h" 00014 00015 // EnginePassthrough is an EngineChannel that implements a mixing source whose 00016 // samples are fed directly from the SoundManager 00017 class EnginePassthrough : public EngineChannel, public AudioDestination { 00018 Q_OBJECT 00019 public: 00020 EnginePassthrough(const char *pGroup); 00021 virtual ~EnginePassthrough(); 00022 00023 bool isActive(); 00024 bool isPFL(); 00025 bool isMaster(); 00026 00027 // Called by EngineMaster whenever is requesting a new buffer of audio. 00028 virtual void process(const CSAMPLE *pInput, const CSAMPLE *pOutput, const int iBufferSize); 00029 00030 // This is called by SoundManager whenever there are new samples from the 00031 // deck to be processed 00032 virtual void receiveBuffer(AudioInput input, const short *pBuffer, unsigned int nFrames); 00033 00034 // Called by SoundManager whenever the passthrough input is connected to a 00035 // soundcard input. 00036 virtual void onInputConnected(AudioInput input); 00037 00038 // Called by SoundManager whenever the passthrough input is disconnected from 00039 // a soundcard input. 00040 virtual void onInputDisconnected(AudioInput input); 00041 00042 private: 00043 EngineClipping m_clipping; 00044 EngineVuMeter m_vuMeter; 00045 ControlObject *m_pEnabled; 00046 ControlPushButton *m_pPassing; 00047 CSAMPLE *m_pConversionBuffer; 00048 CircularBuffer<CSAMPLE> m_sampleBuffer; 00049 }; 00050 00051 #endif /* ENGINEPASSTHROUGH_H */