/[svn]/linuxsampler/trunk/src/network/lscp.y
ViewVC logotype

Diff of /linuxsampler/trunk/src/network/lscp.y

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 123 by schoenebeck, Mon Jun 14 19:33:16 2004 UTC revision 138 by senkov, Sun Jun 20 23:18:24 2004 UTC
# Line 44  extern void yyrestart(FILE* input_file, Line 44  extern void yyrestart(FILE* input_file,
44  // we provide our own version of yyerror() so we don't have to link against the yacc library  // we provide our own version of yyerror() so we don't have to link against the yacc library
45  void yyerror(const char* s);  void yyerror(const char* s);
46    
47    bool background;
48  %}  %}
49    
50  // reentrant parser  // reentrant parser
# Line 52  void yyerror(const char* s); Line 53  void yyerror(const char* s);
53  %token <Char>   CHAR  %token <Char>   CHAR
54  %token <Dotnum> DOTNUM  %token <Dotnum> DOTNUM
55  %token <Number> NUMBER  %token <Number> NUMBER
56    %token <String> STRINGVAL
57  %token SP LF CR HASH EQ  %token SP LF CR HASH EQ
58  %token ADD GET CREATE DESTROY LIST LOAD REMOVE SET SUBSCRIBE UNSUBSCRIBE RESET QUIT  %token ADD GET CREATE DESTROY LIST LOAD LOAD_BACKGROUND REMOVE SET SUBSCRIBE UNSUBSCRIBE RESET QUIT
59  %token CHANNEL NOTIFICATION  %token CHANNEL NOTIFICATION
60  %token AVAILABLE_ENGINES AVAILABLE_AUDIO_OUTPUT_DRIVERS CHANNELS INFO BUFFER_FILL STREAM_COUNT VOICE_COUNT  %token AVAILABLE_ENGINES AVAILABLE_AUDIO_OUTPUT_DRIVERS CHANNELS INFO BUFFER_FILL STREAM_COUNT VOICE_COUNT
61  %token INSTRUMENT ENGINE  %token INSTRUMENT ENGINE
62  %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  %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
63  %token BYTES PERCENTAGE  %token BYTES PERCENTAGE
64    %token MISCELLANEOUS
65    
66  %type <Dotnum> volume  %type <Dotnum> volume
67  %type <Number> sampler_channel instrument_index udp_port audio_output_channel midi_input_channel  %type <Number> sampler_channel instrument_index audio_output_channel midi_input_channel
68  %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  %type <String> string param_val filename engine_name 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 subscribe_event unsubscribe_event
69  %type <FillResponse> buffer_size_type  %type <FillResponse> buffer_size_type
70  %type <KeyValList> key_val_list  %type <KeyValList> key_val_list
71    
# Line 95  command               :  ADD SP CHANNEL Line 98  command               :  ADD SP CHANNEL
98                        |  CREATE SP create_instruction               { $$ = $3;                                        }                        |  CREATE SP create_instruction               { $$ = $3;                                        }
99                        |  DESTROY SP destroy_instruction             { $$ = $3;                                        }                        |  DESTROY SP destroy_instruction             { $$ = $3;                                        }
100                        |  LIST SP list_instruction                   { $$ = $3;                                        }                        |  LIST SP list_instruction                   { $$ = $3;                                        }
101                        |  LOAD SP load_instruction                   { $$ = $3;                                        }                        |  LOAD SP load_instruction                   { $$ = $3; background = false;                    }
102                          |  LOAD_BACKGROUND SP load_instruction        { $$ = $3; background = true;                     }
103                        |  REMOVE SP CHANNEL SP sampler_channel       { $$ = LSCPSERVER->RemoveChannel($5);             }                        |  REMOVE SP CHANNEL SP sampler_channel       { $$ = LSCPSERVER->RemoveChannel($5);             }
104                        |  SET SP set_instruction                     { $$ = $3;                                        }                        |  SET SP set_instruction                     { $$ = $3;                                        }
105                        |  SUBSCRIBE SP NOTIFICATION SP udp_port      { $$ = LSCPSERVER->SubscribeNotification($5);     }                        |  SUBSCRIBE SP subscribe_event               { $$ = $3;                                        }
106                        |  UNSUBSCRIBE SP NOTIFICATION SP session_id  { $$ = LSCPSERVER->UnsubscribeNotification($5);   }                        |  UNSUBSCRIBE SP unsubscribe_event           { $$ = $3;                                        }
107                        |  RESET SP CHANNEL SP sampler_channel        { $$ = LSCPSERVER->ResetChannel($5);              }                        |  RESET SP CHANNEL SP sampler_channel        { $$ = LSCPSERVER->ResetChannel($5);              }
108                        |  QUIT                                       { LSCPSERVER->AnswerClient("Bye!\r\n"); return 0; }                        |  QUIT                                       { LSCPSERVER->AnswerClient("Bye!\r\n"); return 0; }
109                        ;                        ;
110    
111    subscribe_event       :  CHANNELS                                   { $$ = LSCPSERVER->SubscribeNotification(event_channels); }
112                          |  VOICE_COUNT                                { $$ = LSCPSERVER->SubscribeNotification(event_voice_count); }
113                          |  STREAM_COUNT                               { $$ = LSCPSERVER->SubscribeNotification(event_stream_count); }
114                          |  BUFFER_FILL                                { $$ = LSCPSERVER->SubscribeNotification(event_channel_buffer_fill); }
115                          |  INFO                                       { $$ = LSCPSERVER->SubscribeNotification(event_channel_info); }
116                          |  MISCELLANEOUS                              { $$ = LSCPSERVER->SubscribeNotification(event_misc); }
117                          ;
118    
119    unsubscribe_event     :  CHANNELS                                   { $$ = LSCPSERVER->UnsubscribeNotification(event_channels); }
120                          |  VOICE_COUNT                                { $$ = LSCPSERVER->UnsubscribeNotification(event_voice_count); }
121                          |  STREAM_COUNT                               { $$ = LSCPSERVER->UnsubscribeNotification(event_stream_count); }
122                          |  BUFFER_FILL                                { $$ = LSCPSERVER->UnsubscribeNotification(event_channel_buffer_fill); }
123                          |  INFO                                       { $$ = LSCPSERVER->UnsubscribeNotification(event_channel_info); }
124                          |  MISCELLANEOUS                              { $$ = LSCPSERVER->UnsubscribeNotification(event_misc); }
125                          ;
126    
127  get_instruction       :  AVAILABLE_ENGINES                                                          { $$ = LSCPSERVER->GetAvailableEngines();                          }  get_instruction       :  AVAILABLE_ENGINES                                                          { $$ = LSCPSERVER->GetAvailableEngines();                          }
128                        |  AVAILABLE_AUDIO_OUTPUT_DRIVERS                                             { $$ = LSCPSERVER->GetAvailableAudioOutputDrivers();               }                        |  AVAILABLE_AUDIO_OUTPUT_DRIVERS                                             { $$ = LSCPSERVER->GetAvailableAudioOutputDrivers();               }
129                        |  AUDIO_OUTPUT_DRIVER SP INFO SP string                                      { $$ = LSCPSERVER->GetAudioOutputDriverInfo($5);                   }                        |  AUDIO_OUTPUT_DRIVER SP INFO SP string                                      { $$ = LSCPSERVER->GetAudioOutputDriverInfo($5);                   }
# Line 121  get_instruction       :  AVAILABLE_ENGIN Line 141  get_instruction       :  AVAILABLE_ENGIN
141                        |  ENGINE SP INFO SP engine_name                                              { $$ = LSCPSERVER->GetEngineInfo($5);                              }                        |  ENGINE SP INFO SP engine_name                                              { $$ = LSCPSERVER->GetEngineInfo($5);                              }
142                        ;                        ;
143    
144  set_instruction       :  AUDIO_OUTPUT_DEVICE_PARAMETER SP NUMBER SP string SP alpha_num_string             { $$ = LSCPSERVER->SetAudioOutputDeviceParameter($3, $5, $7);      }  set_instruction       :  AUDIO_OUTPUT_DEVICE_PARAMETER SP NUMBER SP string EQ param_val             { $$ = LSCPSERVER->SetAudioOutputDeviceParameter($3, $5, $7);      }
145                        |  AUDIO_OUTPUT_DEVICE_PARAMETER SP NUMBER SP string EQ alpha_num_string             { $$ = LSCPSERVER->SetAudioOutputDeviceParameter($3, $5, $7);      }                        |  AUDIO_OUTPUT_CHANNEL_PARAMETER SP NUMBER SP NUMBER SP string EQ param_val  { $$ = LSCPSERVER->SetAudioOutputChannelParameter($3, $5, $7, $9); }
                       |  AUDIO_OUTPUT_CHANNEL_PARAMETER SP NUMBER SP NUMBER SP string SP alpha_num_string  { $$ = LSCPSERVER->SetAudioOutputChannelParameter($3, $5, $7, $9); }  
                       |  AUDIO_OUTPUT_CHANNEL_PARAMETER SP NUMBER SP NUMBER SP string EQ alpha_num_string  { $$ = LSCPSERVER->SetAudioOutputChannelParameter($3, $5, $7, $9); }  
