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