![]() |
Mixxx
|
00001 /*************************************************************************** 00002 enginevumeter.h - description 00003 ------------------- 00004 copyright : (C) 2002 by Tue and Ken Haste Andersen 00005 email : 00006 ***************************************************************************/ 00007 00008 /*************************************************************************** 00009 * * 00010 * This program is free software; you can redistribute it and/or modify * 00011 * it under the terms of the GNU General Public License as published by * 00012 * the Free Software Foundation; either version 2 of the License, or * 00013 * (at your option) any later version. * 00014 * * 00015 ***************************************************************************/ 00016 00017 #ifndef ENGINEVUMETER_H 00018 #define ENGINEVUMETER_H 00019 00020 #include "engine/engineobject.h" 00021 00022 // Rate at which the vumeter is updated (using a sample rate of 44100 Hz): 00023 #define UPDATE_RATE 20 00024 00025 //SMOOTHING FACTORS 00026 //Must be from 0-1 the lower the factor, the more smoothing that is applied 00027 #define ATTACK_SMOOTHING 1. // .85 00028 #define DECAY_SMOOTHING .1 //.16//.4 00029 00030 class ControlPotmeter; 00031 00032 class EngineVuMeter : public EngineObject { 00033 public: 00034 EngineVuMeter(const char *); 00035 ~EngineVuMeter(); 00036 void process(const CSAMPLE *pIn, const CSAMPLE *pOut, const int iBufferSize); 00037 00038 private: 00039 ControlPotmeter *m_ctrlVuMeter; 00040 ControlPotmeter *m_ctrlVuMeterL; 00041 ControlPotmeter *m_ctrlVuMeterR; 00042 FLOAT_TYPE m_fRMSvolumeL; 00043 FLOAT_TYPE m_fRMSvolumeSumL; 00044 FLOAT_TYPE m_fRMSvolumeR; 00045 FLOAT_TYPE m_fRMSvolumeSumR; 00046 int m_iSamplesCalculated; 00047 00048 void doSmooth(FLOAT_TYPE ¤tVolume, FLOAT_TYPE newVolume); 00049 }; 00050 00051 #endif