Chris@43: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ Chris@43: Chris@43: /* Chris@43: Sonic Visualiser Chris@43: An audio file viewer and annotation editor. Chris@43: Centre for Digital Music, Queen Mary, University of London. Chris@43: This file copyright 2006 Chris Cannam. Chris@43: Chris@43: This program is free software; you can redistribute it and/or Chris@43: modify it under the terms of the GNU General Public License as Chris@43: published by the Free Software Foundation; either version 2 of the Chris@43: License, or (at your option) any later version. See the file Chris@43: COPYING included with this distribution for more information. Chris@43: */ Chris@43: Chris@43: #ifndef _AUDIO_CALLBACK_PLAY_TARGET_H_ Chris@43: #define _AUDIO_CALLBACK_PLAY_TARGET_H_ Chris@43: Chris@43: #include Chris@43: Chris@43: class AudioCallbackPlaySource; Chris@43: Chris@43: class AudioCallbackPlayTarget : public QObject Chris@43: { Chris@43: Q_OBJECT Chris@43: Chris@43: public: Chris@43: AudioCallbackPlayTarget(AudioCallbackPlaySource *source); Chris@43: virtual ~AudioCallbackPlayTarget(); Chris@43: Chris@43: virtual bool isOK() const = 0; Chris@43: Chris@70: virtual void shutdown() = 0; Chris@70: Chris@91: virtual double getCurrentTime() const = 0; Chris@91: Chris@43: float getOutputGain() const { Chris@43: return m_outputGain; Chris@43: } Chris@43: Chris@43: public slots: Chris@43: /** Chris@43: * Set the playback gain (0.0 = silence, 1.0 = levels unmodified) Chris@43: */ Chris@43: virtual void setOutputGain(float gain); Chris@43: Chris@43: /** Chris@43: * The main source model (providing the playback sample rate) has Chris@43: * been changed. The target should query the source's sample Chris@43: * rate, set its output sample rate accordingly, and call back on Chris@43: * the source's setTargetSampleRate to indicate what sample rate Chris@43: * it succeeded in setting at the output. If this differs from Chris@43: * the model rate, the source will resample. Chris@43: */ Chris@43: virtual void sourceModelReplaced() = 0; Chris@43: Chris@43: protected: Chris@43: AudioCallbackPlaySource *m_source; Chris@43: float m_outputGain; Chris@43: }; Chris@43: Chris@43: #endif Chris@43: