fldoxygen.h 6.72 KB
 thomas committed Aug 17, 2002 1 2 3 #ifndef __FLEXT_DOXYGEN_H #define __FLEXT_DOXYGEN_H  thomas committed Aug 18, 2002 4 5 6 7 8 /*! \file fldoxygen.h \brief Doxygen definitions \remark There is no code in here, just documentation stuff. */  thomas committed Nov 19, 2002 9 /*!  thomas committed Aug 17, 2002 10   thomas committed Nov 19, 2002 11 \mainpage flext - a C++ layer for cross-platform development of PD and Max/MSP objects  thomas committed Aug 17, 2002 12   thomas committed Nov 19, 2002 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 \section INTRO Introduction Currently there exist two widely used modular systems for real-time audio that can be extended by self-written objects (so called "externals"):
Max/MSP (http://www.cycling74.com) and Pure Data (http://www.pure-data.org). Both come with APIs that are not very different, but as well not quite the same. Flext seeks to provide a unifying interface for the APIs of those real-time systems while also concentrating on making use of the advantages of the object orientation of the C++ language. Consequently, flext allows to write externals (or libraries of a number of these), that can be compiled for both systems (with various compilers on a few platforms) without changes to the source code. The advantages of flext are:
• Identical source code for PD and Max/MSP objects on a number of platforms
• Better readability of code compared to straight C externals
• Faster development, more robust coding
• Sharing of common methods and data by using base classes
• Transparent use of threads for methods
• Libraries of externals in Max/MSP
• More than 3 typed creation arguments possible for Max/MSP
• Any input to any object's inlet (with the exception of signal streams)
Naturally there are some cons, too:
• Introduces a small overhead to speed of message handling
• Overhead in object size (due to possibly unneeded library code)
Currently, flext supports
• PD on Windows with Microsoft Visual C++, Borland C++ and gcc(cygwin) compilers
• PD on Linux with gcc
• PD on Mac OSX with gcc (Project Builder to follow soon)  thomas committed Nov 20, 2002 50 
• Max/MSP on Mac OS9 with Metrowerks CodeWarrior  thomas committed Nov 19, 2002 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 
\section LICENSE License Flext is covered by the GPL. flext - C++ layer for Max/MSP and pd (pure data) externals
Copyright (C) 2001,2002 Thomas Grill This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. In the official flext distribution, the GNU General Public License is in the file gpl.txt
\verbatim attr1::attr1(): arg(0) // initialize argument { // define inlets AddInAnything(); // first inlet of type anything (index 0) // define outlets AddOutFloat(); // one float outlet (has index 0) \endverbatim Every inlet and outlet that the object shall have has to be registered. This is done with the functions in \ref FLEXT_C_IO_ADD. \verbatim // register methods FLEXT_ADDMETHOD(0,m_trigger); // register method (for floats) "m_trigger" for inlet 0 FLEXT_ADDATTR_VAR1("arg",arg); // register attribute "arg" with variable arg } \endverbatim Likewise, every method (called by a message) (see \ref FLEXT_D_ADDMETHOD) and every attribute (see \ref FLEXT_D_ADDATTR) exposed to the system has to be registered. \verbatim void attr1::m_trigger(float f) { float res = arg+f; // output value to outlet ToOutFloat(0,res); // (0 stands for the outlet index 0) } \endverbatim This is a method that is triggered with a message. It does some calculation and then outputs a value to an outlet. There are numerous functions (see \ref FLEXT_C_IO_OUT) supporting that functionality. Be sure to work through the examples provided with the flext tutorial. These should give you an overview about the possibilities of flext. The "\ref modules" link at the top of the page leads to a complete reference of flext functions and classes.  thomas committed Aug 17, 2002 203 204 205 206  */ #endif