![]() |
Mixxx
|
00001 /*************************************************************************** 00002 00003 enginebufferscalest.h - description 00004 ------------------- 00005 00006 begin : November 2004 00007 copyright : (C) 2004 by Tue Haste Andersen 00008 email : haste@diku.dk 00009 00010 ***************************************************************************/ 00011 00012 /*************************************************************************** 00013 * * 00014 * This program is free software; you can redistribute it and/or modify * 00015 * it under the terms of the GNU General Public License as published by * 00016 * the Free Software Foundation; either version 2 of the License, or * 00017 * (at your option) any later version. * 00018 * * 00019 ***************************************************************************/ 00020 00025 #ifndef ENGINEBUFFERSCALEST_H 00026 #define ENGINEBUFFERSCALEST_H 00027 00028 #include <QMutex> 00029 #include "enginebufferscale.h" 00030 #include "SoundTouch.h" 00031 00037 const int kiSoundTouchReadAheadLength = 1000; 00038 using namespace soundtouch; 00039 00040 class ReadAheadManager; 00041 00045 class EngineBufferScaleST : public EngineBufferScale { 00046 Q_OBJECT 00047 public: 00048 EngineBufferScaleST(ReadAheadManager* pReadAheadManager); 00049 ~EngineBufferScaleST(); 00050 00052 void setPitchIndpTimeStretch(bool b); 00053 bool getPitchIndpTimeStretch(void); 00054 00056 CSAMPLE* scale(double playpos, unsigned long buf_size, 00057 CSAMPLE* pBase, unsigned long iBaseLength); 00058 00060 double setTempo(double dTempo); 00061 00063 void setBaseRate(double dBaseRate); 00064 00066 void clear(); 00067 00068 public slots: 00069 void slotSetSamplerate(double dSampleRate); 00070 private: 00072 bool m_bBackwards; 00073 00076 CSAMPLE *buffer_back; 00077 00079 SoundTouch *m_pSoundTouch; 00080 00082 bool m_bPitchIndpTimeStretch; 00083 00085 bool m_bClear; 00086 00088 QMutex m_qMutex; 00089 00090 // The read-ahead manager that we use to fetch samples 00091 ReadAheadManager* m_pReadAheadManager; 00092 }; 00093 00094 #endif