--- linuxsampler/trunk/src/network/lscp.y 2004/07/07 02:49:51 185 +++ linuxsampler/trunk/src/network/lscp.y 2004/07/24 12:33:49 210 @@ -20,6 +20,9 @@ * MA 02111-1307 USA * ***************************************************************************/ +/* Note: don't forget to run 'make parser' after you changed this file, */ +/* otherwise the parser will not be regenerated! */ + %{ #include "lscpparser.h" @@ -55,7 +58,7 @@ %token NUMBER %token STRINGVAL %token SP LF CR HASH EQ -%token ADD GET CREATE DESTROY LIST LOAD NON_MODAL REMOVE SET SUBSCRIBE UNSUBSCRIBE RESET QUIT +%token ADD GET CREATE DESTROY LIST LOAD NON_MODAL REMOVE SET SUBSCRIBE UNSUBSCRIBE RESET ECHO QUIT %token CHANNEL NOTIFICATION %token AVAILABLE_ENGINES AVAILABLE_AUDIO_OUTPUT_DRIVERS CHANNELS INFO BUFFER_FILL STREAM_COUNT VOICE_COUNT %token INSTRUMENT ENGINE @@ -64,7 +67,7 @@ %token BYTES PERCENTAGE %token MISCELLANEOUS -%type volume +%type volume boolean %type sampler_channel instrument_index audio_output_channel audio_output_device midi_input_channel midi_input_port midi_input_device %type string param_val filename engine_name command create_instruction destroy_instruction get_instruction list_instruction load_instruction set_chan_instruction load_instr_args load_engine_args audio_output_type midi_input_type set_instruction subscribe_event unsubscribe_event %type buffer_size_type @@ -151,6 +154,7 @@ | MIDI_INPUT_DEVICE_PARAMETER SP NUMBER SP string EQ param_val { $$ = LSCPSERVER->SetMidiInputDeviceParameter($3, $5, $7); } | MIDI_INPUT_PORT_PARAMETER SP NUMBER SP NUMBER SP string EQ param_val { $$ = LSCPSERVER->SetMidiInputPortParameter($3, $5, $7, $9); } | CHANNEL SP set_chan_instruction { $$ = $3; } + | ECHO SP boolean { $$ = LSCPSERVER->SetEcho((yyparse_param_t*) yyparse_param, $3); } ; create_instruction : AUDIO_OUTPUT_DEVICE SP string SP key_val_list { $$ = LSCPSERVER->CreateAudioOutputDevice($3,$5); } @@ -186,8 +190,9 @@ | PERCENTAGE { $$ = fill_response_percentage; } ; -list_instruction : AUDIO_OUTPUT_DEVICES { $$ = LSCPSERVER->GetAudioOutputDevices(); } - | MIDI_INPUT_DEVICES { $$ = LSCPSERVER->GetMidiInputDevices(); } +list_instruction : AUDIO_OUTPUT_DEVICES { $$ = LSCPSERVER->GetAudioOutputDevices(); } + | MIDI_INPUT_DEVICES { $$ = LSCPSERVER->GetMidiInputDevices(); } + | CHANNELS { $$ = LSCPSERVER->ListChannels(); } ; load_instr_args : filename SP instrument_index SP sampler_channel { $$ = LSCPSERVER->LoadInstrument($1, $3, $5); } @@ -239,6 +244,10 @@ | DOTNUM { std::stringstream ss; ss << $1; $$ = ss.str(); } ; +boolean : NUMBER { $$ = $1; } + | string { $$ = -1; } + ; + string : CHAR { std::string s; s = $1; $$ = s; } | string CHAR { $$ = $1 + $2; } ;