1
/**************************************************************************
2
Lightspark, a free flash player implementation
4
Copyright (C) 2009,2010 Alessandro Pignotti (a.pignotti@sssup.it)
5
Copyright (C) 2010 Alexandre Demers (papouta@hotmail.com)
7
This program is free software: you can redistribute it and/or modify
8
it under the terms of the GNU Lesser General Public License as published by
9
the Free Software Foundation, either version 3 of the License, or
10
(at your option) any later version.
12
This program is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
GNU Lesser General Public License for more details.
17
You should have received a copy of the GNU Lesser General Public License
18
along with this program. If not, see <http://www.gnu.org/licenses/>.
19
**************************************************************************/
21
#ifndef IAUDIOPLUGIN_H
22
#define IAUDIOPLUGIN_H
24
#include "../../../compat.h"
25
#include "../../decoder.h"
26
#include "../IPlugin.h"
34
AudioStream(lightspark::AudioDecoder *dec = NULL, bool initPause = false);
37
lightspark::AudioDecoder *decoder;
38
bool pause; //Indicates whether the stream is paused as a result of pauseStream being called
39
virtual bool paused() = 0; //Is the stream paused? (corked)
40
virtual uint32_t getPlayedTime() = 0;
41
virtual void fill() = 0;
42
virtual ~AudioStream() {};
45
/**********************
46
Abstract class for audio plugin implementation
47
***********************/
48
class IAudioPlugin : public IPlugin
51
string playbackDeviceName;
52
string captureDeviceName;
53
vector<string *> playbackDevicesList;
54
vector<string *> captureDevicesList;
55
list<AudioStream *> streams;
56
typedef list<AudioStream *>::iterator stream_iterator;
57
volatile bool contextReady;
58
volatile bool noServer;
60
IAudioPlugin ( string plugin_name, string backend_name, bool init_stopped = false );
63
enum DEVICE_TYPES { PLAYBACK, CAPTURE };
64
virtual vector<string *> *get_devicesList ( DEVICE_TYPES desiredType );
65
virtual void set_device ( string desiredDevice, DEVICE_TYPES desiredType ) = 0;
66
virtual string get_device ( DEVICE_TYPES desiredType );
67
virtual AudioStream *createStream ( lightspark::AudioDecoder *decoder ) = 0;
68
virtual void freeStream ( AudioStream *audioStream ) = 0;
69
virtual void pauseStream( AudioStream *audioStream ) = 0; //Pause the stream (stops time from running, cork)
70
virtual void resumeStream( AudioStream *audioStream ) = 0; //Resume the stream (restart time, uncork)
71
virtual bool isTimingAvailable() const = 0;
72
virtual ~IAudioPlugin();