comparison audioio/AudioCallbackPlayTarget.h @ 0:cd5d7ff8ef38

* Reorganising code base. This revision will not compile.
author Chris Cannam
date Mon, 31 Jul 2006 12:03:45 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:cd5d7ff8ef38
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2
3 /*
4 Sonic Visualiser
5 An audio file viewer and annotation editor.
6 Centre for Digital Music, Queen Mary, University of London.
7 This file copyright 2006 Chris Cannam.
8
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License as
11 published by the Free Software Foundation; either version 2 of the
12 License, or (at your option) any later version. See the file
13 COPYING included with this distribution for more information.
14 */
15
16 #ifndef _AUDIO_CALLBACK_PLAY_TARGET_H_
17 #define _AUDIO_CALLBACK_PLAY_TARGET_H_
18
19 #include <QObject>
20
21 class AudioCallbackPlaySource;
22
23 class AudioCallbackPlayTarget : public QObject
24 {
25 Q_OBJECT
26
27 public:
28 AudioCallbackPlayTarget(AudioCallbackPlaySource *source);
29 virtual ~AudioCallbackPlayTarget();
30
31 virtual bool isOK() const = 0;
32
33 float getOutputGain() const {
34 return m_outputGain;
35 }
36
37 public slots:
38 /**
39 * Set the playback gain (0.0 = silence, 1.0 = levels unmodified)
40 */
41 virtual void setOutputGain(float gain);
42
43 /**
44 * The main source model (providing the playback sample rate) has
45 * been changed. The target should query the source's sample
46 * rate, set its output sample rate accordingly, and call back on
47 * the source's setTargetSampleRate to indicate what sample rate
48 * it succeeded in setting at the output. If this differs from
49 * the model rate, the source will resample.
50 */
51 virtual void sourceModelReplaced() = 0;
52
53 protected:
54 AudioCallbackPlaySource *m_source;
55 float m_outputGain;
56 };
57
58 #endif
59