Add "GUI not supported" primitives to Faustine.
[Faustine.git] / interpreter / preprocessor / faust-0.9.47mr3 / architecture / alsa-qt.cpp
1 /************************************************************************
2
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 *************************************************************************/
8
9 /*******************BEGIN ARCHITECTURE SECTION (part 1/2)****************/
10
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.
19
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.
24
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/>.
27
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.
32
33
34 ************************************************************************
35 ************************************************************************/
36
37 #include <libgen.h>
38 #include <stdlib.h>
39 #include <iostream>
40
41 #include "gui/FUI.h"
42 #include "misc.h"
43 #include "gui/faustqt.h"
44 #include "audio/alsa-dsp.h"
45
46 #ifdef OSCCTRL
47 #include "gui/OSCUI.h"
48 #endif
49
50
51 /**************************BEGIN USER SECTION **************************/
52 /******************************************************************************
53 *******************************************************************************
54
55 VECTOR INTRINSICS
56
57 *******************************************************************************
58 *******************************************************************************/
59
60 <<includeIntrinsic>>
61
62
63 <<includeclass>>
64
65 /***************************END USER SECTION ***************************/
66
67 /*******************BEGIN ARCHITECTURE SECTION (part 2/2)***************/
68
69 mydsp DSP;
70
71 list<GUI*> GUI::fGuiList;
72
73 //-------------------------------------------------------------------------
74 // MAIN
75 //-------------------------------------------------------------------------
76 int main(int argc, char *argv[] )
77 {
78 char* appname = basename (argv [0]);
79 char rcfilename[256];
80 char* home = getenv("HOME");
81 snprintf(rcfilename, 255, "%s/.%src", home, appname);
82
83 GUI* interface = new QTGUI(argc, argv);
84 FUI* finterface = new FUI();
85 DSP.buildUserInterface(interface);
86 DSP.buildUserInterface(finterface);
87
88 #ifdef OSCCTRL
89 GUI* oscinterface = new OSCUI(appname, argc, argv);
90 DSP.buildUserInterface(oscinterface);
91 #endif
92
93 alsaaudio audio (argc, argv, &DSP);
94 audio.init(appname, &DSP);
95 finterface->recallState(rcfilename);
96 audio.start();
97
98 #ifdef OSCCTRL
99 oscinterface->run();
100 #endif
101 interface->run();
102
103 audio.stop();
104 finterface->saveState(rcfilename);
105 return 0;
106 }
107 /********************END ARCHITECTURE SECTION (part 2/2)****************/
108