3 Copyright (C) 2011 Grame
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 Grame Research Laboratory, 9 rue du Garet, 69001 Lyon - France
25 #ifndef __FaustFactory__
26 #define __FaustFactory__
31 #include "MessageDriven.h"
38 typedef class SMARTP
<MessageDriven
> SMessageDriven
;
40 //--------------------------------------------------------------------------
42 \brief a factory to build a OSC UI hierarchy
44 Actually, makes use of a stack to build the UI hierarchy.
45 It includes a pointer to a OSCIO controler, but just to give it to the root node.
49 std::stack
<SMessageDriven
> fNodes
; ///< maintains the current hierarchy level
50 SMessageDriven fRoot
; ///< keep track of the root node
51 OSCIO
* fIO
; ///< hack to support audio IO via OSC, actually the field is given to the root node
54 SMessageDriven
followPath (SMessageDriven fRoot
, const std::string
& fullpath
, std::string
& pathtoleaf
);
55 void createNodeChain (SMessageDriven node
, const std::string
& pathtoleaf
, float* zone
, float imin
, float imax
, float init
, float min
, float max
);
58 FaustFactory(OSCIO
* io
=0) : fIO(io
) {}
59 virtual ~FaustFactory() {}
61 void addnode (const char* label
, float* zone
, float init
, float min
, float max
);
62 void addfullpathnode (const std::string
& fullpath
, float* zone
, float imin
, float imax
, float init
, float min
, float max
);
63 void opengroup (const char* label
);
66 SMessageDriven
root() const { return fRoot
; }