52 |
%token <Char> CHAR |
%token <Char> CHAR |
53 |
%token <Dotnum> DOTNUM |
%token <Dotnum> DOTNUM |
54 |
%token <Number> NUMBER |
%token <Number> NUMBER |
55 |
%token SP LF CR |
%token SP LF CR HASH EQ |
56 |
%token ADD GET LOAD REMOVE SET SUBSCRIBE UNSUBSCRIBE RESET QUIT |
%token ADD GET CREATE DESTROY LIST LOAD REMOVE SET SUBSCRIBE UNSUBSCRIBE RESET QUIT |
57 |
%token CHANNEL NOTIFICATION |
%token CHANNEL NOTIFICATION |
58 |
%token AVAILABLE_ENGINES CHANNELS INFO BUFFER_FILL STREAM_COUNT VOICE_COUNT |
%token AVAILABLE_ENGINES AVAILABLE_AUDIO_OUTPUT_DRIVERS CHANNELS INFO BUFFER_FILL STREAM_COUNT VOICE_COUNT |
59 |
%token INSTRUMENT ENGINE |
%token INSTRUMENT ENGINE |
60 |
%token AUDIO_OUTPUT_CHANNEL AUDIO_OUTPUT_TYPE MIDI_INPUT_PORT MIDI_INPUT_CHANNEL MIDI_INPUT_TYPE VOLUME |
%token AUDIO_OUTPUT_CHANNEL AUDIO_OUTPUT_CHANNEL_PARAMETER AUDIO_OUTPUT_DEVICE AUDIO_OUTPUT_DEVICES AUDIO_OUTPUT_DEVICE_PARAMETER AUDIO_OUTPUT_DRIVER AUDIO_OUTPUT_DRIVER_PARAMETER MIDI_INPUT_PORT MIDI_INPUT_CHANNEL MIDI_INPUT_TYPE VOLUME |
61 |
%token BYTES PERCENTAGE |
%token BYTES PERCENTAGE |
|
%token ALSA JACK |
|
62 |
|
|
63 |
%type <Dotnum> volume |
%type <Dotnum> volume |
64 |
%type <Number> sampler_channel instrument_index udp_port audio_output_channel midi_input_channel |
%type <Number> sampler_channel instrument_index udp_port audio_output_channel midi_input_channel |
65 |
%type <String> string alpha_num_string filename engine_name session_id midi_input_port command get_instruction load_instruction set_chan_instruction load_instr_args load_engine_args |
%type <String> string alpha_num_string filename engine_name session_id midi_input_port command create_instruction destroy_instruction get_instruction list_instruction load_instruction set_chan_instruction load_instr_args load_engine_args midi_input_type set_instruction |
66 |
%type <FillResponse> buffer_size_type |
%type <FillResponse> buffer_size_type |
67 |
%type <AudioOutput> audio_output_type |
%type <KeyValList> key_val_list |
|
%type <MidiInput> midi_input_type |
|
68 |
|
|
69 |
%start input |
%start input |
70 |
|
|
78 |
; |
; |
79 |
|
|
80 |
line : /* epsilon (empty line ignored) */ |
line : /* epsilon (empty line ignored) */ |
81 |
|
| comment |
82 |
| command { LSCPSERVER->AnswerClient($1); } |
| command { LSCPSERVER->AnswerClient($1); } |
83 |
| error { LSCPSERVER->AnswerClient("Err:0:Unknown command.\r\n"); RESTART; return LSCP_SYNTAX_ERROR; } |
| error { LSCPSERVER->AnswerClient("Err:0:Unknown command.\r\n"); RESTART; return LSCP_SYNTAX_ERROR; } |
84 |
; |
; |
85 |
|
|
86 |
|
comment : HASH |
87 |
|
| comment HASH |
88 |
|
| comment SP |
89 |
|
| comment NUMBER |
90 |
|
| comment string |
91 |
|
; |
92 |
|
|
93 |
command : ADD SP CHANNEL { $$ = LSCPSERVER->AddChannel(); } |
command : ADD SP CHANNEL { $$ = LSCPSERVER->AddChannel(); } |
94 |
| GET SP get_instruction { $$ = $3; } |
| GET SP get_instruction { $$ = $3; } |
95 |
|
| CREATE SP create_instruction { $$ = $3; } |
96 |
|
| DESTROY SP destroy_instruction { $$ = $3; } |
97 |
|
| LIST SP list_instruction { $$ = $3; } |
98 |
| LOAD SP load_instruction { $$ = $3; } |
| LOAD SP load_instruction { $$ = $3; } |
99 |
| REMOVE SP CHANNEL SP sampler_channel { $$ = LSCPSERVER->RemoveChannel($5); } |
| REMOVE SP CHANNEL SP sampler_channel { $$ = LSCPSERVER->RemoveChannel($5); } |
100 |
| SET SP CHANNEL SP set_chan_instruction { $$ = $5; } |
| SET SP set_instruction { $$ = $3; } |
101 |
| SUBSCRIBE SP NOTIFICATION SP udp_port { $$ = LSCPSERVER->SubscribeNotification($5); } |
| SUBSCRIBE SP NOTIFICATION SP udp_port { $$ = LSCPSERVER->SubscribeNotification($5); } |
102 |
| UNSUBSCRIBE SP NOTIFICATION SP session_id { $$ = LSCPSERVER->UnsubscribeNotification($5); } |
| UNSUBSCRIBE SP NOTIFICATION SP session_id { $$ = LSCPSERVER->UnsubscribeNotification($5); } |
103 |
| RESET SP CHANNEL SP sampler_channel { $$ = LSCPSERVER->ResetChannel($5); } |
| RESET SP CHANNEL SP sampler_channel { $$ = LSCPSERVER->ResetChannel($5); } |
104 |
| QUIT { LSCPSERVER->AnswerClient("Bye!\r\n"); return 0; } |
| QUIT { LSCPSERVER->AnswerClient("Bye!\r\n"); return 0; } |
105 |
; |
; |
106 |
|
|
107 |
get_instruction : AVAILABLE_ENGINES { $$ = LSCPSERVER->GetAvailableEngines(); } |
get_instruction : AVAILABLE_ENGINES { $$ = LSCPSERVER->GetAvailableEngines(); } |
108 |
| CHANNELS { $$ = LSCPSERVER->GetChannels(); } |
| AVAILABLE_AUDIO_OUTPUT_DRIVERS { $$ = LSCPSERVER->GetAvailableAudioOutputDrivers(); } |
109 |
| CHANNEL SP INFO SP sampler_channel { $$ = LSCPSERVER->GetChannelInfo($5); } |
| AUDIO_OUTPUT_DRIVER SP INFO SP string { $$ = LSCPSERVER->GetAudioOutputDriverInfo($5); } |
110 |
| CHANNEL SP BUFFER_FILL SP buffer_size_type SP sampler_channel { $$ = LSCPSERVER->GetBufferFill($5, $7); } |
| AUDIO_OUTPUT_DRIVER_PARAMETER SP INFO SP string SP string { $$ = LSCPSERVER->GetAudioOutputDriverParameterInfo($5, $7); } |
111 |
| CHANNEL SP STREAM_COUNT SP sampler_channel { $$ = LSCPSERVER->GetStreamCount($5); } |
| AUDIO_OUTPUT_DRIVER_PARAMETER SP INFO SP string SP string SP key_val_list { $$ = LSCPSERVER->GetAudioOutputDriverParameterInfo($5, $7, $9); } |
112 |
| CHANNEL SP VOICE_COUNT SP sampler_channel { $$ = LSCPSERVER->GetVoiceCount($5); } |
| AUDIO_OUTPUT_DEVICES { $$ = LSCPSERVER->GetAudioOutputDeviceCount(); } |
113 |
| ENGINE SP INFO SP engine_name { $$ = LSCPSERVER->GetEngineInfo($5); } |
| AUDIO_OUTPUT_DEVICE SP INFO SP NUMBER { $$ = LSCPSERVER->GetAudioOutputDeviceInfo($5); } |
114 |
|
| AUDIO_OUTPUT_CHANNEL SP INFO SP NUMBER SP NUMBER { $$ = LSCPSERVER->GetAudioOutputChannelInfo($5, $7); } |
115 |
|
| AUDIO_OUTPUT_CHANNEL_PARAMETER SP INFO SP NUMBER SP NUMBER SP string { $$ = LSCPSERVER->GetAudioOutputChannelParameterInfo($5, $7, $9); } |
116 |
|
| CHANNELS { $$ = LSCPSERVER->GetChannels(); } |
117 |
|
| CHANNEL SP INFO SP sampler_channel { $$ = LSCPSERVER->GetChannelInfo($5); } |
118 |
|
| CHANNEL SP BUFFER_FILL SP buffer_size_type SP sampler_channel { $$ = LSCPSERVER->GetBufferFill($5, $7); } |
119 |
|
| CHANNEL SP STREAM_COUNT SP sampler_channel { $$ = LSCPSERVER->GetStreamCount($5); } |
120 |
|
| CHANNEL SP VOICE_COUNT SP sampler_channel { $$ = LSCPSERVER->GetVoiceCount($5); } |
121 |
|
| ENGINE SP INFO SP engine_name { $$ = LSCPSERVER->GetEngineInfo($5); } |
122 |
|
; |
123 |
|
|
124 |
|
set_instruction : AUDIO_OUTPUT_DEVICE_PARAMETER SP NUMBER SP string SP alpha_num_string { $$ = LSCPSERVER->SetAudioOutputDeviceParameter($3, $5, $7); } |
125 |
|
| AUDIO_OUTPUT_DEVICE_PARAMETER SP NUMBER SP string EQ alpha_num_string { $$ = LSCPSERVER->SetAudioOutputDeviceParameter($3, $5, $7); } |
126 |
|
| AUDIO_OUTPUT_CHANNEL_PARAMETER SP NUMBER SP NUMBER SP string SP alpha_num_string { $$ = LSCPSERVER->SetAudioOutputChannelParameter($3, $5, $7, $9); } |
127 |
|
| AUDIO_OUTPUT_CHANNEL_PARAMETER SP NUMBER SP NUMBER SP string EQ alpha_num_string { $$ = LSCPSERVER->SetAudioOutputChannelParameter($3, $5, $7, $9); } |
128 |
|
| CHANNEL SP set_chan_instruction { $$ = $3; } |
129 |
|
; |
130 |
|
|
131 |
|
create_instruction : AUDIO_OUTPUT_DEVICE SP string SP key_val_list { $$ = LSCPSERVER->CreateAudioOutputDevice($3,$5); } |
132 |
|
; |
133 |
|
|
134 |
|
destroy_instruction : AUDIO_OUTPUT_DEVICE SP NUMBER { $$ = LSCPSERVER->DestroyAudioOutputDevice($3); } |
135 |
; |
; |
136 |
|
|
137 |
load_instruction : INSTRUMENT SP load_instr_args { $$ = $3; } |
load_instruction : INSTRUMENT SP load_instr_args { $$ = $3; } |
138 |
| ENGINE SP load_engine_args { $$ = $3; } |
| ENGINE SP load_engine_args { $$ = $3; } |
139 |
; |
; |
140 |
|
|
141 |
set_chan_instruction : AUDIO_OUTPUT_CHANNEL SP sampler_channel SP audio_output_channel { $$ = LSCPSERVER->SetAudioOutputChannel($5, $3); } |
set_chan_instruction : AUDIO_OUTPUT_DEVICE SP sampler_channel SP NUMBER { $$ = LSCPSERVER->SetAudioOutputDevice($5, $3); } |
142 |
| AUDIO_OUTPUT_TYPE SP sampler_channel SP audio_output_type { $$ = LSCPSERVER->SetAudioOutputType($5, $3); } |
| AUDIO_OUTPUT_CHANNEL SP sampler_channel SP audio_output_channel SP audio_output_channel { $$ = LSCPSERVER->SetAudioOutputChannel($5, $7, $3); } |
143 |
| MIDI_INPUT_PORT SP sampler_channel SP midi_input_port { $$ = LSCPSERVER->SetMIDIInputPort($5, $3); } |
| MIDI_INPUT_PORT SP sampler_channel SP midi_input_port { $$ = LSCPSERVER->SetMIDIInputPort($5, $3); } |
144 |
| MIDI_INPUT_CHANNEL SP sampler_channel SP midi_input_channel { $$ = LSCPSERVER->SetMIDIInputChannel($5, $3); } |
| MIDI_INPUT_CHANNEL SP sampler_channel SP midi_input_channel { $$ = LSCPSERVER->SetMIDIInputChannel($5, $3); } |
145 |
| MIDI_INPUT_TYPE SP sampler_channel SP midi_input_type { $$ = LSCPSERVER->SetMIDIInputType($5, $3); } |
| MIDI_INPUT_TYPE SP sampler_channel SP midi_input_type { $$ = LSCPSERVER->SetMIDIInputType($5, $3); } |
146 |
| VOLUME SP sampler_channel SP volume { $$ = LSCPSERVER->SetVolume($5, $3); } |
| VOLUME SP sampler_channel SP volume { $$ = LSCPSERVER->SetVolume($5, $3); } |
147 |
; |
; |
148 |
|
|
149 |
|
key_val_list : string EQ alpha_num_string { $$[$1] = $3; } |
150 |
|
| key_val_list SP string EQ alpha_num_string { $$ = $1; $$[$3] = $5; } |
151 |
|
|
152 |
buffer_size_type : BYTES { $$ = fill_response_bytes; } |
buffer_size_type : BYTES { $$ = fill_response_bytes; } |
153 |
| PERCENTAGE { $$ = fill_response_percentage; } |
| PERCENTAGE { $$ = fill_response_percentage; } |
154 |
; |
; |
155 |
|
|
156 |
load_instr_args : filename SP instrument_index SP sampler_channel { $$ = LSCPSERVER->LoadInstrument($1, $3, $5); } |
list_instruction : AUDIO_OUTPUT_DEVICES { $$ = LSCPSERVER->GetAudioOutputDevices(); } |
157 |
; |
; |
158 |
|
|
159 |
load_engine_args : engine_name SP sampler_channel { $$ = LSCPSERVER->LoadEngine($1, $3); } |
load_instr_args : filename SP instrument_index SP sampler_channel { $$ = LSCPSERVER->LoadInstrument($1, $3, $5); } |
160 |
; |
; |
161 |
|
|
162 |
audio_output_type : ALSA { $$ = AudioOutputDevice::type_alsa; } |
load_engine_args : engine_name SP sampler_channel { $$ = LSCPSERVER->LoadEngine($1, $3); } |
|
| JACK { $$ = AudioOutputDevice::type_jack; } |
|
163 |
; |
; |
164 |
|
|
165 |
midi_input_type : ALSA { $$ = MidiInputDevice::type_alsa; } |
midi_input_type : string |
166 |
; |
; |
167 |
|
|
168 |
volume : DOTNUM |
volume : DOTNUM |