2 |
// |
// |
3 |
/**************************************************************************** |
/**************************************************************************** |
4 |
liblscp - LinuxSampler Control Protocol API |
liblscp - LinuxSampler Control Protocol API |
5 |
Copyright (C) 2004-2006, rncbc aka Rui Nuno Capela. All rights reserved. |
Copyright (C) 2004-2007, 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 |
46 |
static int iMidiDevice = 0; |
static int iMidiDevice = 0; |
47 |
static int iMidiMaps = 0; |
static int iMidiMaps = 0; |
48 |
static int iMidiInstruments = 0; |
static int iMidiInstruments = 0; |
49 |
|
static float fVolume = 1.0f; |
50 |
|
|
51 |
if (pchBuffer == NULL) { |
if (pchBuffer == NULL) { |
52 |
fprintf(stderr, "server_callback: addr=%s port=%d: ", |
fprintf(stderr, "server_callback: addr=%s port=%d: ", |
414 |
sprintf(szTemp, "%d\r\n", rand() % 100); |
sprintf(szTemp, "%d\r\n", rand() % 100); |
415 |
pszResult = szTemp; |
pszResult = szTemp; |
416 |
} |
} |
417 |
|
else if (lscp_parser_test(&tok, "VOLUME")) { |
418 |
|
// Get global volume attenuation: |
419 |
|
// GET VOLUME |
420 |
|
sprintf(szTemp, "%g\r\n", fVolume); |
421 |
|
pszResult = szTemp; |
422 |
|
} |
423 |
else if (lscp_parser_test(&tok, "MIDI_INSTRUMENTS")) { |
else if (lscp_parser_test(&tok, "MIDI_INSTRUMENTS")) { |
424 |
// Get the total count of MIDI instrument map entries: |
// Get the total count of MIDI instrument map entries: |
425 |
// GET MIDI_INSTRUMENTS |
// GET MIDI_INSTRUMENTS |
587 |
} |
} |
588 |
else ret = LSCP_FAILED; |
else ret = LSCP_FAILED; |
589 |
} |
} |
590 |
|
else if (lscp_parser_test(&tok, "VOLUME")) { |
591 |
|
// Setting global volume attenuation: |
592 |
|
// SET VOLUME <volume> |
593 |
|
fVolume = lscp_parser_nextnum(&tok); |
594 |
|
} |
595 |
else if (lscp_parser_test2(&tok, "MIDI_INSTRUMENT_MAP", "NAME")) { |
else if (lscp_parser_test2(&tok, "MIDI_INSTRUMENT_MAP", "NAME")) { |
596 |
// Setting MIDI instrument map name: |
// Setting MIDI instrument map name: |
597 |
// SET MIDI_INSTRUMENT_MAP NAME <midi-map> <map-name> |
// SET MIDI_INSTRUMENT_MAP NAME <midi-map> <map-name> |