1 |
// example_server.c |
// example_server.c |
2 |
// |
// |
3 |
/**************************************************************************** |
/**************************************************************************** |
4 |
Copyright (C) 2004-2005, rncbc aka Rui Nuno Capela. All rights reserved. |
liblscp - LinuxSampler Control Protocol API |
5 |
|
Copyright (C) 2004-2006, rncbc aka Rui Nuno Capela. All rights reserved. |
6 |
|
|
7 |
This program is free software; you can redistribute it and/or |
This program is free software; you can redistribute it and/or |
8 |
modify it under the terms of the GNU General Public License |
modify it under the terms of the GNU General Public License |
14 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 |
GNU General Public License for more details. |
GNU General Public License for more details. |
16 |
|
|
17 |
You should have received a copy of the GNU General Public License |
You should have received a copy of the GNU General Public License along |
18 |
along with this program; if not, write to the Free Software |
with this program; if not, write to the Free Software Foundation, Inc., |
19 |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
20 |
|
|
21 |
*****************************************************************************/ |
*****************************************************************************/ |
22 |
|
|
79 |
"MIDI_INPUT_DEVICE: 0\r\n" |
"MIDI_INPUT_DEVICE: 0\r\n" |
80 |
"MIDI_INPUT_PORT: 0\r\n" |
"MIDI_INPUT_PORT: 0\r\n" |
81 |
"MIDI_INPUT_CHANNEL: ALL\r\n" |
"MIDI_INPUT_CHANNEL: ALL\r\n" |
82 |
"VOLUME: 0.5\r\n"; |
"VOLUME: 0.5\r\n" |
83 |
|
"MUTE: FALSE\r\n" |
84 |
|
"SOLO: TRUE\r\n"; |
85 |
} |
} |
86 |
else if (lscp_parser_test(&tok, "VOICE_COUNT")) { |
else if (lscp_parser_test(&tok, "VOICE_COUNT")) { |
87 |
// Current number of active voices: |
// Current number of active voices: |
351 |
// GET AVAILABLE_ENGINES |
// GET AVAILABLE_ENGINES |
352 |
pszResult = "3\r\n"; |
pszResult = "3\r\n"; |
353 |
} |
} |
354 |
|
else if (lscp_parser_test2(&tok, "SERVER", "INFO")) { |
355 |
|
// Getting information about the server. |
356 |
|
// GET SERVER INFO |
357 |
|
sprintf(szTemp, "DESCRIPTION: example_server (%s) %s\r\n" |
358 |
|
"VERSION: %s\r\n", lscp_server_package(), |
359 |
|
lscp_server_build(), lscp_server_version()); |
360 |
|
pszResult = szTemp; |
361 |
|
} |
362 |
else if (lscp_parser_test2(&tok, "ENGINE", "INFO")) { |
else if (lscp_parser_test2(&tok, "ENGINE", "INFO")) { |
363 |
// Getting information about an engine. |
// Getting information about an engine. |
364 |
// GET ENGINE INFO <engine-name> |
// GET ENGINE INFO <engine-name> |
438 |
// Setting channel volume: |
// Setting channel volume: |
439 |
// SET CHANNEL VOLUME <sampler-channel> <volume> |
// SET CHANNEL VOLUME <sampler-channel> <volume> |
440 |
} |
} |
441 |
|
else if (lscp_parser_test(&tok, "MUTE")) { |
442 |
|
// Muting a sampler channel: |
443 |
|
// SET CHANNEL MUTE <sampler-channel> <mute> |
444 |
|
} |
445 |
|
else if (lscp_parser_test(&tok, "SOLO")) { |
446 |
|
// Soloing a sampler channel: |
447 |
|
// SET CHANNEL SOLO <sampler-channel> <solo> |
448 |
|
} |
449 |
else if (lscp_parser_test(&tok, "AUDIO_OUTPUT_TYPE")) { |
else if (lscp_parser_test(&tok, "AUDIO_OUTPUT_TYPE")) { |
450 |
// Setting audio output type: |
// Setting audio output type: |
451 |
// SET CHANNEL AUDIO_OUTPUT_TYPE <sampler-channel> <audio-output-type> |
// SET CHANNEL AUDIO_OUTPUT_TYPE <sampler-channel> <audio-output-type> |