/[svn]/liblscp/trunk/examples/example_server.c
ViewVC logotype

Diff of /liblscp/trunk/examples/example_server.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 187 by capela, Wed Jul 7 23:41:07 2004 UTC revision 188 by capela, Thu Jul 8 09:13:36 2004 UTC
# Line 216  lscp_status_t server_callback ( lscp_con Line 216  lscp_status_t server_callback ( lscp_con
216              }              }
217              else ret = LSCP_FAILED;              else ret = LSCP_FAILED;
218          }          }
219            else if (lscp_parser_test(&tok, "AUDIO_OUTPUT_DEVICES")) {
220                // Getting all created audio output device count.
221                // GET AUDIO_OUTPUT_DEVICES
222                sprintf(szTemp, "%d\r\n", iAudioDevice);
223                pszResult = szTemp;
224            }
225            else if (lscp_parser_test(&tok, "MIDI_INPUT_DEVICES")) {
226                // Getting all created MID input device count.
227                // GET MIDI_INPUT_DEVICES
228                sprintf(szTemp, "%d\r\n", iMidiDevice);
229                pszResult = szTemp;
230            }
231          else if (lscp_parser_test(&tok, "AVAILABLE_ENGINES")) {          else if (lscp_parser_test(&tok, "AVAILABLE_ENGINES")) {
232              // Getting all available engines:              // Getting all available engines:
233              // GET AVAILABLE_ENGINES              // GET AVAILABLE_ENGINES
# Line 243  lscp_status_t server_callback ( lscp_con Line 255  lscp_status_t server_callback ( lscp_con
255      else if (lscp_parser_test(&tok, "LIST")) {      else if (lscp_parser_test(&tok, "LIST")) {
256          if (lscp_parser_test(&tok, "CHANNELS")) {          if (lscp_parser_test(&tok, "CHANNELS")) {
257              // Getting all created sampler channel list.              // Getting all created sampler channel list.
258              // GET CHANNELS              // LIST CHANNELS
259              if (iSamplerChannel > 0) {              if (iSamplerChannel > 0) {
260                  strcpy(szTemp, "0");                  strcpy(szTemp, "0");
261                  for (i = 1; i < iSamplerChannel && strlen(szTemp) < sizeof(szTemp) - 8; i++)                  for (i = 1; i < iSamplerChannel && strlen(szTemp) < sizeof(szTemp) - 8; i++)
# Line 255  lscp_status_t server_callback ( lscp_con Line 267  lscp_status_t server_callback ( lscp_con
267          }          }
268          else if (lscp_parser_test(&tok, "AUDIO_OUTPUT_DEVICES")) {          else if (lscp_parser_test(&tok, "AUDIO_OUTPUT_DEVICES")) {
269              // Getting all created audio output device list.              // Getting all created audio output device list.
270              // GET AUDIO_OUTPUT_DEVICES              // LIST AUDIO_OUTPUT_DEVICES
271              if (iAudioDevice > 0) {              if (iAudioDevice > 0) {
272                  strcpy(szTemp, "0");                  strcpy(szTemp, "0");
273                  for (i = 1; i < iAudioDevice && strlen(szTemp) < sizeof(szTemp) - 8; i++)                  for (i = 1; i < iAudioDevice && strlen(szTemp) < sizeof(szTemp) - 8; i++)
# Line 267  lscp_status_t server_callback ( lscp_con Line 279  lscp_status_t server_callback ( lscp_con
279          }          }
280          else if (lscp_parser_test(&tok, "MIDI_INPUT_DEVICES")) {          else if (lscp_parser_test(&tok, "MIDI_INPUT_DEVICES")) {
281              // Getting all created MID input device list.              // Getting all created MID input device list.
282              // GET MIDI_INPUT_DEVICES              // LIST MIDI_INPUT_DEVICES
283              if (iMidiDevice > 0) {              if (iMidiDevice > 0) {
284                  strcpy(szTemp, "0");                  strcpy(szTemp, "0");
285                  for (i = 1; i < iMidiDevice && strlen(szTemp) < sizeof(szTemp) - 8; i++)                  for (i = 1; i < iMidiDevice && strlen(szTemp) < sizeof(szTemp) - 8; i++)
# Line 342  lscp_status_t server_callback ( lscp_con Line 354  lscp_status_t server_callback ( lscp_con
354      else if (lscp_parser_test2(&tok, "REMOVE", "CHANNEL")) {      else if (lscp_parser_test2(&tok, "REMOVE", "CHANNEL")) {
355          // Removing a sampler channel:          // Removing a sampler channel:
356          // REMOVE CHANNEL <sampler-channel>          // REMOVE CHANNEL <sampler-channel>
357          if (lscp_parser_nextint(&tok) > iSamplerChannel)          if (lscp_parser_nextint(&tok) < iSamplerChannel)
358                iSamplerChannel--;
359            else
360              ret = LSCP_FAILED;              ret = LSCP_FAILED;
361      }      }
362      else if (lscp_parser_test2(&tok, "RESET", "CHANNEL")) {      else if (lscp_parser_test2(&tok, "RESET", "CHANNEL")) {
# Line 380  lscp_status_t server_callback ( lscp_con Line 394  lscp_status_t server_callback ( lscp_con
394          if (lscp_parser_test(&tok, "AUDIO_OUTPUT_DEVICE")) {          if (lscp_parser_test(&tok, "AUDIO_OUTPUT_DEVICE")) {
395              // Destroying an audio output device.              // Destroying an audio output device.
396              // DESTROY AUDIO_OUTPUT_DEVICE <audio-device-id>              // DESTROY AUDIO_OUTPUT_DEVICE <audio-device-id>
397              if (lscp_parser_nextint(&tok) > iAudioDevice)              if (lscp_parser_nextint(&tok) < iAudioDevice)
398                    iAudioDevice--;
399                else
400                  ret = LSCP_FAILED;                  ret = LSCP_FAILED;
401          }          }
402          else if (lscp_parser_test(&tok, "MIDI_INPUT_DEVICE")) {          else if (lscp_parser_test(&tok, "MIDI_INPUT_DEVICE")) {
403              // Destroying an MIDI intput device.              // Destroying an MIDI intput device.
404              // DESTROY MIDI_INPUT_DEVICE <midi-device-id>              // DESTROY MIDI_INPUT_DEVICE <midi-device-id>
405              if (lscp_parser_nextint(&tok) > iMidiDevice)              if (lscp_parser_nextint(&tok) < iMidiDevice)
406                    iMidiDevice--;
407                else
408                  ret = LSCP_FAILED;                  ret = LSCP_FAILED;
409          }          }
410          else ret = LSCP_FAILED;          else ret = LSCP_FAILED;

Legend:
Removed from v.187  
changed lines
  Added in v.188

  ViewVC Help
Powered by ViewVC