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

Contents of /linuxsampler/trunk/src/network/lscp.l

Parent Directory Parent Directory | Revision Log Revision Log


Revision 143 - (show annotations) (download)
Wed Jun 23 18:54:08 2004 UTC (19 years, 10 months ago) by capela
File size: 5817 byte(s)
* SET CHANNEL AUDIO_OUTPUT_TYPE <chan> <driver> command is back!
  creates an audio output device instance of the given driver type
  ('Jack' or 'Alsa') with default parameters if none exists,
  otherwise it just picks the first available device and assign
  it to the intended sampler channel.

* The AudioOutputDevice class get's a new pure virtual method,
  Driver(), which is implemented on both of the existing inherited
  classes, AudioOutputDeviceAlsa and AudioOutputDeviceJack, with
  the sole purpose to return the driver type name as a String
  ('Alsa' and 'Jack', respectively).

* The quoting on the filename argument for the LOAD INSTRUMENT
  command has been made optional; you can have both ways, with
  single quotes or none, keeping compability with older LSCP
  specification.

* An additional sanity check is made on LOAD INSTRUMENT, whether
  the sampler channel has an audio output device assigned, thus
  preventing the server from crashing on instrument file load.

* The GET AUDIO_OUTPUT_DEVICE INFO now includes the missing
  'driver' item, as predicted by the draft protocol document.

1 /***************************************************************************
2 * *
3 * LinuxSampler - modular, streaming capable sampler *
4 * *
5 * Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck *
6 * *
7 * This program is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation; either version 2 of the License, or *
10 * (at your option) any later version. *
11 * *
12 * This program is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU General Public License *
18 * along with this program; if not, write to the Free Software *
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
20 * MA 02111-1307 USA *
21 ***************************************************************************/
22
23 %{
24
25 #include "lscpparser.h"
26 #include "lscpsymbols.h"
27
28 /// handle for a client connection (FIXME: doesn't work for more than one network connections of course)
29 int hSession;
30
31 %}
32
33 %option reentrant
34
35 %x INSTRING
36
37 DIGIT [0-9]
38
39 %%
40
41 " " { return SP; }
42 \n { return LF; }
43 \r { return CR; }
44 "#" { return HASH; }
45 "=" { return EQ; }
46 ("+"|"-")?{DIGIT}+"."{DIGIT}+ { yylval->Dotnum = atof(yytext); return DOTNUM; }
47 ADD { return ADD; }
48 GET { return GET; }
49 CREATE { return CREATE; }
50 DESTROY { return DESTROY; }
51 LIST { return LIST; }
52 LOAD { return LOAD; }
53 NON_MODAL { return NON_MODAL; }
54 REMOVE { return REMOVE; }
55 SET { return SET; }
56 SUBSCRIBE { return SUBSCRIBE; }
57 UNSUBSCRIBE { return UNSUBSCRIBE; }
58 CHANNEL { return CHANNEL; }
59 NOTIFICATION { return NOTIFICATION; }
60 AVAILABLE_ENGINES { return AVAILABLE_ENGINES; }
61 AVAILABLE_AUDIO_OUTPUT_DRIVERS { return AVAILABLE_AUDIO_OUTPUT_DRIVERS; }
62 CHANNELS { return CHANNELS; }
63 INFO { return INFO; }
64 BUFFER_FILL { return BUFFER_FILL; }
65 STREAM_COUNT { return STREAM_COUNT; }
66 VOICE_COUNT { return VOICE_COUNT; }
67 INSTRUMENT { return INSTRUMENT; }
68 ENGINE { return ENGINE; }
69 AUDIO_OUTPUT_DEVICE { return AUDIO_OUTPUT_DEVICE; }
70 AUDIO_OUTPUT_DEVICES { return AUDIO_OUTPUT_DEVICES; }
71 AUDIO_OUTPUT_DEVICE_PARAMETER { return AUDIO_OUTPUT_DEVICE_PARAMETER; }
72 AUDIO_OUTPUT_DRIVER { return AUDIO_OUTPUT_DRIVER; }
73 AUDIO_OUTPUT_DRIVER_PARAMETER { return AUDIO_OUTPUT_DRIVER_PARAMETER; }
74 AUDIO_OUTPUT_CHANNEL { return AUDIO_OUTPUT_CHANNEL; }
75 AUDIO_OUTPUT_CHANNEL_PARAMETER { return AUDIO_OUTPUT_CHANNEL_PARAMETER; }
76 AUDIO_OUTPUT_TYPE { return AUDIO_OUTPUT_TYPE; }
77 MIDI_INPUT_PORT { return MIDI_INPUT_PORT; }
78 MIDI_INPUT_CHANNEL { return MIDI_INPUT_CHANNEL; }
79 MIDI_INPUT_TYPE { return MIDI_INPUT_TYPE; }
80 VOLUME { return VOLUME; }
81 BYTES { return BYTES; }
82 PERCENTAGE { return PERCENTAGE; }
83 RESET { return RESET; }
84 MISCELLANEOUS { return MISCELLANEOUS; }
85 QUIT { return QUIT; }
86 0|([1-9]{DIGIT}*) { yylval->Number = atoi(yytext); return NUMBER; }
87 "\'" { yylval->String = ""; BEGIN(INSTRING); }
88 <INSTRING>[^\'\\]+ { yylval->String += yytext; }
89 <INSTRING>"\\n" { yylval->String += '\n'; }
90 <INSTRING>"\\r" { yylval->String += '\r'; }
91 <INSTRING>"\\t" { yylval->String += '\t'; }
92 <INSTRING>"\\\\" { yylval->String += '\\'; }
93 <INSTRING>"\\\"" { yylval->String += '\"'; }
94 <INSTRING>"\\\'" { yylval->String += '\''; }
95 <INSTRING>"\\"[^nrt\"\\] { yylval->String += yytext; }
96 <INSTRING>"\'" { BEGIN(INITIAL); return STRINGVAL; }
97 . { yylval->Char = yytext[0]; return CHAR; }
98
99 %%
100
101 /**
102 * We provide our own version of yywrap() so we don't have to link against
103 * the lex library.
104 */
105 int yywrap(yyscan_t yyscanner) {
106 return 1; // continue scanning
107 }

  ViewVC Help
Powered by ViewVC