svcore  1.9
AudioPlaySource.h
Go to the documentation of this file.
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_PLAY_SOURCE_H_
17 #define _AUDIO_PLAY_SOURCE_H_
18 
19 struct Auditionable {
20  virtual ~Auditionable() { }
21 };
22 
32 {
33 public:
34  virtual ~AudioPlaySource() { }
35 
40  virtual void play(int startFrame) = 0;
41 
45  virtual void stop() = 0;
46 
50  virtual bool isPlaying() const = 0;
51 
56  virtual int getCurrentPlayingFrame() = 0;
57 
62  virtual bool getOutputLevels(float &left, float &right) = 0;
63 
68  virtual int getSourceSampleRate() const = 0;
69 
75  virtual int getTargetSampleRate() const = 0;
76 
83  virtual int getTargetBlockSize() const = 0;
84 
91  virtual int getTargetChannelCount() const = 0;
92 
97  virtual void setAuditioningEffect(Auditionable *) = 0;
98 
99 };
100 
101 #endif
Simple interface for audio playback.
virtual int getSourceSampleRate() const =0
Return the sample rate of the source material – any material that wants to play at a different rate w...
virtual int getTargetChannelCount() const =0
Get the number of channels of audio that will be provided to the play target.
virtual bool isPlaying() const =0
Return whether playback is currently supposed to be happening.
virtual void setAuditioningEffect(Auditionable *)=0
Set a plugin or other subclass of Auditionable as an auditioning effect.
virtual ~Auditionable()
virtual int getCurrentPlayingFrame()=0
Return the frame number that is currently expected to be coming out of the speakers.
virtual ~AudioPlaySource()
virtual int getTargetSampleRate() const =0
Return the sample rate set by the target audio device (or the source sample rate if the target hasn't...
virtual bool getOutputLevels(float &left, float &right)=0
Return the current (or thereabouts) output levels in the range 0.0 -> 1.0, for metering purposes.
virtual int getTargetBlockSize() const =0
Get the block size of the target audio device.
virtual void stop()=0
Stop playback.
virtual void play(int startFrame)=0
Start playing from the given frame.