146                        |  CHANNEL SP set_chan_instruction                                                   { $$ = $3;                                                         }                        |  CHANNEL SP set_chan_instruction                                                   { $$ = $3;                                                         }
147                        ;                        ;
148    
149  create_instruction    :  AUDIO_OUTPUT_DEVICE SP string SP key_val_list  { $$ = LSCPSERVER->CreateAudioOutputDevice($3,$5); }  create_instruction    :  AUDIO_OUTPUT_DEVICE SP string SP key_val_list { $$ = LSCPSERVER->CreateAudioOutputDevice($3,$5); }
150                          |  AUDIO_OUTPUT_DEVICE SP string                 { $$ = LSCPSERVER->CreateAudioOutputDevice($3); }
151                        ;                        ;
152    
153  destroy_instruction   :  AUDIO_OUTPUT_DEVICE SP NUMBER  { $$ = LSCPSERVER->DestroyAudioOutputDevice($3); }  destroy_instruction   :  AUDIO_OUTPUT_DEVICE SP NUMBER  { $$ = LSCPSERVER->DestroyAudioOutputDevice($3); }
# Line 146  set_chan_instruction  :  AUDIO_OUTPUT_DE Line 165  set_chan_instruction  :  AUDIO_OUTPUT_DE
165                        |  VOLUME SP sampler_channel SP volume                                                      { $$ = LSCPSERVER->SetVolume($5, $3);                 }                        |  VOLUME SP sampler_channel SP volume                                                      { $$ = LSCPSERVER->SetVolume($5, $3);                 }
166                        ;                        ;
167    
168  key_val_list          :  string EQ alpha_num_string                  { $$[$1] = $3;          }  key_val_list          :  string EQ param_val                  { $$[$1] = $3;          }
169                        |  key_val_list SP string EQ alpha_num_string  { $$ = $1; $$[$3] = $5; }                        |  key_val_list SP string EQ param_val  { $$ = $1; $$[$3] = $5; }
170                          ;
171    
172  buffer_size_type      :  BYTES       { $$ = fill_response_bytes;      }  buffer_size_type      :  BYTES       { $$ = fill_response_bytes;      }
173                        |  PERCENTAGE  { $$ = fill_response_percentage; }                        |  PERCENTAGE  { $$ = fill_response_percentage; }
# Line 156  buffer_size_type      :  BYTES       { $ Line 176  buffer_size_type      :  BYTES       { $
176  list_instruction      :  AUDIO_OUTPUT_DEVICES  { $$ = LSCPSERVER->GetAudioOutputDevices(); }  list_instruction      :  AUDIO_OUTPUT_DEVICES  { $$ = LSCPSERVER->GetAudioOutputDevices(); }
177                        ;                        ;
178    
179  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, background); }
180                        ;                        ;
181    
182  load_engine_args      :  engine_name SP sampler_channel  { $$ = LSCPSERVER->LoadEngine($1, $3); }  load_engine_args      :  engine_name SP sampler_channel  { $$ = LSCPSERVER->LoadEngine($1, $3); }
# Line 175  sampler_channel       :  NUMBER Line 195  sampler_channel       :  NUMBER
195  instrument_index      :  NUMBER  instrument_index      :  NUMBER
196                        ;                        ;
197    
 udp_port              :  NUMBER  
                       ;  
   
