3 |
* LinuxSampler - modular, streaming capable sampler * |
* LinuxSampler - modular, streaming capable sampler * |
4 |
* * |
* * |
5 |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
6 |
* Copyright (C) 2005 - 2008 Christian Schoenebeck * |
* Copyright (C) 2005 - 2010 Christian Schoenebeck * |
7 |
* * |
* * |
8 |
* This program is free software; you can redistribute it and/or modify * |
* This program is free software; you can redistribute it and/or modify * |
9 |
* it under the terms of the GNU General Public License as published by * |
* it under the terms of the GNU General Public License as published by * |
119 |
%token <Char> EXT_ASCII_CHAR |
%token <Char> EXT_ASCII_CHAR |
120 |
|
|
121 |
%type <Char> char char_base alpha_char digit digit_oct digit_hex escape_seq escape_seq_octal escape_seq_hex |
%type <Char> char char_base alpha_char digit digit_oct digit_hex escape_seq escape_seq_octal escape_seq_hex |
122 |
%type <Dotnum> dotnum volume_value boolean |
%type <Dotnum> real dotnum volume_value boolean effect_control_value |
123 |
%type <Number> number sampler_channel instrument_index fx_send_id audio_channel_index device_index midi_input_channel_index midi_input_port_index midi_map midi_bank midi_prog midi_ctrl |
%type <Number> number sampler_channel instrument_index fx_send_id audio_channel_index device_index midi_input_channel_index midi_input_port_index midi_map midi_bank midi_prog midi_ctrl |
124 |
%type <String> string string_escaped text text_escaped text_escaped_base stringval stringval_escaped digits param_val_list param_val query_val filename db_path map_name entry_name fx_send_name engine_name command add_instruction create_instruction destroy_instruction get_instruction list_instruction load_instruction send_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 find_instruction move_instruction copy_instruction scan_mode edit_instruction format_instruction |
%type <String> string string_escaped text text_escaped text_escaped_base stringval stringval_escaped digits param_val_list param_val query_val filename db_path map_name entry_name fx_send_name effect_name engine_name command add_instruction create_instruction destroy_instruction get_instruction list_instruction load_instruction send_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 find_instruction move_instruction copy_instruction scan_mode edit_instruction format_instruction append_instruction insert_instruction |
125 |
%type <FillResponse> buffer_size_type |
%type <FillResponse> buffer_size_type |
126 |
%type <KeyValList> key_val_list query_val_list |
%type <KeyValList> key_val_list query_val_list |
127 |
%type <LoadMode> instr_load_mode |
%type <LoadMode> instr_load_mode |
180 |
| EDIT SP edit_instruction { $$ = $3; } |
| EDIT SP edit_instruction { $$ = $3; } |
181 |
| FORMAT SP format_instruction { $$ = $3; } |
| FORMAT SP format_instruction { $$ = $3; } |
182 |
| SEND SP send_instruction { $$ = $3; } |
| SEND SP send_instruction { $$ = $3; } |
183 |
|
| APPEND SP append_instruction { $$ = $3; } |
184 |
|
| INSERT SP insert_instruction { $$ = $3; } |
185 |
| RESET { $$ = LSCPSERVER->ResetSampler(); } |
| RESET { $$ = LSCPSERVER->ResetSampler(); } |
186 |
| QUIT { LSCPSERVER->AnswerClient("Bye!\r\n"); return LSCP_QUIT; } |
| QUIT { LSCPSERVER->AnswerClient("Bye!\r\n"); return LSCP_QUIT; } |
187 |
; |
; |
198 |
| DB_INSTRUMENTS SP db_path SP filename SP instrument_index { $$ = LSCPSERVER->AddDbInstruments($3,$5,$7); } |
| DB_INSTRUMENTS SP db_path SP filename SP instrument_index { $$ = LSCPSERVER->AddDbInstruments($3,$5,$7); } |
199 |
| MIDI_INSTRUMENT_MAP { $$ = LSCPSERVER->AddMidiInstrumentMap(); } |
| MIDI_INSTRUMENT_MAP { $$ = LSCPSERVER->AddMidiInstrumentMap(); } |
200 |
| MIDI_INSTRUMENT_MAP SP map_name { $$ = LSCPSERVER->AddMidiInstrumentMap($3); } |
| MIDI_INSTRUMENT_MAP SP map_name { $$ = LSCPSERVER->AddMidiInstrumentMap($3); } |
201 |
|
| MASTER_EFFECT_CHAIN SP number { $$ = LSCPSERVER->AddMasterEffectChain($3); } |
202 |
; |
; |
203 |
|
|
204 |
subscribe_event : AUDIO_OUTPUT_DEVICE_COUNT { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_audio_device_count); } |
subscribe_event : AUDIO_OUTPUT_DEVICE_COUNT { $$ = LSCPSERVER->SubscribeNotification(LSCPEvent::event_audio_device_count); } |
269 |
remove_instruction : CHANNEL SP sampler_channel { $$ = LSCPSERVER->RemoveChannel($3); } |
remove_instruction : CHANNEL SP sampler_channel { $$ = LSCPSERVER->RemoveChannel($3); } |
270 |
| MIDI_INSTRUMENT_MAP SP midi_map { $$ = LSCPSERVER->RemoveMidiInstrumentMap($3); } |
| MIDI_INSTRUMENT_MAP SP midi_map { $$ = LSCPSERVER->RemoveMidiInstrumentMap($3); } |
271 |
| MIDI_INSTRUMENT_MAP SP ALL { $$ = LSCPSERVER->RemoveAllMidiInstrumentMaps(); } |
| MIDI_INSTRUMENT_MAP SP ALL { $$ = LSCPSERVER->RemoveAllMidiInstrumentMaps(); } |
272 |
|
| MASTER_EFFECT_CHAIN SP number SP number { $$ = LSCPSERVER->RemoveMasterEffectChain($3,$5); } |
273 |
|
| MASTER_EFFECT_CHAIN SP EFFECT SP number SP number SP number { $$ = LSCPSERVER->RemoveMasterEffectChainEffect($5,$7,$9); } |
274 |
| DB_INSTRUMENT_DIRECTORY SP FORCE SP db_path { $$ = LSCPSERVER->RemoveDbInstrumentDirectory($5, true); } |
| DB_INSTRUMENT_DIRECTORY SP FORCE SP db_path { $$ = LSCPSERVER->RemoveDbInstrumentDirectory($5, true); } |
275 |
| DB_INSTRUMENT_DIRECTORY SP db_path { $$ = LSCPSERVER->RemoveDbInstrumentDirectory($3); } |
| DB_INSTRUMENT_DIRECTORY SP db_path { $$ = LSCPSERVER->RemoveDbInstrumentDirectory($3); } |
276 |
| DB_INSTRUMENT SP db_path { $$ = LSCPSERVER->RemoveDbInstrument($3); } |
| DB_INSTRUMENT SP db_path { $$ = LSCPSERVER->RemoveDbInstrument($3); } |
277 |
; |
; |
278 |
|
|
279 |
get_instruction : AVAILABLE_ENGINES { $$ = LSCPSERVER->GetAvailableEngines(); } |
get_instruction : AVAILABLE_ENGINES { $$ = LSCPSERVER->GetAvailableEngines(); } |
280 |
|
| AVAILABLE_EFFECTS { $$ = LSCPSERVER->GetAvailableEffects(); } |
281 |
|
| EFFECT_INSTANCES { $$ = LSCPSERVER->GetEffectInstances(); } |
282 |
|
| EFFECT SP INFO SP number { $$ = LSCPSERVER->GetEffectInfo($5); } |
283 |
|
| EFFECT_INSTANCE SP INFO SP number { $$ = LSCPSERVER->GetEffectInstanceInfo($5); } |
284 |
|
| EFFECT_INSTANCE_INPUT_CONTROL SP INFO SP number SP number { $$ = LSCPSERVER->GetEffectInstanceInputControlInfo($5,$7); } |
285 |
|
| MASTER_EFFECT_CHAINS SP number { $$ = LSCPSERVER->GetMasterEffectChains($3); } |
286 |
|
| MASTER_EFFECT_CHAIN SP INFO SP number SP number { $$ = LSCPSERVER->GetMasterEffectChainInfo($5,$7); } |
287 |
| AVAILABLE_MIDI_INPUT_DRIVERS { $$ = LSCPSERVER->GetAvailableMidiInputDrivers(); } |
| AVAILABLE_MIDI_INPUT_DRIVERS { $$ = LSCPSERVER->GetAvailableMidiInputDrivers(); } |
288 |
| MIDI_INPUT_DRIVER SP INFO SP string { $$ = LSCPSERVER->GetMidiInputDriverInfo($5); } |
| MIDI_INPUT_DRIVER SP INFO SP string { $$ = LSCPSERVER->GetMidiInputDriverInfo($5); } |
289 |
| MIDI_INPUT_DRIVER_PARAMETER SP INFO SP string SP string { $$ = LSCPSERVER->GetMidiInputDriverParameterInfo($5, $7); } |
| MIDI_INPUT_DRIVER_PARAMETER SP INFO SP string SP string { $$ = LSCPSERVER->GetMidiInputDriverParameterInfo($5, $7); } |
336 |
| 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); } |
337 |
| MIDI_INPUT_PORT_PARAMETER SP number SP number SP string '=' NONE { $$ = LSCPSERVER->SetMidiInputPortParameter($3, $5, $7, ""); } |
| MIDI_INPUT_PORT_PARAMETER SP number SP number SP string '=' NONE { $$ = LSCPSERVER->SetMidiInputPortParameter($3, $5, $7, ""); } |
338 |
| 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); } |
339 |
|
| EFFECT_INSTANCE_INPUT_CONTROL SP number SP number SP effect_control_value { $$ = LSCPSERVER->SetEffectInstanceInputControl($3, $5, $7); } |
340 |
| CHANNEL SP set_chan_instruction { $$ = $3; } |
| CHANNEL SP set_chan_instruction { $$ = $3; } |
341 |
| MIDI_INSTRUMENT_MAP SP NAME SP midi_map SP map_name { $$ = LSCPSERVER->SetMidiInstrumentMapName($5, $7); } |
| MIDI_INSTRUMENT_MAP SP NAME SP midi_map SP map_name { $$ = LSCPSERVER->SetMidiInstrumentMapName($5, $7); } |
342 |
| FX_SEND SP NAME SP sampler_channel SP fx_send_id SP fx_send_name { $$ = LSCPSERVER->SetFxSendName($5,$7,$9); } |
| FX_SEND SP NAME SP sampler_channel SP fx_send_id SP fx_send_name { $$ = LSCPSERVER->SetFxSendName($5,$7,$9); } |
360 |
| MIDI_INPUT_DEVICE SP string { $$ = LSCPSERVER->CreateMidiInputDevice($3); } |
| MIDI_INPUT_DEVICE SP string { $$ = LSCPSERVER->CreateMidiInputDevice($3); } |
361 |
| FX_SEND SP sampler_channel SP midi_ctrl { $$ = LSCPSERVER->CreateFxSend($3,$5); } |
| FX_SEND SP sampler_channel SP midi_ctrl { $$ = LSCPSERVER->CreateFxSend($3,$5); } |
362 |
| FX_SEND SP sampler_channel SP midi_ctrl SP fx_send_name { $$ = LSCPSERVER->CreateFxSend($3,$5,$7); } |
| FX_SEND SP sampler_channel SP midi_ctrl SP fx_send_name { $$ = LSCPSERVER->CreateFxSend($3,$5,$7); } |
363 |
|
| EFFECT_INSTANCE SP number { $$ = LSCPSERVER->CreateEffectInstance($3); } |
364 |
|
| EFFECT_INSTANCE SP string SP filename SP effect_name { $$ = LSCPSERVER->CreateEffectInstance($3,$5,$7); } |
365 |
; |
; |
366 |
|
|
367 |
reset_instruction : CHANNEL SP sampler_channel { $$ = LSCPSERVER->ResetChannel($3); } |
reset_instruction : CHANNEL SP sampler_channel { $$ = LSCPSERVER->ResetChannel($3); } |
389 |
destroy_instruction : AUDIO_OUTPUT_DEVICE SP number { $$ = LSCPSERVER->DestroyAudioOutputDevice($3); } |
destroy_instruction : AUDIO_OUTPUT_DEVICE SP number { $$ = LSCPSERVER->DestroyAudioOutputDevice($3); } |
390 |
| MIDI_INPUT_DEVICE SP number { $$ = LSCPSERVER->DestroyMidiInputDevice($3); } |
| MIDI_INPUT_DEVICE SP number { $$ = LSCPSERVER->DestroyMidiInputDevice($3); } |
391 |
| FX_SEND SP sampler_channel SP fx_send_id { $$ = LSCPSERVER->DestroyFxSend($3,$5); } |
| FX_SEND SP sampler_channel SP fx_send_id { $$ = LSCPSERVER->DestroyFxSend($3,$5); } |
392 |
|
| EFFECT_INSTANCE SP number { $$ = LSCPSERVER->DestroyEffectInstance($3); } |
393 |
; |
; |
394 |
|
|
395 |
load_instruction : INSTRUMENT SP load_instr_args { $$ = $3; } |
load_instruction : INSTRUMENT SP load_instr_args { $$ = $3; } |
396 |
| ENGINE SP load_engine_args { $$ = $3; } |
| ENGINE SP load_engine_args { $$ = $3; } |
397 |
; |
; |
398 |
|
|
399 |
|
append_instruction : MASTER_EFFECT_CHAIN SP EFFECT SP number SP number SP number { $$ = LSCPSERVER->AppendMasterEffectChainEffect($5,$7,$9); } |
400 |
|
; |
401 |
|
|
402 |
|
insert_instruction : MASTER_EFFECT_CHAIN SP EFFECT SP number SP number SP number SP number { $$ = LSCPSERVER->InsertMasterEffectChainEffect($5,$7,$9,$11); } |
403 |
|
; |
404 |
|
|
405 |
set_chan_instruction : AUDIO_OUTPUT_DEVICE SP sampler_channel SP device_index { $$ = LSCPSERVER->SetAudioOutputDevice($5, $3); } |
set_chan_instruction : AUDIO_OUTPUT_DEVICE SP sampler_channel SP device_index { $$ = LSCPSERVER->SetAudioOutputDevice($5, $3); } |
406 |
| AUDIO_OUTPUT_CHANNEL SP sampler_channel SP audio_channel_index SP audio_channel_index { $$ = LSCPSERVER->SetAudioOutputChannel($5, $7, $3); } |
| AUDIO_OUTPUT_CHANNEL SP sampler_channel SP audio_channel_index SP audio_channel_index { $$ = LSCPSERVER->SetAudioOutputChannel($5, $7, $3); } |
407 |
| AUDIO_OUTPUT_TYPE SP sampler_channel SP audio_output_type_name { $$ = LSCPSERVER->SetAudioOutputType($5, $3); } |
| AUDIO_OUTPUT_TYPE SP sampler_channel SP audio_output_type_name { $$ = LSCPSERVER->SetAudioOutputType($5, $3); } |
440 |
| MIDI_INPUT_DEVICES { $$ = LSCPSERVER->GetMidiInputDevices(); } |
| MIDI_INPUT_DEVICES { $$ = LSCPSERVER->GetMidiInputDevices(); } |
441 |
| CHANNELS { $$ = LSCPSERVER->ListChannels(); } |
| CHANNELS { $$ = LSCPSERVER->ListChannels(); } |
442 |
| AVAILABLE_ENGINES { $$ = LSCPSERVER->ListAvailableEngines(); } |
| AVAILABLE_ENGINES { $$ = LSCPSERVER->ListAvailableEngines(); } |
443 |
|
| AVAILABLE_EFFECTS { $$ = LSCPSERVER->ListAvailableEffects(); } |
444 |
|
| EFFECT_INSTANCES { $$ = LSCPSERVER->ListEffectInstances(); } |
445 |
|
| MASTER_EFFECT_CHAINS SP number { $$ = LSCPSERVER->ListMasterEffectChains($3); } |
446 |
| AVAILABLE_MIDI_INPUT_DRIVERS { $$ = LSCPSERVER->ListAvailableMidiInputDrivers(); } |
| AVAILABLE_MIDI_INPUT_DRIVERS { $$ = LSCPSERVER->ListAvailableMidiInputDrivers(); } |
447 |
| AVAILABLE_AUDIO_OUTPUT_DRIVERS { $$ = LSCPSERVER->ListAvailableAudioOutputDrivers(); } |
| AVAILABLE_AUDIO_OUTPUT_DRIVERS { $$ = LSCPSERVER->ListAvailableAudioOutputDrivers(); } |
448 |
| MIDI_INSTRUMENTS SP midi_map { $$ = LSCPSERVER->ListMidiInstrumentMappings($3); } |
| MIDI_INSTRUMENTS SP midi_map { $$ = LSCPSERVER->ListMidiInstrumentMappings($3); } |
506 |
| number { $$ = $1; } |
| number { $$ = $1; } |
507 |
; |
; |
508 |
|
|
509 |
|
effect_control_value : real |
510 |
|
; |
511 |
|
|
512 |
sampler_channel : number |
sampler_channel : number |
513 |
; |
; |
514 |
|
|
543 |
fx_send_name : stringval_escaped |
fx_send_name : stringval_escaped |
544 |
; |
; |
545 |
|
|
546 |
|
effect_name : stringval_escaped |
547 |
|
; |
548 |
|
|
549 |
param_val_list : param_val |
param_val_list : param_val |
550 |
| param_val_list','param_val { $$ = $1 + "," + $3; } |
| param_val_list','param_val { $$ = $1 + "," + $3; } |
551 |
; |
; |
554 |
param_val : string { $$ = "\'" + $1 + "\'"; } |
param_val : string { $$ = "\'" + $1 + "\'"; } |
555 |
| stringval { $$ = "\'" + $1 + "\'"; } |
| stringval { $$ = "\'" + $1 + "\'"; } |
556 |
| number { std::stringstream ss; ss << "\'" << $1 << "\'"; $$ = ss.str(); } |
| number { std::stringstream ss; ss << "\'" << $1 << "\'"; $$ = ss.str(); } |
557 |
| dotnum { std::stringstream ss; ss << "\'" << $1 << "\'"; $$ = ss.str(); } |
| dotnum { std::stringstream ss; ss << "\'" << $1 << "\'"; $$ = ss.str(); } //TODO: maybe better using 'real' instead of 'number' and 'dotnum' rules |
558 |
; |
; |
559 |
|
|
560 |
query_val_list : string '=' query_val { $$[$1] = $3; } |
query_val_list : string '=' query_val { $$[$1] = $3; } |
584 |
| '-' digits '.' digits { std::stringstream ss("-" + $2 + "." + $4); ss.imbue(std::locale::classic()); ss >> $$; } |
| '-' digits '.' digits { std::stringstream ss("-" + $2 + "." + $4); ss.imbue(std::locale::classic()); ss >> $$; } |
585 |
; |
; |
586 |
|
|
587 |
|
real : digits '.' digits { std::stringstream ss($1 + "." + $3); ss.imbue(std::locale::classic()); ss >> $$; } |
588 |
|
| '+' digits '.' digits { std::stringstream ss($2 + "." + $4); ss.imbue(std::locale::classic()); ss >> $$; } |
589 |
|
| '-' digits '.' digits { std::stringstream ss("-" + $2 + "." + $4); ss.imbue(std::locale::classic()); ss >> $$; } |
590 |
|
| digits { std::stringstream ss($1); ss.imbue(std::locale::classic()); ss >> $$; } |
591 |
|
| '+' digits { std::stringstream ss($2); ss.imbue(std::locale::classic()); ss >> $$; } |
592 |
|
| '-' digits { std::stringstream ss("-" + $2); ss.imbue(std::locale::classic()); ss >> $$; } |
593 |
|
; |
594 |
|
|
595 |
|
|
596 |
digits : digit { $$ = $1; } |
digits : digit { $$ = $1; } |
597 |
| digits digit { $$ = $1 + $2; } |
| digits digit { $$ = $1 + $2; } |
819 |
SET : 'S''E''T' |
SET : 'S''E''T' |
820 |
; |
; |
821 |
|
|
822 |
|
APPEND : 'A''P''P''E''N''D' |
823 |
|
; |
824 |
|
|
825 |
|
INSERT : 'I''N''S''E''R''T' |
826 |
|
; |
827 |
|
|
828 |
SUBSCRIBE : 'S''U''B''S''C''R''I''B''E' |
SUBSCRIBE : 'S''U''B''S''C''R''I''B''E' |
829 |
; |
; |
830 |
|
|
969 |
AUDIO_OUTPUT_TYPE : 'A''U''D''I''O''_''O''U''T''P''U''T''_''T''Y''P''E' |
AUDIO_OUTPUT_TYPE : 'A''U''D''I''O''_''O''U''T''P''U''T''_''T''Y''P''E' |
970 |
; |
; |
971 |
|
|
972 |
|
AVAILABLE_EFFECTS : 'A''V''A''I''L''A''B''L''E''_''E''F''F''E''C''T''S' |
973 |
|
; |
974 |
|
|
975 |
|
EFFECT : 'E''F''F''E''C''T' |
976 |
|
; |
977 |
|
|
978 |
|
EFFECT_INSTANCE : 'E''F''F''E''C''T''_''I''N''S''T''A''N''C''E' |
979 |
|
; |
980 |
|
|
981 |
|
EFFECT_INSTANCES : 'E''F''F''E''C''T''_''I''N''S''T''A''N''C''E''S' |
982 |
|
; |
983 |
|
|
984 |
|
EFFECT_INSTANCE_INPUT_CONTROL : 'E''F''F''E''C''T''_''I''N''S''T''A''N''C''E''_''I''N''P''U''T''_''C''O''N''T''R''O''L' |
985 |
|
; |
986 |
|
|
987 |
|
MASTER_EFFECT_CHAIN : 'M''A''S''T''E''R''_''E''F''F''E''C''T''_''C''H''A''I''N' |
988 |
|
; |
989 |
|
|
990 |
|
MASTER_EFFECT_CHAINS : 'M''A''S''T''E''R''_''E''F''F''E''C''T''_''C''H''A''I''N''S' |
991 |
|
; |
992 |
|
|
993 |
AVAILABLE_MIDI_INPUT_DRIVERS : 'A''V''A''I''L''A''B''L''E''_''M''I''D''I''_''I''N''P''U''T''_''D''R''I''V''E''R''S' |
AVAILABLE_MIDI_INPUT_DRIVERS : 'A''V''A''I''L''A''B''L''E''_''M''I''D''I''_''I''N''P''U''T''_''D''R''I''V''E''R''S' |
994 |
; |
; |
995 |
|
|