comparison base/AudioPlaySource.h @ 0:da6937383da8

initial import
author Chris Cannam
date Tue, 10 Jan 2006 16:33:16 +0000
parents
children d86891498eef
comparison
equal deleted inserted replaced
-1:000000000000 0:da6937383da8
1 /* -*- c-basic-offset: 4 -*- vi:set ts=8 sts=4 sw=4: */
2
3 /*
4 A waveform viewer and audio annotation editor.
5 Chris Cannam, Queen Mary University of London, 2005
6
7 This is experimental software. Not for distribution.
8 */
9
10 #ifndef _AUDIO_PLAY_SOURCE_H_
11 #define _AUDIO_PLAY_SOURCE_H_
12
13 /**
14 * Simple interface for audio playback. This should be all that the
15 * ViewManager needs to know about to synchronise with playback by
16 * sample frame, but it doesn't provide enough to determine what is
17 * actually being played or how. See the audioio directory for a
18 * concrete subclass.
19 */
20
21 class AudioPlaySource
22 {
23 public:
24 /**
25 * Start playing from the given frame. If playback is already
26 * under way, reseek to the given frame and continue.
27 */
28 virtual void play(size_t startFrame) = 0;
29
30 /**
31 * Stop playback.
32 */
33 virtual void stop() = 0;
34
35 /**
36 * Return whether playback is currently supposed to be happening.
37 */
38 virtual bool isPlaying() const = 0;
39
40 /**
41 * Return the frame number that is currently expected to be coming
42 * out of the speakers. (i.e. compensating for playback latency.)
43 */
44 virtual size_t getCurrentPlayingFrame() = 0;
45
46 /**
47 * Return the current (or thereabouts) output levels in the range
48 * 0.0 -> 1.0, for metering purposes.
49 */
50 virtual bool getOutputLevels(float &left, float &right) = 0;
51 };
52
53 #endif