198  audio_output_channel  :  NUMBER  audio_output_channel  :  NUMBER
199                        ;                        ;
200    
201  midi_input_channel    :  NUMBER  midi_input_channel    :  NUMBER
202                        ;                        ;
203    
 session_id            :  alpha_num_string  
                       ;  
   
204  engine_name           :  string  engine_name           :  string
205                        ;                        ;
206    
207  midi_input_port       :  alpha_num_string  midi_input_port       :  STRINGVAL
208                        ;                        ;
209    
210  filename              :  alpha_num_string  filename              :  STRINGVAL
                       |  filename SP alpha_num_string  { $$ = $1 + ' ' + $3; }  
211                        ;                        ;
212    
213  alpha_num_string      :  string                   { $$ = $1;                                             }  param_val             :  STRINGVAL                { $$ = $1;                                             }
214                        |  NUMBER                   { std::stringstream ss; ss << $1; $$ = ss.str();       }                        |  NUMBER                   { std::stringstream ss; ss << $1; $$ = ss.str();       }
215                        |  alpha_num_string string  { $$ = $1 + $2;                                        }                        |  DOTNUM                   { std::stringstream ss; ss << $1; $$ = ss.str();       }
                       |  alpha_num_string NUMBER  { std::stringstream ss; ss << $1 << $2; $$ = ss.str(); }  
216                        ;                        ;
217    
218  string                :  CHAR          { std::string s; s = $1; $$ = s; }  string                :  CHAR          { std::string s; s = $1; $$ = s; }

Legend:
Removed from v.123  
changed lines
  Added in v.138

  ViewVC Help
Powered by ViewVC