116 |
else if (lscp_parser_test(&tok, "AVAILABLE_AUDIO_OUTPUT_DRIVERS")) { |
else if (lscp_parser_test(&tok, "AVAILABLE_AUDIO_OUTPUT_DRIVERS")) { |
117 |
// Getting all available audio output drivers. |
// Getting all available audio output drivers. |
118 |
// GET AVAILABLE_AUDIO_OUTPUT_DRIVERS |
// GET AVAILABLE_AUDIO_OUTPUT_DRIVERS |
119 |
pszResult = "Alsa,Jack,CoreAudio\r\n"; |
pszResult = "Alsa,Jack\r\n"; |
120 |
} |
} |
121 |
else if (lscp_parser_test(&tok, "AVAILABLE_MIDI_INPUT_DRIVERS")) { |
else if (lscp_parser_test(&tok, "AVAILABLE_MIDI_INPUT_DRIVERS")) { |
122 |
// Getting all available MIDI input drivers. |
// Getting all available MIDI input drivers. |
123 |
// GET AVAILABLE_MIDI_INPUT_DRIVERS |
// GET AVAILABLE_MIDI_INPUT_DRIVERS |
124 |
pszResult = "Alsa,MidiShare,CoreMidi\r\n"; |
pszResult = "Alsa\r\n"; |
125 |
} |
} |
126 |
else if (lscp_parser_test2(&tok, "AUDIO_OUTPUT_DRIVER", "INFO")) { |
else if (lscp_parser_test2(&tok, "AUDIO_OUTPUT_DRIVER", "INFO")) { |
127 |
// Getting informations about a specific audio output driver. |
// Getting informations about a specific audio output driver. |
129 |
if (lscp_parser_test(&tok, "Alsa")) { |
if (lscp_parser_test(&tok, "Alsa")) { |
130 |
pszResult = "DESCRIPTION: 'ALSA PCM'\r\n" |
pszResult = "DESCRIPTION: 'ALSA PCM'\r\n" |
131 |
"VERSION: '1.0'\r\n" |
"VERSION: '1.0'\r\n" |
132 |
"PARAMETERS: channels,samplerate,active,card\r\n"; |
"PARAMETERS: channels,samplerate,active\r\n"; |
133 |
} |
} |
134 |
else if (lscp_parser_test(&tok, "Jack")) { |
else if (lscp_parser_test(&tok, "Jack")) { |
135 |
pszResult = "DESCRIPTION: JACK Audio Connection Kit\r\n" |
pszResult = "DESCRIPTION: JACK Audio Connection Kit\r\n" |
151 |
else if (lscp_parser_test2(&tok, "AUDIO_OUTPUT_DRIVER_PARAMETER", "INFO")) { |
else if (lscp_parser_test2(&tok, "AUDIO_OUTPUT_DRIVER_PARAMETER", "INFO")) { |
152 |
// Getting informations about a specific audio output driver parameter. |
// Getting informations about a specific audio output driver parameter. |
153 |
// GET AUDIO_OUTPUT_DRIVER_PARAMETER INFO <audio-output-type> <param> |
// GET AUDIO_OUTPUT_DRIVER_PARAMETER INFO <audio-output-type> <param> |
154 |
if (lscp_parser_test2(&tok, "Alsa", "active")) { |
if (lscp_parser_test(&tok, "Alsa")) { |
155 |
pszResult = "DESCRIPTION: 'ALSA PCM device active state'\r\n" |
if (lscp_parser_test(&tok, "active")) { |
156 |
"TYPE: BOOL\r\n" |
pszResult = "DESCRIPTION: 'ALSA PCM active state'\r\n" |
157 |
"MANDATORY: TRUE\r\n" |
"TYPE: BOOL\r\n" |
158 |
"FIX: TRUE\r\n" |
"MANDATORY: TRUE\r\n" |
159 |
"MULTIPLICITY: FALSE\r\n" |
"FIX: TRUE\r\n" |
160 |
"DEPENDS: channels,samplerate,card\r\n" |
"MULTIPLICITY: FALSE\r\n" |
161 |
"DEFAULT: TRUE\r\n" |
"DEPENDS: channels,samplerate,card\r\n" |
162 |
"RANGE_MIN: FALSE\r\n" |
"DEFAULT: TRUE\r\n" |
163 |
"RANGE_MAX: TRUE\r\n" |
"RANGE_MIN: FALSE\r\n" |
164 |
"POSSIBILITIES: FALSE,TRUE\r\n"; |
"RANGE_MAX: TRUE\r\n" |
165 |
} |
"POSSIBILITIES: FALSE,TRUE\r\n"; |
166 |
else if (lscp_parser_test2(&tok, "Jack", "active")) { |
} |
167 |
pszResult = "DESCRIPTION: 'JACK device active state'\r\n" |
else if (lscp_parser_test(&tok, "channels")) { |
168 |
"TYPE: BOOL\r\n" |
pszResult = "DESCRIPTION: 'Number of ALSA PCM channels'\r\n" |
169 |
"MANDATORY: TRUE\r\n" |
"TYPE: INT\r\n" |
170 |
"FIX: TRUE\r\n" |
"MANDATORY: TRUE\r\n" |
171 |
"MULTIPLICITY: FALSE\r\n" |
"FIX: TRUE\r\n" |
172 |
"DEPENDS: channels,samplerate\r\n" |
"MULTIPLICITY: FALSE\r\n" |
173 |
"DEFAULT: TRUE\r\n" |
"DEFAULT: 2\r\n"; |
174 |
"RANGE_MIN: FALSE\r\n" |
} |
175 |
"RANGE_MAX: TRUE\r\n" |
else if (lscp_parser_test(&tok, "samplerate")) { |
176 |
"POSSIBILITIES: FALSE,TRUE\r\n"; |
pszResult = "DESCRIPTION: 'ALSA PCM sample rate'\r\n" |
177 |
|
"TYPE: INT\r\n" |
178 |
|
"MANDATORY: TRUE\r\n" |
179 |
|
"FIX: TRUE\r\n" |
180 |
|
"MULTIPLICITY: TRUE\r\n" |
181 |
|
"DEFAULT: 44100\r\n" |
182 |
|
"POSSIBILITIES: 44100,48000,96000\r\n"; |
183 |
|
} |
184 |
|
else ret = LSCP_FAILED; |
185 |
|
} |
186 |
|
else if (lscp_parser_test(&tok, "Jack")) { |
187 |
|
if (lscp_parser_test(&tok, "active")) { |
188 |
|
pszResult = "DESCRIPTION: 'JACK active state'\r\n" |
189 |
|
"TYPE: BOOL\r\n" |
190 |
|
"MANDATORY: TRUE\r\n" |
191 |
|
"FIX: TRUE\r\n" |
192 |
|
"MULTIPLICITY: FALSE\r\n" |
193 |
|
"DEPENDS: channels,samplerate\r\n" |
194 |
|
"DEFAULT: TRUE\r\n" |
195 |
|
"RANGE_MIN: FALSE\r\n" |
196 |
|
"RANGE_MAX: TRUE\r\n" |
197 |
|
"POSSIBILITIES: FALSE,TRUE\r\n"; |
198 |
|
} |
199 |
|
else if (lscp_parser_test(&tok, "channels")) { |
200 |
|
pszResult = "DESCRIPTION: 'Number of JACK audio channels'\r\n" |
201 |
|
"TYPE: INT\r\n" |
202 |
|
"MANDATORY: TRUE\r\n" |
203 |
|
"FIX: TRUE\r\n" |
204 |
|
"MULTIPLICITY: FALSE\r\n" |
205 |
|
"DEFAULT: 2\r\n"; |
206 |
|
} |
207 |
|
else if (lscp_parser_test(&tok, "samplerate")) { |
208 |
|
pszResult = "DESCRIPTION: 'JACK sample rate'\r\n" |
209 |
|
"TYPE: INT\r\n" |
210 |
|
"MANDATORY: TRUE\r\n" |
211 |
|
"FIX: TRUE\r\n" |
212 |
|
"MULTIPLICITY: TRUE\r\n" |
213 |
|
"DEFAULT: 44100\r\n" |
214 |
|
"POSSIBILITIES: 44100,48000,96000\r\n"; |
215 |
|
} |
216 |
|
else ret = LSCP_FAILED; |
217 |
} |
} |
218 |
else ret = LSCP_FAILED; |
else ret = LSCP_FAILED; |
219 |
} |
} |
220 |
else if (lscp_parser_test2(&tok, "MIDI_INPUT_DRIVER_PARAMETER", "INFO")) { |
else if (lscp_parser_test2(&tok, "MIDI_INPUT_DRIVER_PARAMETER", "INFO")) { |
221 |
// Getting informations about a specific MIDI input driver parameter. |
// Getting informations about a specific MIDI input driver parameter. |
222 |
// GET MIDI_INPUT_DRIVER_PARAMETER INFO <midi-input-type> <param> |
// GET MIDI_INPUT_DRIVER_PARAMETER INFO <midi-input-type> <param> |
223 |
if (lscp_parser_test2(&tok, "Alsa", "active")) { |
if (lscp_parser_test(&tok, "Alsa")) { |
224 |
pszResult = "DESCRIPTION: 'ALSA Sequencer device active state'\r\n" |
if (lscp_parser_test(&tok, "active")) { |
225 |
"TYPE: BOOL\r\n" |
pszResult = "DESCRIPTION: 'ALSA Sequencer device active state'\r\n" |
226 |
"MANDATORY: TRUE\r\n" |
"TYPE: BOOL\r\n" |
227 |
"FIX: TRUE\r\n" |
"MANDATORY: TRUE\r\n" |
228 |
"MULTIPLICITY: FALSE\r\n" |
"FIX: TRUE\r\n" |
229 |
"DEPENDS: channels,ports\r\n" |
"MULTIPLICITY: FALSE\r\n" |
230 |
"DEFAULT: TRUE\r\n" |
"DEPENDS: channels,ports\r\n" |
231 |
"RANGE_MIN: FALSE\r\n" |
"DEFAULT: TRUE\r\n" |
232 |
"RANGE_MAX: TRUE\r\n" |
"RANGE_MIN: FALSE\r\n" |
233 |
"POSSIBILITIES: FALSE,TRUE\r\n"; |
"RANGE_MAX: TRUE\r\n" |
234 |
|
"POSSIBILITIES: FALSE,TRUE\r\n"; |
235 |
|
} |
236 |
|
else if (lscp_parser_test(&tok, "ports")) { |
237 |
|
pszResult = "DESCRIPTION: 'Number of ALSA Sequencer ports'\r\n" |
238 |
|
"TYPE: INT\r\n" |
239 |
|
"MANDATORY: FALSE\r\n" |
240 |
|
"FIX: FALSE\r\n" |
241 |
|
"MULTIPLICITY: FALSE\r\n" |
242 |
|
"DEFAULT: 1\r\n" |
243 |
|
"RANGE_MIN: 1\r\n" |
244 |
|
"RANGE_MAX: 4\r\n"; |
245 |
|
} |
246 |
|
else ret = LSCP_FAILED; |
247 |
} |
} |
248 |
else ret = LSCP_FAILED; |
else ret = LSCP_FAILED; |
249 |
} |
} |
269 |
} |
} |
270 |
else ret = LSCP_FAILED; |
else ret = LSCP_FAILED; |
271 |
} |
} |
272 |
|
else if (lscp_parser_test2(&tok, "AUDIO_OUTPUT_CHANNEL", "INFO")) { |
273 |
|
// Getting informations about an audio channel. |
274 |
|
// GET AUDIO_OUTPUT_CHANNEL INFO <audio-device-id> <audio-channel> |
275 |
|
if (lscp_parser_nextint(&tok) < iAudioDevice) { |
276 |
|
pszResult = "name: DummyMonitor\r\n" |
277 |
|
"is_mix_channel: FALSE\r\n" |
278 |
|
"mix_channel_destination: 0\r\n"; |
279 |
|
} |
280 |
|
else ret = LSCP_FAILED; |
281 |
|
} |
282 |
|
else if (lscp_parser_test2(&tok, "MIDI_INPUT_PORT", "INFO")) { |
283 |
|
// Getting informations about a MIDI port. |
284 |
|
// GET MIDI_INPUT_PORT INFO <midi-device-id> <midi-port> |
285 |
|
if (lscp_parser_nextint(&tok) < iMidiDevice) { |
286 |
|
pszResult = "name: DummyKeyboard\r\n" |
287 |
|
"alsa_seq_bindings: '64:0'\r\n"; |
288 |
|
} |
289 |
|
else ret = LSCP_FAILED; |
290 |
|
} |
291 |
|
else if (lscp_parser_test2(&tok, "AUDIO_OUTPUT_CHANNEL_PARAMETER", "INFO")) { |
292 |
|
// Getting informations about specific audio channel parameter. |
293 |
|
// GET AUDIO_OUTPUT_CHANNEL_PARAMETER INFO <audio-device-id> <audio-channel> <param> |
294 |
|
if (lscp_parser_nextint(&tok) < iAudioDevice) { |
295 |
|
lscp_parser_nextint(&tok); |
296 |
|
if (lscp_parser_test(&tok, "is_mix_channel")) { |
297 |
|
pszResult = "DESCRIPTION: 'Whether this is an audio mix channel'\r\n" |
298 |
|
"TYPE: BOOL\r\n" |
299 |
|
"MANDATORY: TRUE\r\n" |
300 |
|
"FIX: FALSE\r\n" |
301 |
|
"MULTIPLICITY: FALSE\r\n" |
302 |
|
"POSSIBILITIES: FALSE,TRUE\r\n"; |
303 |
|
} |
304 |
|
else if (lscp_parser_test(&tok, "mix_channel_destination")) { |
305 |
|
pszResult = "DESCRIPTION: 'Audio mix channel destination'\r\n" |
306 |
|
"TYPE: INT\r\n" |
307 |
|
"MANDATORY: TRUE\r\n" |
308 |
|
"FIX: FALSE\r\n" |
309 |
|
"MULTIPLICITY: TRUE\r\n" |
310 |
|
"POSSIBILITIES: 0,1\r\n"; |
311 |
|
} |
312 |
|
else ret = LSCP_FAILED; |
313 |
|
} |
314 |
|
else ret = LSCP_FAILED; |
315 |
|
} |
316 |
|
else if (lscp_parser_test2(&tok, "MIDI_INPUT_PORT_PARAMETER", "INFO")) { |
317 |
|
// Getting informations about specific MIDI port parameter. |
318 |
|
// GET MIDI_INPUT_PORT_PARAMETER INFO <midi-device-id> <midi-port> <param> |
319 |
|
if (lscp_parser_nextint(&tok) < iMidiDevice) { |
320 |
|
lscp_parser_nextint(&tok); |
321 |
|
if (lscp_parser_test(&tok, "alsa_seq_bindings")) { |
322 |
|
pszResult = "DESCRIPTION: 'Alsa sequencer port bindings'\r\n" |
323 |
|
"TYPE: STRING\r\n" |
324 |
|
"MANDATORY: TRUE\r\n" |
325 |
|
"FIX: FALSE\r\n" |
326 |
|
"MULTIPLICITY: TRUE\r\n" |
327 |
|
"POSSIBILITIES: '64:0','68:0','68:1'\r\n"; |
328 |
|
} |
329 |
|
else ret = LSCP_FAILED; |
330 |
|
} |
331 |
|
else ret = LSCP_FAILED; |
332 |
|
} |
333 |
else if (lscp_parser_test(&tok, "AUDIO_OUTPUT_DEVICES")) { |
else if (lscp_parser_test(&tok, "AUDIO_OUTPUT_DEVICES")) { |
334 |
// Getting all created audio output device count. |
// Getting all created audio output device count. |
335 |
// GET AUDIO_OUTPUT_DEVICES |
// GET AUDIO_OUTPUT_DEVICES |
458 |
// Adding a new sampler channel: |
// Adding a new sampler channel: |
459 |
// ADD CHANNEL |
// ADD CHANNEL |
460 |
if (iSamplerChannel < 16) { |
if (iSamplerChannel < 16) { |
461 |
sprintf(szTemp, "OK[%d]", iSamplerChannel++); |
sprintf(szTemp, "OK[%d]", iSamplerChannel++); |
462 |
pszResult = szTemp; |
pszResult = szTemp; |
463 |
} else { |
} else { |
464 |
iSamplerChannel = 0; |
iSamplerChannel = 0; |
553 |
|
|
554 |
//////////////////////////////////////////////////////////////////////// |
//////////////////////////////////////////////////////////////////////// |
555 |
|
|
556 |
|
|
557 |
void server_usage (void) |
void server_usage (void) |
558 |
{ |
{ |
559 |
printf("\n %s %s (Build: %s)\n", lscp_server_package(), lscp_server_version(), lscp_server_build()); |
printf("\n %s %s (Build: %s)\n", lscp_server_package(), lscp_server_version(), lscp_server_build()); |