67 |
void SetAudioOutputDevice(AudioOutputDevice* pDevice); |
void SetAudioOutputDevice(AudioOutputDevice* pDevice); |
68 |
|
|
69 |
/** |
/** |
70 |
* Connect this sampler channel to and MIDI input device (that |
* Connect this sampler channel to and MIDI input port |
|
* is MIDI input driver) of the given type. If the MIDI input |
|
|
* driver for the desired MIDI input system is not yet created, |
|
|
* then it will be created automatically, but with default |
|
|
* settings though. If this sampler channel was already |
|
|
* connected to a MIDI input device, then the old connection |
|
|
* will automatically be removed before. |
|
71 |
* |
* |
72 |
* @param MidiType - MIDI input system to connect to |
* @param MidiInputDevice - MIDI input device to connect to |
73 |
|
* @param MidiInputPort - MIDI port to connect to |
74 |
* @param MidiChannel - optional: MIDI channel on which the |
* @param MidiChannel - optional: MIDI channel on which the |
75 |
* sampler channel should listen to |
* sampler channel should listen to |
76 |
* (default: listen on all MIDI channels) |
* (default: listen on all MIDI channels) |
77 |
*/ |
*/ |
78 |
void SetMidiInputDevice(MidiInputDevice::type_t MidiType, MidiInputDevice::midi_chan_t MidiChannel = MidiInputDevice::midi_chan_all); // TODO: 'MidiType' type to be changed to 'MidiInputDevice*' |
void SetMidiInputPort(MidiInputDevice* pDevice, int midiPort, MidiInputDevice::MidiInputPort::midi_chan_t MidiChannel = MidiInputDevice::MidiInputPort::midi_chan_all); |
79 |
|
|
80 |
/** |
/** |
81 |
* Returns the engine that was deployed on this sampler channel. |
* Returns the engine that was deployed on this sampler channel. |
91 |
* @returns pointer to MIDI input device or NULL if not |
* @returns pointer to MIDI input device or NULL if not |
92 |
* connected |
* connected |
93 |
*/ |
*/ |
94 |
MidiInputDevice* GetMidiInputDevice(); |
MidiInputDevice::MidiInputPort* GetMidiInputPort(); |
95 |
|
|
96 |
/** |
/** |
97 |
* Returns the audio output device to which this sampler channel |
* Returns the audio output device to which this sampler channel |
103 |
AudioOutputDevice* GetAudioOutputDevice(); |
AudioOutputDevice* GetAudioOutputDevice(); |
104 |
|
|
105 |
/** |
/** |
106 |
|
* Returns the audio output device to which this sampler channel |
107 |
|
* is currently connected to. |
108 |
|
* |
109 |
|
* @returns pointer to audio output device or NULL if not |
110 |
|
* connected |
111 |
|
*/ |
112 |
|
MidiInputDevice* GetMidiInputDevice(); |
113 |
|
|
114 |
|
/** |
115 |
* Returns the index number of this sampler channel within the |
* Returns the index number of this sampler channel within the |
116 |
* Sampler instance. |
* Sampler instance. |
117 |
*/ |
*/ |
118 |
uint Index(); |
uint Index(); |
119 |
|
|
120 |
|
/** |
121 |
|
* Returns midi channel |
122 |
|
*/ |
123 |
|
MidiInputDevice::MidiInputPort::midi_chan_t GetMidiInputChannel() { return midiChannel; } |
124 |
|
|
125 |
protected: |
protected: |
126 |
SamplerChannel(Sampler* pS); |
SamplerChannel(Sampler* pS); |
127 |
~SamplerChannel(); |
~SamplerChannel(); |
128 |
|
|
129 |
Sampler* pSampler; |
Sampler* pSampler; |
130 |
Engine* pEngine; |
Engine* pEngine; |
131 |
MidiInputDevice* pMidiInputDevice; |
MidiInputDevice::MidiInputPort* pMidiInputPort; |
132 |
AudioOutputDevice* pAudioOutputDevice; |
AudioOutputDevice* pAudioOutputDevice; |
133 |
int iIndex; |
int iIndex; |
134 |
|
MidiInputDevice::MidiInputPort::midi_chan_t midiChannel; |
135 |
|
|
136 |
friend class Sampler; |
friend class Sampler; |
137 |
}; |
}; |
236 |
std::vector<String> AvailableAudioOutputDrivers(); |
std::vector<String> AvailableAudioOutputDrivers(); |
237 |
|
|
238 |
/** |
/** |
239 |
* Create an audio output device of the given type. |
* Create an audio output device. |
240 |
* |
* |
241 |
* @param AudioDriver - name of the audio driver |
* @param AudioDriver - name of the audio driver |
242 |
* @param Parameters - eventually needed driver parameters to |
* @param Parameters - eventually needed driver parameters to |
246 |
*/ |
*/ |
247 |
AudioOutputDevice* CreateAudioOutputDevice(String AudioDriver, std::map<String,String> Parameters) throw (LinuxSamplerException); |
AudioOutputDevice* CreateAudioOutputDevice(String AudioDriver, std::map<String,String> Parameters) throw (LinuxSamplerException); |
248 |
|
|
249 |
|
/** |
250 |
|
* Create a midi input device. |
251 |
|
* |
252 |
|
* @param MidiDriver - name of the midi driver |
253 |
|
* @param Parameters - eventually needed driver parameters to |
254 |
|
* create the device |
255 |
|
* @returns pointer to created midi input device |
256 |
|
* @throws LinuxSamplerException if device could not be created |
257 |
|
*/ |
258 |
|
MidiInputDevice* CreateMidiInputDevice(String MidiDriver, std::map<String,String> Parameters) throw (LinuxSamplerException); |
259 |
|
|
260 |
uint AudioOutputDevices(); |
uint AudioOutputDevices(); |
261 |
|
uint MidiInputDevices(); |
262 |
|
|
263 |
std::map<uint, AudioOutputDevice*> GetAudioOutputDevices(); |
std::map<uint, AudioOutputDevice*> GetAudioOutputDevices(); |
264 |
|
|
265 |
void DestroyAudioOutputDevice(AudioOutputDevice* pDevice) throw (LinuxSamplerException); |
std::map<uint, MidiInputDevice*> GetMidiInputDevices(); |
266 |
|
|
267 |
/** |
void DestroyAudioOutputDevice(AudioOutputDevice* pDevice) throw (LinuxSamplerException); |
268 |
* Create a MIDI input device of the given type. |
void DestroyMidiInputDevice(MidiInputDevice* pDevice) throw (LinuxSamplerException); |
|
* |
|
|
* @param MidiType - desired MIDI input system to use |
|
|
* @returns pointer to created MIDI input device |
|
|
*/ |
|
|
MidiInputDevice* CreateMidiInputDevice(MidiInputDevice::type_t MidiType); //TODO: to be changed to 'MidiInputDevice* CreateMidiInputDevice(String MidiDriver, std::map<String,String> Parameters) throw (LinuxSamplerException);' |
|
|
|
|
|
/** |
|
|
* Returns the MIDI input device of the given type. |
|
|
* |
|
|
* @param MidiType - desired MIDI input system to use |
|
|
* @returns pointer to MIDI input device or NULL if device of |
|
|
* desired type is not yet created |
|
|
*/ |
|
|
MidiInputDevice* GetMidiInputDevice(MidiInputDevice::type_t MidiType); |
|
269 |
|
|
270 |
protected: |
protected: |
271 |
typedef std::map<uint, AudioOutputDevice*> AudioOutputDeviceMap; |
typedef std::map<uint, AudioOutputDevice*> AudioOutputDeviceMap; |
272 |
typedef std::map<MidiInputDevice::type_t, MidiInputDevice*> MidiInputDeviceMap; |
typedef std::map<uint, MidiInputDevice*> MidiInputDeviceMap; |
273 |
|
|
274 |
std::vector<SamplerChannel*> vSamplerChannels; ///< contains all created sampler channels |
std::vector<SamplerChannel*> vSamplerChannels; ///< contains all created sampler channels |
275 |
AudioOutputDeviceMap mAudioOutputDevices; ///< contains all created audio output devices |
AudioOutputDeviceMap mAudioOutputDevices; ///< contains all created audio output devices |
276 |
MidiInputDeviceMap MidiInputDevices; |
MidiInputDeviceMap mMidiInputDevices; |
277 |
|
|
278 |
template<class T> inline String ToString(T o) { |
template<class T> inline String ToString(T o) { |
279 |
std::stringstream ss; |
std::stringstream ss; |