📄 dspaudio.h
字号:
#ifndef DSPTHREAD_H_INCLUDED#define DSPTHREAD_H_INCLUDED#include "../config.h"#ifdef QT_THREAD_SUPPORT#include <qthread.h>#else#include <qtimer.h>#include <qobject.h>#endif#include "audiobuffer.h"#include "dtmfgenerator.h"#include "sessioncontrol.h"class DspOut;#ifdef QT_THREAD_SUPPORTclass DspAudio : public QThread#elseclass DspAudio : public QObject#endif{public: DspAudio( DspOut *in, DspOut *out ); virtual ~DspAudio( void );#ifdef QT_THREAD_SUPPORT virtual void run();#else virtual void start( void ) = 0; bool running( void ) { return false; } void wait( void ) { return; } void exit( void ) { return; }#endif virtual void timerTick( void ) = 0; void startTone(char code); void stopTone(void); /* * Generate DTMF if required * returns 1 if DTMF was generated * and 0 if not */ bool generateDTMF(short* buffer, size_t n); void setCancel( void ) { cancel = true; } void setCodec( const codecType newCodec, int newCodecNum );protected: bool isCanceled( void ) { return cancel; } DspOut *input; DspOut *output; bool broken; bool cancel; DTMFGenerator dtmf; AudioBuffer copybuffer; unsigned int dtmfSamples; char newTone; // New DTMF tone to be generated (0 if none) char currentTone; // Tone currently being generated (0 if none)#ifndef QT_THREAD_SUPPORT QTimer *timer;#endif};#endif // DSPTHREAD_H_INCLUDED
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -