Merge branch 'master' of https://scm.cri.ensmp.fr/git/Faustine
[Faustine.git] / interpretor / preprocessor / faust-0.9.47mr3 / architecture / oscio-gtk.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 <iostream>
39 #include <list>
40
41 #include "gui/FUI.h"
42 #include "gui/faustgtk.h"
43 #include "gui/OSCUI.h"
44 #include "misc.h"
45 #include "audio/oscdsp.h"
46
47
48 /**************************BEGIN USER SECTION **************************/
49
50 /******************************************************************************
51 *******************************************************************************
52
53 VECTOR INTRINSICS
54
55 *******************************************************************************
56 *******************************************************************************/
57 <<includeIntrinsic>>
58
59
60 <<includeclass>>
61
62 /***************************END USER SECTION ***************************/
63
64 /*******************BEGIN ARCHITECTURE SECTION (part 2/2)***************/
65
66 mydsp DSP;
67
68 list<GUI*> GUI::fGuiList;
69
70 /******************************************************************************
71 *******************************************************************************
72
73 MAIN PLAY THREAD
74
75 *******************************************************************************
76 *******************************************************************************/
77 int main( int argc, char *argv[] )
78 {
79 char name[256], dst[258];
80 char rcfilename[256]; float oscio = 0;
81
82 char* home = getenv("HOME");
83 snprintf(name, 255, "%s", basename(argv[0]));
84 snprintf(dst, 257, "/%s/", name);
85 snprintf(rcfilename, 255, "%s/.%src", home, name);
86
87 GUI* interface = new GTKUI (name, &argc, &argv);
88 FUI* finterface = new FUI();
89 DSP.buildUserInterface(interface);
90 DSP.buildUserInterface(finterface);
91
92 oscdsp osca (dst, argc, argv);
93 OSCUI* oscinterface = new OSCUI(name, argc, argv, &osca);
94 DSP.buildUserInterface(oscinterface);
95 oscinterface->addToggleButton("OSC IO", &oscio);
96
97 snprintf(dst, 257, "/%s/", oscinterface->getRootName());
98 osca.setDest (dst);
99
100 osca.init (name, &DSP);
101 finterface->recallState(rcfilename);
102 osca.start ();
103
104 oscinterface->run();
105 interface->run();
106 finterface->saveState(rcfilename);
107 osca.stop();
108 delete oscinterface;
109 return 0;
110 }
111
112
113 /********************END ARCHITECTURE SECTION (part 2/2)****************/
114
115