72 |
|
|
73 |
%type <Char> char digit |
%type <Char> char digit |
74 |
%type <Dotnum> dotnum volume_value boolean |
%type <Dotnum> dotnum volume_value boolean |
75 |
%type <Number> number sampler_channel instrument_index audio_channel_index device_index midi_input_channel_index midi_input_port_index midi_bank_msb midi_bank_lsb midi_prog |
%type <Number> number sampler_channel instrument_index audio_channel_index device_index midi_input_channel_index midi_input_port_index midi_map midi_bank midi_prog |
76 |
%type <String> string text stringval digits param_val_list param_val filename entry_name 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_name midi_input_type_name remove_instruction unmap_instruction set_instruction subscribe_event unsubscribe_event map_instruction reset_instruction clear_instruction |
%type <String> string text stringval digits param_val_list param_val filename map_name entry_name engine_name command add_instruction create_instruction destroy_instruction get_instruction list_instruction load_instruction set_chan_instruction load_instr_args load_engine_args audio_output_type_name midi_input_type_name remove_instruction unmap_instruction set_instruction subscribe_event unsubscribe_event map_instruction reset_instruction clear_instruction |
77 |
%type <FillResponse> buffer_size_type |
%type <FillResponse> buffer_size_type |
78 |
%type <KeyValList> key_val_list |
%type <KeyValList> key_val_list |
79 |
%type <LoadMode> instr_load_mode |
%type <LoadMode> instr_load_mode |
85 |
//TODO: return more meaningful error messages |
//TODO: return more meaningful error messages |
86 |
|
|
87 |
/* |
/* |
88 |
The LSCP specification input file (Documentation/lscp.xml) is automatically |
The LSCP specification document input file (Documentation/lscp.xml) is |
89 |
updated with this file using the scripts/update_grammar.pl script. Do not |
automatically updated with this file using the scripts/update_grammar.pl |
90 |
modify or delete the GRAMMAR_BNF_BEGIN and GRAMMAR_BNF_END lines ! |
script. Do not modify or delete the GRAMMAR_BNF_BEGIN and GRAMMAR_BNF_END |
91 |
|
lines ! |
92 |
*/ |
*/ |
93 |
|
|
94 |
// GRAMMAR_BNF_BEGIN - do NOT delete or modify this line !!! |
// GRAMMAR_BNF_BEGIN - do NOT delete or modify this line !!! |
110 |
| comment string |
| comment string |
111 |
; |
; |
112 |
|
|
113 |
command : ADD SP CHANNEL { $$ = LSCPSERVER->AddChannel(); } |
command : ADD SP add_instruction { $$ = $3; } |
114 |
| MAP SP map_instruction { $$ = $3; } |
| MAP SP map_instruction { $$ = $3; } |
115 |
| UNMAP SP unmap_instruction { $$ = $3; } |
| UNMAP SP unmap_instruction { $$ = $3; } |
116 |
| GET SP get_instruction { $$ = $3; } |
| GET SP get_instruction { $$ = $3; } |
129 |
| QUIT { LSCPSERVER->AnswerClient("Bye!\r\n"); return LSCP_QUIT; } |
| QUIT { LSCPSERVER->AnswerClient("Bye!\r\n"); return LSCP_QUIT; } |
130 |
; |
; |
131 |
|
|
132 |
|
add_instruction : CHANNEL { $$ = LSCPSERVER->AddChannel(); } |
133 |
|
| MIDI_INSTRUMENT_MAP { $$ = LSCPSERVER->AddMidiInstrumentMap(); } |
134 |
|
| MIDI_INSTRUMENT_MAP SP map_name { $$ = LSCPSERVER->AddMidiInstrumentMap($3); } |
135 |
|
; |
136 |
|
|
137 |
subscribe_event : CHANNEL_COUNT { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_channel_count); } |
subscribe_event : CHANNEL_COUNT { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_channel_count); } |
138 |
| VOICE_COUNT { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_voice_count); } |
| VOICE_COUNT { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_voice_count); } |
139 |
| STREAM_COUNT { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_stream_count); } |
| STREAM_COUNT { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_stream_count); } |
152 |
| TOTAL_VOICE_COUNT { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_total_voice_count); } |
| TOTAL_VOICE_COUNT { $$ = LSCPSERVER->UnsubscribeNotification(LSCPEvent::event_total_voice_count); } |
153 |
; |
; |
154 |
|
|
155 |
map_instruction : MIDI_INSTRUMENT SP midi_bank_msb SP midi_bank_lsb SP midi_prog SP engine_name SP filename SP instrument_index SP volume_value { $$ = LSCPSERVER->AddOrReplaceMIDIInstrumentMapping($3,$5,$7,$9,$11,$13,$15,MidiInstrumentMapper::VOID,""); } |
map_instruction : MIDI_INSTRUMENT SP midi_map SP midi_bank SP midi_prog SP engine_name SP filename SP instrument_index SP volume_value { $$ = LSCPSERVER->AddOrReplaceMIDIInstrumentMapping($3,$5,$7,$9,$11,$13,$15,MidiInstrumentMapper::VOID,""); } |
156 |
| MIDI_INSTRUMENT SP midi_bank_msb SP midi_bank_lsb SP midi_prog SP engine_name SP filename SP instrument_index SP volume_value SP instr_load_mode { $$ = LSCPSERVER->AddOrReplaceMIDIInstrumentMapping($3,$5,$7,$9,$11,$13,$15,$17,""); } |
| MIDI_INSTRUMENT SP midi_map SP midi_bank SP midi_prog SP engine_name SP filename SP instrument_index SP volume_value SP instr_load_mode { $$ = LSCPSERVER->AddOrReplaceMIDIInstrumentMapping($3,$5,$7,$9,$11,$13,$15,$17,""); } |
157 |
| MIDI_INSTRUMENT SP midi_bank_msb SP midi_bank_lsb SP midi_prog SP engine_name SP filename SP instrument_index SP volume_value SP entry_name { $$ = LSCPSERVER->AddOrReplaceMIDIInstrumentMapping($3,$5,$7,$9,$11,$13,$15,MidiInstrumentMapper::VOID,$17); } |
| MIDI_INSTRUMENT SP midi_map SP midi_bank SP midi_prog SP engine_name SP filename SP instrument_index SP volume_value SP entry_name { $$ = LSCPSERVER->AddOrReplaceMIDIInstrumentMapping($3,$5,$7,$9,$11,$13,$15,MidiInstrumentMapper::VOID,$17); } |
158 |
| MIDI_INSTRUMENT SP midi_bank_msb SP midi_bank_lsb SP midi_prog SP engine_name SP filename SP instrument_index SP volume_value SP instr_load_mode SP entry_name { $$ = LSCPSERVER->AddOrReplaceMIDIInstrumentMapping($3,$5,$7,$9,$11,$13,$15,$17,$19); } |
| MIDI_INSTRUMENT SP midi_map SP midi_bank SP midi_prog SP engine_name SP filename SP instrument_index SP volume_value SP instr_load_mode SP entry_name { $$ = LSCPSERVER->AddOrReplaceMIDIInstrumentMapping($3,$5,$7,$9,$11,$13,$15,$17,$19); } |
159 |
; |
; |
160 |
|
|
161 |
unmap_instruction : MIDI_INSTRUMENT SP midi_bank_msb SP midi_bank_lsb SP midi_prog { $$ = LSCPSERVER->RemoveMIDIInstrumentMapping($3,$5,$7); } |
unmap_instruction : MIDI_INSTRUMENT SP midi_map SP midi_bank SP midi_prog { $$ = LSCPSERVER->RemoveMIDIInstrumentMapping($3,$5,$7); } |
162 |
; |
; |
163 |
|
|
164 |
remove_instruction : CHANNEL SP sampler_channel { $$ = LSCPSERVER->RemoveChannel($3); } |
remove_instruction : CHANNEL SP sampler_channel { $$ = LSCPSERVER->RemoveChannel($3); } |
165 |
|
| MIDI_INSTRUMENT_MAP SP midi_map { $$ = LSCPSERVER->RemoveMidiInstrumentMap($3); } |
166 |
|
| MIDI_INSTRUMENT_MAP SP ALL { $$ = LSCPSERVER->RemoveAllMidiInstrumentMaps(); } |
167 |
; |
; |
168 |
|
|
169 |
get_instruction : AVAILABLE_ENGINES { $$ = LSCPSERVER->GetAvailableEngines(); } |
get_instruction : AVAILABLE_ENGINES { $$ = LSCPSERVER->GetAvailableEngines(); } |
192 |
| SERVER SP INFO { $$ = LSCPSERVER->GetServerInfo(); } |
| SERVER SP INFO { $$ = LSCPSERVER->GetServerInfo(); } |
193 |
| TOTAL_VOICE_COUNT { $$ = LSCPSERVER->GetTotalVoiceCount(); } |
| TOTAL_VOICE_COUNT { $$ = LSCPSERVER->GetTotalVoiceCount(); } |
194 |
| TOTAL_VOICE_COUNT_MAX { $$ = LSCPSERVER->GetTotalVoiceCountMax(); } |
| TOTAL_VOICE_COUNT_MAX { $$ = LSCPSERVER->GetTotalVoiceCountMax(); } |
195 |
| MIDI_INSTRUMENTS { $$ = LSCPSERVER->GetMidiIstrumentMappings(); } |
| MIDI_INSTRUMENTS SP midi_map { $$ = LSCPSERVER->GetMidiInstrumentMappings($3); } |
196 |
| MIDI_INSTRUMENT SP INFO SP midi_bank_msb SP midi_bank_lsb SP midi_prog { $$ = LSCPSERVER->GetMidiInstrumentMapping($5,$7,$9); } |
| MIDI_INSTRUMENTS SP ALL { $$ = LSCPSERVER->GetAllMidiInstrumentMappings(); } |
197 |
|
| MIDI_INSTRUMENT SP INFO SP midi_map SP midi_bank SP midi_prog { $$ = LSCPSERVER->GetMidiInstrumentMapping($5,$7,$9); } |
198 |
|
| MIDI_INSTRUMENT_MAPS { $$ = LSCPSERVER->GetMidiInstrumentMaps(); } |
199 |
|
| MIDI_INSTRUMENT_MAP SP INFO SP midi_map { $$ = LSCPSERVER->GetMidiInstrumentMap($5); } |
200 |
; |
; |
201 |
|
|
202 |
set_instruction : AUDIO_OUTPUT_DEVICE_PARAMETER SP number SP string '=' param_val_list { $$ = LSCPSERVER->SetAudioOutputDeviceParameter($3, $5, $7); } |
set_instruction : AUDIO_OUTPUT_DEVICE_PARAMETER SP number SP string '=' param_val_list { $$ = LSCPSERVER->SetAudioOutputDeviceParameter($3, $5, $7); } |
204 |
| MIDI_INPUT_DEVICE_PARAMETER SP number SP string '=' param_val_list { $$ = LSCPSERVER->SetMidiInputDeviceParameter($3, $5, $7); } |
| MIDI_INPUT_DEVICE_PARAMETER SP number SP string '=' param_val_list { $$ = LSCPSERVER->SetMidiInputDeviceParameter($3, $5, $7); } |
205 |
| MIDI_INPUT_PORT_PARAMETER SP number SP number SP string '=' param_val_list { $$ = LSCPSERVER->SetMidiInputPortParameter($3, $5, $7, $9); } |
| MIDI_INPUT_PORT_PARAMETER SP number SP number SP string '=' param_val_list { $$ = LSCPSERVER->SetMidiInputPortParameter($3, $5, $7, $9); } |
206 |
| CHANNEL SP set_chan_instruction { $$ = $3; } |
| CHANNEL SP set_chan_instruction { $$ = $3; } |
207 |
|
| MIDI_INSTRUMENT_MAP SP NAME SP midi_map SP map_name { $$ = LSCPSERVER->SetMidiInstrumentMapName($5, $7); } |
208 |
| ECHO SP boolean { $$ = LSCPSERVER->SetEcho((yyparse_param_t*) yyparse_param, $3); } |
| ECHO SP boolean { $$ = LSCPSERVER->SetEcho((yyparse_param_t*) yyparse_param, $3); } |
209 |
; |
; |
210 |
|
|
217 |
reset_instruction : CHANNEL SP sampler_channel { $$ = LSCPSERVER->ResetChannel($3); } |
reset_instruction : CHANNEL SP sampler_channel { $$ = LSCPSERVER->ResetChannel($3); } |
218 |
; |
; |
219 |
|
|
220 |
clear_instruction : MIDI_INSTRUMENTS { $$ = LSCPSERVER->ClearMidiInstrumentMappings(); } |
clear_instruction : MIDI_INSTRUMENTS SP midi_map { $$ = LSCPSERVER->ClearMidiInstrumentMappings($3); } |
221 |
|
| MIDI_INSTRUMENTS SP ALL { $$ = LSCPSERVER->ClearAllMidiInstrumentMappings(); } |
222 |
; |
; |
223 |
|
|
224 |
destroy_instruction : AUDIO_OUTPUT_DEVICE SP number { $$ = LSCPSERVER->DestroyAudioOutputDevice($3); } |
destroy_instruction : AUDIO_OUTPUT_DEVICE SP number { $$ = LSCPSERVER->DestroyAudioOutputDevice($3); } |
240 |
| VOLUME SP sampler_channel SP volume_value { $$ = LSCPSERVER->SetVolume($5, $3); } |
| VOLUME SP sampler_channel SP volume_value { $$ = LSCPSERVER->SetVolume($5, $3); } |
241 |
| MUTE SP sampler_channel SP boolean { $$ = LSCPSERVER->SetChannelMute($5, $3); } |
| MUTE SP sampler_channel SP boolean { $$ = LSCPSERVER->SetChannelMute($5, $3); } |
242 |
| SOLO SP sampler_channel SP boolean { $$ = LSCPSERVER->SetChannelSolo($5, $3); } |
| SOLO SP sampler_channel SP boolean { $$ = LSCPSERVER->SetChannelSolo($5, $3); } |
243 |
|
| MIDI_INSTRUMENT_MAP SP sampler_channel SP midi_map { $$ = LSCPSERVER->SetChannelMap($3, $5); } |
244 |
|
| MIDI_INSTRUMENT_MAP SP sampler_channel SP NONE { $$ = LSCPSERVER->SetChannelMap($3, -1); } |
245 |
|
| MIDI_INSTRUMENT_MAP SP sampler_channel SP DEFAULT { $$ = LSCPSERVER->SetChannelMap($3, -2); } |
246 |
; |
; |
247 |
|
|
248 |
key_val_list : string '=' param_val_list { $$[$1] = $3; } |
key_val_list : string '=' param_val_list { $$[$1] = $3; } |
259 |
| AVAILABLE_ENGINES { $$ = LSCPSERVER->ListAvailableEngines(); } |
| AVAILABLE_ENGINES { $$ = LSCPSERVER->ListAvailableEngines(); } |
260 |
| AVAILABLE_MIDI_INPUT_DRIVERS { $$ = LSCPSERVER->ListAvailableMidiInputDrivers(); } |
| AVAILABLE_MIDI_INPUT_DRIVERS { $$ = LSCPSERVER->ListAvailableMidiInputDrivers(); } |
261 |
| AVAILABLE_AUDIO_OUTPUT_DRIVERS { $$ = LSCPSERVER->ListAvailableAudioOutputDrivers(); } |
| AVAILABLE_AUDIO_OUTPUT_DRIVERS { $$ = LSCPSERVER->ListAvailableAudioOutputDrivers(); } |
262 |
| MIDI_INSTRUMENTS { $$ = LSCPSERVER->ListMidiInstrumentMappings(); } |
| MIDI_INSTRUMENTS SP midi_map { $$ = LSCPSERVER->ListMidiInstrumentMappings($3); } |
263 |
|
| MIDI_INSTRUMENTS SP ALL { $$ = LSCPSERVER->ListAllMidiInstrumentMappings(); } |
264 |
|
| MIDI_INSTRUMENT_MAPS { $$ = LSCPSERVER->ListMidiInstrumentMaps(); } |
265 |
; |
; |
266 |
|
|
267 |
load_instr_args : filename SP instrument_index SP sampler_channel { $$ = LSCPSERVER->LoadInstrument($1, $3, $5); } |
load_instr_args : filename SP instrument_index SP sampler_channel { $$ = LSCPSERVER->LoadInstrument($1, $3, $5); } |
295 |
midi_input_type_name : string |
midi_input_type_name : string |
296 |
; |
; |
297 |
|
|
298 |
midi_bank_msb : number |
midi_map : number |
299 |
; |
; |
300 |
|
|
301 |
midi_bank_lsb : number |
midi_bank : number |
302 |
; |
; |
303 |
|
|
304 |
midi_prog : number |
midi_prog : number |
320 |
filename : stringval |
filename : stringval |
321 |
; |
; |
322 |
|
|
323 |
|
map_name : stringval |
324 |
|
; |
325 |
|
|
326 |
entry_name : stringval |
entry_name : stringval |
327 |
; |
; |
328 |
|
|
486 |
ALL : 'A''L''L' |
ALL : 'A''L''L' |
487 |
; |
; |
488 |
|
|
489 |
|
NONE : 'N''O''N''E' |
490 |
|
; |
491 |
|
|
492 |
|
DEFAULT : 'D''E''F''A''U''L''T' |
493 |
|
; |
494 |
|
|
495 |
NON_MODAL : 'N''O''N''_''M''O''D''A''L' |
NON_MODAL : 'N''O''N''_''M''O''D''A''L' |
496 |
; |
; |
497 |
|
|
609 |
MIDI_INSTRUMENTS : 'M''I''D''I''_''I''N''S''T''R''U''M''E''N''T''S' |
MIDI_INSTRUMENTS : 'M''I''D''I''_''I''N''S''T''R''U''M''E''N''T''S' |
610 |
; |
; |
611 |
|
|
612 |
|
MIDI_INSTRUMENT_MAP : 'M''I''D''I''_''I''N''S''T''R''U''M''E''N''T''_''M''A''P' |
613 |
|
; |
614 |
|
|
615 |
|
MIDI_INSTRUMENT_MAPS : 'M''I''D''I''_''I''N''S''T''R''U''M''E''N''T''_''M''A''P''S' |
616 |
|
; |
617 |
|
|
618 |
MIDI_INPUT_DRIVER : 'M''I''D''I''_''I''N''P''U''T''_''D''R''I''V''E''R' |
MIDI_INPUT_DRIVER : 'M''I''D''I''_''I''N''P''U''T''_''D''R''I''V''E''R' |
619 |
; |
; |
620 |
|
|
654 |
MISCELLANEOUS : 'M''I''S''C''E''L''L''A''N''E''O''U''S' |
MISCELLANEOUS : 'M''I''S''C''E''L''L''A''N''E''O''U''S' |
655 |
; |
; |
656 |
|
|
657 |
|
NAME : 'N''A''M''E' |
658 |
|
; |
659 |
|
|
660 |
ECHO : 'E''C''H''O' |
ECHO : 'E''C''H''O' |
661 |
; |
; |
662 |
|
|