28 |
#include "common/global.h" |
#include "common/global.h" |
29 |
#include "common/LinuxSamplerException.h" |
#include "common/LinuxSamplerException.h" |
30 |
#include "engines/common/Engine.h" |
#include "engines/common/Engine.h" |
31 |
#include "mididriver/MidiInputDevice.h" |
#include "drivers/midi/MidiInputDevice.h" |
32 |
#include "audiodriver/AudioOutputDevice.h" |
#include "drivers/audio/AudioOutputDevice.h" |
33 |
|
|
34 |
namespace LinuxSampler { |
namespace LinuxSampler { |
35 |
|
|
152 |
|
|
153 |
/** Getting MIDI input device port given its index number. */ |
/** Getting MIDI input device port given its index number. */ |
154 |
MidiInputDevice::MidiInputPort* GetMidiInputDevicePort(int MidiPort); |
MidiInputDevice::MidiInputPort* GetMidiInputDevicePort(int MidiPort); |
155 |
|
|
156 |
Sampler* pSampler; |
Sampler* pSampler; |
157 |
Engine* pEngine; |
Engine* pEngine; |
158 |
AudioOutputDevice* pAudioOutputDevice; |
AudioOutputDevice* pAudioOutputDevice; |
230 |
uint SamplerChannels(); |
uint SamplerChannels(); |
231 |
|
|
232 |
/** |
/** |
233 |
* Create and add a new sampler channel to this Sampler instance. |
* Create and add a new sampler channel to this Sampler |
234 |
|
* instance. For race condition reasons the new channel will use |
235 |
|
* an index past the last already existing sampler channel |
236 |
|
* index (in case the index limit was not reached yet, otherwise |
237 |
|
* a free index starting from 0 is searched). |
238 |
* |
* |
239 |
* @returns pointer to new sampler channel |
* @returns pointer to new sampler channel |
240 |
*/ |
*/ |
249 |
SamplerChannel* GetSamplerChannel(uint uiSamplerChannel); |
SamplerChannel* GetSamplerChannel(uint uiSamplerChannel); |
250 |
|
|
251 |
/** |
/** |
252 |
|
* Returns all created sampler channels. |
253 |
|
*/ |
254 |
|
std::map<uint, SamplerChannel*> GetSamplerChannels(); |
255 |
|
|
256 |
|
/** |
257 |
* Destroy and remove the given sampler channel from this |
* Destroy and remove the given sampler channel from this |
258 |
* Sampler instance. |
* Sampler instance. |
259 |
* |
* |
270 |
*/ |
*/ |
271 |
void RemoveSamplerChannel(uint uiSamplerChannel); |
void RemoveSamplerChannel(uint uiSamplerChannel); |
272 |
|
|
273 |
|
/** |
274 |
|
* Returns the names of all available audio output drivers. |
275 |
|
*/ |
276 |
std::vector<String> AvailableAudioOutputDrivers(); |
std::vector<String> AvailableAudioOutputDrivers(); |
277 |
|
|
278 |
/** |
/** |
297 |
*/ |
*/ |
298 |
MidiInputDevice* CreateMidiInputDevice(String MidiDriver, std::map<String,String> Parameters) throw (LinuxSamplerException); |
MidiInputDevice* CreateMidiInputDevice(String MidiDriver, std::map<String,String> Parameters) throw (LinuxSamplerException); |
299 |
|
|
300 |
|
/** |
301 |
|
* Returns the number of all created audio output devices. |
302 |
|
*/ |
303 |
uint AudioOutputDevices(); |
uint AudioOutputDevices(); |
304 |
|
|
305 |
|
/** |
306 |
|
* Returns the number of all created MIDI input devices. |
307 |
|
*/ |
308 |
uint MidiInputDevices(); |
uint MidiInputDevices(); |
309 |
|
|
310 |
|
/** |
311 |
|
* Returns all created audio output devices. |
312 |
|
*/ |
313 |
std::map<uint, AudioOutputDevice*> GetAudioOutputDevices(); |
std::map<uint, AudioOutputDevice*> GetAudioOutputDevices(); |
314 |
|
|
315 |
|
/** |
316 |
|
* Returns all created MIDI input devices. |
317 |
|
*/ |
318 |
std::map<uint, MidiInputDevice*> GetMidiInputDevices(); |
std::map<uint, MidiInputDevice*> GetMidiInputDevices(); |
319 |
|
|
320 |
|
/** |
321 |
|
* Destroy the given audio output device and takes care if there |
322 |
|
* are still sampler angines connected to this device, etc. |
323 |
|
* |
324 |
|
* @throws LinuxSamplerException if sampler channels are still |
325 |
|
* connected to the device |
326 |
|
*/ |
327 |
void DestroyAudioOutputDevice(AudioOutputDevice* pDevice) throw (LinuxSamplerException); |
void DestroyAudioOutputDevice(AudioOutputDevice* pDevice) throw (LinuxSamplerException); |
328 |
void DestroyMidiInputDevice(MidiInputDevice* pDevice) throw (LinuxSamplerException); |
|
329 |
|
/** |
330 |
|
* Destroy the given MIDI input device and takes care if there |
331 |
|
* are still sampler angines connected to this device, etc. |
332 |
|
* |
333 |
|
* @throws LinuxSamplerException if sampler channels are still |
334 |
|
* connected to the device |
335 |
|
*/ |
336 |
|
void DestroyMidiInputDevice(MidiInputDevice* pDevice) throw (LinuxSamplerException); |
337 |
|
|
338 |
protected: |
protected: |
339 |
typedef std::map<uint, AudioOutputDevice*> AudioOutputDeviceMap; |
typedef std::map<uint, AudioOutputDevice*> AudioOutputDeviceMap; |
340 |
typedef std::map<uint, MidiInputDevice*> MidiInputDeviceMap; |
typedef std::map<uint, MidiInputDevice*> MidiInputDeviceMap; |
341 |
|
typedef std::map<uint, SamplerChannel*> SamplerChannelMap; |
342 |
|
|
343 |
std::vector<SamplerChannel*> vSamplerChannels; ///< contains all created sampler channels |
SamplerChannelMap mSamplerChannels; ///< contains all created sampler channels |
344 |
AudioOutputDeviceMap mAudioOutputDevices; ///< contains all created audio output devices |
AudioOutputDeviceMap mAudioOutputDevices; ///< contains all created audio output devices |
345 |
MidiInputDeviceMap mMidiInputDevices; |
MidiInputDeviceMap mMidiInputDevices; ///< contains all created MIDI input devices |
346 |
|
|
347 |
friend class SamplerChannel; |
friend class SamplerChannel; |
348 |
}; |
}; |