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