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 device. |
|
* 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 pDevice - MIDI input device to connect to |
73 |
|
*/ |
74 |
|
void SetMidiInputDevice(MidiInputDevice *pDevice); |
75 |
|
|
76 |
|
/** |
77 |
|
* Connect this sampler channel to and MIDI input port. |
78 |
|
* |
79 |
|
* @param MidiPort - MIDI port to connect to |
80 |
|
*/ |
81 |
|
void SetMidiInputPort(int MidiPort); |
82 |
|
|
83 |
|
/** |
84 |
|
* Connect this sampler channel to and MIDI input channel. |
85 |
|
* |
86 |
|
* @param MidiChannel - MIDI channel to connect to |
87 |
|
*/ |
88 |
|
void SetMidiInputChannel(MidiInputDevice::MidiInputPort::midi_chan_t MidiChannel); |
89 |
|
|
90 |
|
/** |
91 |
|
* Connect this sampler channel to a MIDI input triplet. |
92 |
|
* |
93 |
|
* @param pDevice - MIDI input device to connect to |
94 |
|
* @param MidiPort - MIDI port to connect to |
95 |
* @param MidiChannel - optional: MIDI channel on which the |
* @param MidiChannel - optional: MIDI channel on which the |
96 |
* sampler channel should listen to |
* sampler channel should listen to |
97 |
* (default: listen on all MIDI channels) |
* (default: listen on all MIDI channels) |
98 |
*/ |
*/ |
99 |
void SetMidiInputDevice(MidiInputDevice::type_t MidiType, MidiInputDevice::midi_chan_t MidiChannel = MidiInputDevice::midi_chan_all); // TODO: 'MidiType' type to be changed to 'MidiInputDevice*' |
void SetMidiInput(MidiInputDevice* pDevice, int MidiPort, MidiInputDevice::MidiInputPort::midi_chan_t MidiChannel = MidiInputDevice::MidiInputPort::midi_chan_all); |
100 |
|
|
101 |
/** |
/** |
102 |
* Returns the engine that was deployed on this sampler channel. |
* Returns the engine that was deployed on this sampler channel. |
106 |
Engine* GetEngine(); |
Engine* GetEngine(); |
107 |
|
|
108 |
/** |
/** |
109 |
* Returns the MIDI input device to which this sampler channel |
* Returns the MIDI input channel to which this sampler |
110 |
* is currently connected to. |
* channel is currently connected to. |
111 |
* |
* |
112 |
* @returns pointer to MIDI input device or NULL if not |
* @returns The MIDI input channel on which the sampler |
113 |
* connected |
* channel is listening to. |
114 |
*/ |
*/ |
115 |
MidiInputDevice* GetMidiInputDevice(); |
MidiInputDevice::MidiInputPort::midi_chan_t GetMidiInputChannel(); |
116 |
|
|
117 |
|
/** |
118 |
|
* Returns the MIDI input port number to which this sampler |
119 |
|
* channel is currently connected to. |
120 |
|
* |
121 |
|
* @returns MIDI input port number or -1 if not connected |
122 |
|
*/ |
123 |
|
int GetMidiInputPort(); |
124 |
|
|
125 |
/** |
/** |
126 |
* Returns the audio output device to which this sampler channel |
* Returns the audio output device to which this sampler channel |
132 |
AudioOutputDevice* GetAudioOutputDevice(); |
AudioOutputDevice* GetAudioOutputDevice(); |
133 |
|
|
134 |
/** |
/** |
135 |
|
* Returns the MIDI input device to which this sampler channel |
136 |
|
* is currently connected to. |
137 |
|
* |
138 |
|
* @returns pointer to MIDI input device or NULL if not |
139 |
|
* connected |
140 |
|
*/ |
141 |
|
MidiInputDevice* GetMidiInputDevice(); |
142 |
|
|
143 |
|
/** |
144 |
* Returns the index number of this sampler channel within the |
* Returns the index number of this sampler channel within the |
145 |
* Sampler instance. |
* Sampler instance. |
146 |
*/ |
*/ |
150 |
SamplerChannel(Sampler* pS); |
SamplerChannel(Sampler* pS); |
151 |
~SamplerChannel(); |
~SamplerChannel(); |
152 |
|
|
153 |
|
/** Getting MIDI input device port given its index number. */ |
154 |
|
MidiInputDevice::MidiInputPort* GetMidiInputDevicePort(int MidiPort); |
155 |
|
|
156 |
Sampler* pSampler; |
Sampler* pSampler; |
157 |
Engine* pEngine; |
Engine* pEngine; |
|
MidiInputDevice* pMidiInputDevice; |
|
158 |
AudioOutputDevice* pAudioOutputDevice; |
AudioOutputDevice* pAudioOutputDevice; |
159 |
|
MidiInputDevice* pMidiInputDevice; |
160 |
|
int midiPort; |
161 |
|
MidiInputDevice::MidiInputPort::midi_chan_t midiChannel; |
162 |
int iIndex; |
int iIndex; |
163 |
|
|
164 |
friend class Sampler; |
friend class Sampler; |
264 |
std::vector<String> AvailableAudioOutputDrivers(); |
std::vector<String> AvailableAudioOutputDrivers(); |
265 |
|
|
266 |
/** |
/** |
267 |
* Create an audio output device of the given type. |
* Create an audio output device. |
268 |
* |
* |
269 |
* @param AudioDriver - name of the audio driver |
* @param AudioDriver - name of the audio driver |
270 |
* @param Parameters - eventually needed driver parameters to |
* @param Parameters - eventually needed driver parameters to |
274 |
*/ |
*/ |
275 |
AudioOutputDevice* CreateAudioOutputDevice(String AudioDriver, std::map<String,String> Parameters) throw (LinuxSamplerException); |
AudioOutputDevice* CreateAudioOutputDevice(String AudioDriver, std::map<String,String> Parameters) throw (LinuxSamplerException); |
276 |
|
|
277 |
|
/** |
278 |
|
* Create a midi input device. |
279 |
|
* |
280 |
|
* @param MidiDriver - name of the midi driver |
281 |
|
* @param Parameters - eventually needed driver parameters to |
282 |
|
* create the device |
283 |
|
* @returns pointer to created midi input device |
284 |
|
* @throws LinuxSamplerException if device could not be created |
285 |
|
*/ |
286 |
|
MidiInputDevice* CreateMidiInputDevice(String MidiDriver, std::map<String,String> Parameters) throw (LinuxSamplerException); |
287 |
|
|
288 |
uint AudioOutputDevices(); |
uint AudioOutputDevices(); |
289 |
|
uint MidiInputDevices(); |
290 |
|
|
291 |
std::map<uint, AudioOutputDevice*> GetAudioOutputDevices(); |
std::map<uint, AudioOutputDevice*> GetAudioOutputDevices(); |
292 |
|
|
293 |
void DestroyAudioOutputDevice(AudioOutputDevice* pDevice) throw (LinuxSamplerException); |
std::map<uint, MidiInputDevice*> GetMidiInputDevices(); |
|
|
|
|
/** |
|
|
* Create a MIDI input device of the given type. |
|
|
* |
|
|
* @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);' |
|
294 |
|
|
295 |
/** |
void DestroyAudioOutputDevice(AudioOutputDevice* pDevice) throw (LinuxSamplerException); |
296 |
* Returns the MIDI input device of the given type. |
void DestroyMidiInputDevice(MidiInputDevice* pDevice) throw (LinuxSamplerException); |
|
* |
|
|
* @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); |
|
297 |
|
|
298 |
protected: |
protected: |
299 |
typedef std::map<uint, AudioOutputDevice*> AudioOutputDeviceMap; |
typedef std::map<uint, AudioOutputDevice*> AudioOutputDeviceMap; |
300 |
typedef std::map<MidiInputDevice::type_t, MidiInputDevice*> MidiInputDeviceMap; |
typedef std::map<uint, MidiInputDevice*> MidiInputDeviceMap; |
301 |
|
|
302 |
std::vector<SamplerChannel*> vSamplerChannels; ///< contains all created sampler channels |
std::vector<SamplerChannel*> vSamplerChannels; ///< contains all created sampler channels |
303 |
AudioOutputDeviceMap mAudioOutputDevices; ///< contains all created audio output devices |
AudioOutputDeviceMap mAudioOutputDevices; ///< contains all created audio output devices |
304 |
MidiInputDeviceMap MidiInputDevices; |
MidiInputDeviceMap mMidiInputDevices; |
|
|
|
|
template<class T> inline String ToString(T o) { |
|
|
std::stringstream ss; |
|
|
ss << o; |
|
|
return ss.str(); |
|
|
} |
|
305 |
|
|
306 |
friend class SamplerChannel; |
friend class SamplerChannel; |
307 |
}; |
}; |