908be204ef865500694c8c87eb6937693e8610eb
1 /************************************************************************
3 IMPORTANT NOTE : this file contains two clearly delimited sections :
4 the ARCHITECTURE section (in two parts) and the USER section. Each section
5 is governed by its own copyright and license. Please check individually
6 each section for license and copyright information.
7 *************************************************************************/
9 /*******************BEGIN ARCHITECTURE SECTION (part 1/2)****************/
11 /************************************************************************
12 FAUST Architecture File
13 Copyright (C) 2003-2011 GRAME, Centre National de Creation Musicale
14 ---------------------------------------------------------------------
15 This Architecture section is free software; you can redistribute it
16 and/or modify it under the terms of the GNU General Public License
17 as published by the Free Software Foundation; either version 3 of
18 the License, or (at your option) any later version.
20 This program is distributed in the hope that it will be useful,
21 but WITHOUT ANY WARRANTY; without even the implied warranty of
22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 GNU General Public License for more details.
25 You should have received a copy of the GNU General Public License
26 along with this program; If not, see <http://www.gnu.org/licenses/>.
28 EXCEPTION : As a special exception, you may create a larger work
29 that contains this FAUST architecture section and distribute
30 that work under terms of your choice, so long as this FAUST
31 architecture section is not modified.
34 ************************************************************************
35 ************************************************************************/
42 #include "audio/portaudio-dsp.h"
43 #include "gui/faustgtk.h"
46 #include "gui/OSCUI.h"
49 /**************************BEGIN USER SECTION **************************/
50 /******************************************************************************
51 *******************************************************************************
55 *******************************************************************************
56 *******************************************************************************/
63 /***************************END USER SECTION ***************************/
65 /*******************BEGIN ARCHITECTURE SECTION (part 2/2)***************/
68 list
<GUI
*> GUI::fGuiList
;
70 //-------------------------------------------------------------------------
72 //-------------------------------------------------------------------------
74 int main(int argc
, char *argv
[] )
76 gtk_init (&argc
, &argv
);
77 const char* name
= basename(argv
[0]);
80 char* home
= getenv("HOME");
81 snprintf(rcfilename
, 255, "%s/.%src", home
, basename(argv
[0]));
83 GUI
* interface
= new GTKUI (name
, &argc
, &argv
);
84 DSP
.buildUserInterface(interface
);
87 GUI
* oscinterface
= new OSCUI(jname
, argc
, argv
);
88 DSP
.buildUserInterface(oscinterface
);
91 long srate
= (long)lopt(argv
, "--frequency", 44100);
92 int fpb
= lopt(argv
, "--buffer", 128);
93 portaudio
audio (srate
, fpb
);
95 audio
.init(name
, &DSP
);
96 //interface->recallState(rcfilename);
105 //interface->saveState(rcfilename);
110 long lopt(char *argv
[], const char *name
, long def
)
113 for (i
=0; argv
[i
]; i
++) if (!strcmp(argv
[i
], name
)) return atoi(argv
[i
+1]);
117 int main(int argc
, char *argv
[])
120 char rcfilename
[256];
121 char* home
= getenv("HOME");
123 snprintf(appname
, 255, "%s", basename(argv
[0]));
124 snprintf(rcfilename
, 255, "%s/.%src", home
, appname
);
126 GUI
* interface
= new GTKUI (appname
, &argc
, &argv
);
127 FUI
* finterface
= new FUI();
128 DSP
.buildUserInterface(interface
);
129 DSP
.buildUserInterface(finterface
);
132 GUI
* oscinterface
= new OSCUI(appname
, argc
, argv
);
133 DSP
.buildUserInterface(oscinterface
);
136 long srate
= (long)lopt(argv
, "--frequency", 44100);
137 int fpb
= lopt(argv
, "--buffer", 128);
139 portaudio
audio (srate
, fpb
);
140 audio
.init(appname
, &DSP
);
141 finterface
->recallState(rcfilename
);
150 finterface
->saveState(rcfilename
);
155 /********************END ARCHITECTURE SECTION (part 2/2)****************/