3 |
* LinuxSampler - modular, streaming capable sampler * |
* LinuxSampler - modular, streaming capable sampler * |
4 |
* * |
* * |
5 |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
6 |
* Copyright (C) 2005, 2006 Christian Schoenebeck * |
* Copyright (C) 2005 - 2009 Christian Schoenebeck * |
7 |
* * |
* * |
8 |
* This program is free software; you can redistribute it and/or modify * |
* This program is free software; you can redistribute it and/or modify * |
9 |
* it under the terms of the GNU General Public License as published by * |
* it under the terms of the GNU General Public License as published by * |
36 |
#include "../../engines/Engine.h" |
#include "../../engines/Engine.h" |
37 |
#include "AudioChannel.h" |
#include "AudioChannel.h" |
38 |
#include "../../common/SynchronizedConfig.h" |
#include "../../common/SynchronizedConfig.h" |
39 |
|
#include "../../effects/EffectChain.h" |
40 |
|
|
41 |
namespace LinuxSampler { |
namespace LinuxSampler { |
42 |
|
|
43 |
// just symbol prototyping |
// just symbol prototyping |
44 |
class Engine; |
class Engine; |
45 |
|
class AudioOutputDeviceFactory; |
46 |
|
class IDGenerator; |
47 |
|
|
48 |
/** Abstract base class for audio output drivers in LinuxSampler |
/** Abstract base class for audio output drivers in LinuxSampler |
49 |
* |
* |
90 |
virtual optional<int> RangeMinAsInt(std::map<String,String> Parameters); |
virtual optional<int> RangeMinAsInt(std::map<String,String> Parameters); |
91 |
virtual optional<int> RangeMaxAsInt(std::map<String,String> Parameters); |
virtual optional<int> RangeMaxAsInt(std::map<String,String> Parameters); |
92 |
virtual std::vector<int> PossibilitiesAsInt(std::map<String,String> Parameters); |
virtual std::vector<int> PossibilitiesAsInt(std::map<String,String> Parameters); |
93 |
|
virtual int ValueAsInt(); |
94 |
virtual void OnSetValue(int i) throw (Exception); |
virtual void OnSetValue(int i) throw (Exception); |
95 |
static String Name(); |
static String Name(); |
96 |
}; |
}; |
244 |
*/ |
*/ |
245 |
std::map<String,DeviceCreationParameter*> DeviceParameters(); |
std::map<String,DeviceCreationParameter*> DeviceParameters(); |
246 |
|
|
247 |
|
/** |
248 |
|
* Add a chain of master effects to this AudioOutputDevice. |
249 |
|
* You actually have to add effects to that chain afterwards. |
250 |
|
*/ |
251 |
|
EffectChain* AddMasterEffectChain(); |
252 |
|
|
253 |
|
/** |
254 |
|
* Remove the master effect chain given by @a iChain . |
255 |
|
* |
256 |
|
* @throws Exception - if given master effect chain doesn't exist |
257 |
|
*/ |
258 |
|
void RemoveMasterEffectChain(uint iChain) throw (Exception); |
259 |
|
|
260 |
|
/** |
261 |
|
* Returns master effect chain given by @a iChain or @c NULL if |
262 |
|
* there's no such effect chain. |
263 |
|
*/ |
264 |
|
EffectChain* MasterEffectChain(uint iChain) const; |
265 |
|
|
266 |
|
/** |
267 |
|
* Returns amount of master effect chains this AudioOutputDevice |
268 |
|
* currently provides. |
269 |
|
*/ |
270 |
|
uint MasterEffectChainCount() const; |
271 |
|
|
272 |
protected: |
protected: |
273 |
SynchronizedConfig<std::set<Engine*> > Engines; ///< All sampler engines that are connected to the audio output device. |
SynchronizedConfig<std::set<Engine*> > Engines; ///< All sampler engines that are connected to the audio output device. |
274 |
SynchronizedConfig<std::set<Engine*> >::Reader EnginesReader; ///< Audio thread access to Engines. |
SynchronizedConfig<std::set<Engine*> >::Reader EnginesReader; ///< Audio thread access to Engines. |
275 |
std::vector<AudioChannel*> Channels; ///< All audio channels of the audio output device. This is just a container; the descendant has to create channels by himself. |
std::vector<AudioChannel*> Channels; ///< All audio channels of the audio output device. This is just a container; the descendant has to create channels by himself. |
276 |
std::map<String,DeviceCreationParameter*> Parameters; ///< All device parameters. |
std::map<String,DeviceCreationParameter*> Parameters; ///< All device parameters. |
277 |
|
std::vector<EffectChain*> vEffectChains; |
278 |
|
IDGenerator* EffectChainIDs; |
279 |
|
|
280 |
AudioOutputDevice(std::map<String,DeviceCreationParameter*> DriverParameters); |
AudioOutputDevice(std::map<String,DeviceCreationParameter*> DriverParameters); |
281 |
|
|
306 |
*/ |
*/ |
307 |
int RenderSilence(uint Samples); |
int RenderSilence(uint Samples); |
308 |
|
|
309 |
friend class Sampler; // allow Sampler class to destroy audio devices |
friend class AudioOutputDeviceFactory; // allow AudioOutputDeviceFactory class to destroy audio devices |
310 |
|
|
311 |
}; |
}; |
312 |
|
|