95 : fClass(new
Klass(name, super, numInputs, numOutputs, vec)),
96 fNeedToDeleteClass(true),
103 fNeedToDeleteClass(false),
148 static string wdel(
const string& s)
152 while (i<j && s[i]==
' ') i++;
153 while (j>i && s[j-1] ==
' ') j--;
154 return s.substr(i,j-i);
166 Tree label, elements, varname, sig;
175 string simplifiedLabel;
176 map<string, set<string> > metadata;
180 for (map<
string, set<string> >::iterator i = metadata.begin(); i != metadata.end(); i++) {
181 const string& key = i->first;
182 const set<string>& values = i->second;
183 for (set<string>::const_iterator j = values.begin(); j != values.end(); j++) {
191 case 0 : model =
"interface->openVerticalBox(\"$0\");";
break;
192 case 1 : model =
"interface->openHorizontalBox(\"$0\");";
break;
193 case 2 : model =
"interface->openTabBox(\"$0\");";
break;
195 fprintf(stderr,
"error in user interface generation 1\n");
202 }
else if (
isUiWidget(t, label, varname, sig)) {
208 fprintf(stderr,
"error in user interface generation 2\n");
219 while (!
isNil(elements)) {
221 elements =
tl(elements);
231 Tree path, c, x, y, z;
233 map<string, set<string> > metadata;
238 for (map<
string, set<string> >::iterator i = metadata.begin(); i != metadata.end(); i++) {
239 const string& key = i->first;
240 const set<string>& values = i->second;
241 for (set<string>::const_iterator j = values.begin(); j != values.end(); j++) {
301 fprintf(stderr,
"Error in generating widget code\n");
314 Tree label, elements, varname, sig;
317 string pathname2 = pathname;
320 if (str.length()>0) pathname2 += str +
"/";
323 }
else if (
isUiWidget(t, label, varname, sig)) {
329 fprintf(stderr,
"error in user interface macro generation 2\n");
341 while (!
isNil(elements)) {
343 elements =
tl(elements);
354 Tree path, c, x, y, z;
356 map<string, set<string> > metadata;
361 string pathlabel = pathname+label;
412 fprintf(stderr,
"Error in generating widget code\n");
bool isSigHSlider(Tree s)
bool isSigCheckbox(Tree s)
void generateWidgetCode(Tree fulllabel, Tree varname, Tree sig)
Generate buildUserInterface C++ lines of code corresponding to user interface widget t...
bool isSigNumEntry(Tree s)
void addUIWidget(Tree path, Tree widget)
Add a widget with a certain path to the user interface tree.
Tree cons(Tree a, Tree b)
int tree2int(Tree t)
if t has a node of type int, return it otherwise error
Tree prepareUserInterfaceTree(Tree t)
Remove fake root folder if not needed (that is if the UI is completely enclosed in one folder...
void generateUserInterfaceTree(Tree t)
Generate buildUserInterface C++ lines of code corresponding to user interface element t...
A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches.
bool isSigVBargraph(Tree s)
bool isSigVSlider(Tree s)
static string wdel(const string &s)
Removes enclosing whitespaces : ' toto ' -> 'toto'.
void addUIMacro(const string &str)
Compiler(const string &name, const string &super, int numInputs, int numOutputs, bool vec)
Tree uiFolder(Tree label, Tree elements)
void generateMacroInterfaceTree(const string &pathname, Tree t)
Generate user interface macros corresponding to user interface element t.
string subst(const string &model, const vector< string > &args)
Text substitution.
bool isSigHBargraph(Tree s)
void extractMetadata(const string &fulllabel, string &label, map< string, set< string > > &metadata)
Extracts metdata from a label : 'vol [unit: dB]' -> 'vol' + metadata.
bool isUiWidget(Tree t, Tree &label, Tree &varname, Tree &sig)
const char * name(Symbol *sym)
Returns the name of a symbol.
void generateUserInterfaceElements(Tree elements)
Iterate generateUserInterfaceTree on a list of user interface elements.
void addUICode(const string &str)
void generateMacroInterfaceElements(const string &pathname, Tree elements)
Iterate generateMacroInterfaceTree on a list of user interface elements.
Tree putSubFolder(Tree folder, Tree path, Tree item)
API to the typing system of signals.
double tree2float(Tree t)
if t has a node of type float, return it otherwise error
void generateWidgetMacro(const string &pathname, Tree fulllabel, Tree varname, Tree sig)
Generate user interface macros corresponding to a user interface widget.
const char * tree2str(Tree t)
if t has a node of type symbol, return its name otherwise error