diff options
author | Thomas Grill <xovo@users.sourceforge.net> | 2002-12-30 04:32:19 +0000 |
---|---|---|
committer | Thomas Grill <xovo@users.sourceforge.net> | 2002-12-30 04:32:19 +0000 |
commit | 62530f3fc55d3dc1c12bcd3b88f0922c15cd82e5 (patch) | |
tree | a57fc5a54ed78f189f074724396f81330faf9a3b /externals/grill/flext/tutorial | |
parent | 562dcc336797951b2a8707413aa44177484c9f2a (diff) |
""
svn path=/trunk/; revision=310
Diffstat (limited to 'externals/grill/flext/tutorial')
29 files changed, 976 insertions, 47 deletions
diff --git a/externals/grill/flext/tutorial/adv2/adv2.cw b/externals/grill/flext/tutorial/adv2/adv2.cw Binary files differnew file mode 100755 index 00000000..a0a68e0f --- /dev/null +++ b/externals/grill/flext/tutorial/adv2/adv2.cw diff --git a/externals/grill/flext/tutorial/adv2/adv2.dsp b/externals/grill/flext/tutorial/adv2/adv2.dsp new file mode 100644 index 00000000..7c36c7c5 --- /dev/null +++ b/externals/grill/flext/tutorial/adv2/adv2.dsp @@ -0,0 +1,95 @@ +# Microsoft Developer Studio Project File - Name="adv2" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** NICHT BEARBEITEN ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=adv2 - Win32 Debug +!MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE +!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl +!MESSAGE +!MESSAGE NMAKE /f "adv2.mak". +!MESSAGE +!MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben +!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: +!MESSAGE +!MESSAGE NMAKE /f "adv2.mak" CFG="adv2 - Win32 Debug" +!MESSAGE +!MESSAGE Für die Konfiguration stehen zur Auswahl: +!MESSAGE +!MESSAGE "adv2 - Win32 Release" (basierend auf "Win32 (x86) Dynamic-Link Library") +!MESSAGE "adv2 - Win32 Debug" (basierend auf "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "adv2" +# PROP Scc_LocalPath "." +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "adv2 - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "msvc" +# PROP Intermediate_Dir "msvc" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /YX /FD /c +# ADD CPP /nologo /W3 /O2 /I "..\..\source" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PD" /YX /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0xc07 /d "NDEBUG" +# ADD RSC /l 0xc07 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib /nologo /dll /machine:I386 +# ADD LINK32 kernel32.lib user32.lib pd.lib flext-pdwin.lib /nologo /dll /machine:I386 /out:"../pd-msvc/adv2.dll" /libpath:"..\..\pd-msvc" + +!ELSEIF "$(CFG)" == "adv2 - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "msvc-debug" +# PROP Intermediate_Dir "msvc-debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /ZI /Od /I "..\..\source" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PD" /FR /YX /FD /GZ /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0xc07 /d "_DEBUG" +# ADD RSC /l 0xc07 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib pd.lib flext_d-pdwin.lib /nologo /dll /debug /machine:I386 /pdbtype:sept /libpath:"..\..\pd-msvc" + +!ENDIF + +# Begin Target + +# Name "adv2 - Win32 Release" +# Name "adv2 - Win32 Debug" +# Begin Source File + +SOURCE=.\main.cpp +# End Source File +# End Target +# End Project diff --git a/externals/grill/flext/tutorial/adv2/main.cpp b/externals/grill/flext/tutorial/adv2/main.cpp new file mode 100644 index 00000000..32adaf85 --- /dev/null +++ b/externals/grill/flext/tutorial/adv2/main.cpp @@ -0,0 +1,97 @@ +/* +flext tutorial - advanced 2 + +Copyright (c) 2002 Thomas Grill (xovo@gmx.net) +For information on usage and redistribution, and for a DISCLAIMER OF ALL +WARRANTIES, see the file, "license.txt," in this distribution. + +------------------------------------------------------------------------- + +This is an optimized version of the example "simple 3" + +It has the exact same functionality but methods are registered at class setup opposed to +object setup (in the constructor) in "simple 3" + +The advantage of this lies in the fact that the message database needs only be constructed +once for all objects, namely on creation of the first object of this class. +All objects [adv2] will share the same database, saving memory. + +*/ + +// include flext header +#include <flext.h> + +// check for appropriate flext version +#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 401) +#error You need at least flext version 0.4.1 +#endif + +class adv2: + public flext_base +{ + // flext header with a setup function called "setup" + FLEXT_HEADER_S(adv2,flext_base,setup) + +public: + adv2(); + +protected: + void m_tag(); + void m_tag_and_int(int i); + void m_sym(t_symbol *s); + + virtual void m_help(); + +private: + // define the _static_ class setup function + static void setup(t_class *c); + + FLEXT_CALLBACK(m_tag); + FLEXT_CALLBACK_I(m_tag_and_int); + FLEXT_CALLBACK_S(m_sym); +}; + +// instantiate the class (constructor has a variable argument list) +FLEXT_NEW("adv2",adv2) + + +adv2::adv2() +{ + // define inlets + AddInAnything(); // add inlet of type anything (index 0) +} + +void adv2::setup(t_class *c) +{ + // register methods: + // notice the naming FLEXT_CADD_METHOD* instead of FLEXT_ADD_METHOD* + // there is also an additional parameter c pointing to the class definition + FLEXT_CADDMETHOD_(c,0,"born",m_tag); + FLEXT_CADDMETHOD_(c,0,"to",m_tag); + FLEXT_CADDMETHOD_(c,0,"hula",m_tag); + FLEXT_CADDMETHOD_I(c,0,"hula",m_tag_and_int); + + FLEXT_CADDMETHOD(c,0,m_sym); +} + +void adv2::m_tag() +{ + post("tag recognized"); +} + +void adv2::m_tag_and_int(int i) +{ + post("tag recognized (has int arg: %i)",i); +} + +void adv2::m_sym(t_symbol *s) +{ + post("symbol: %s",GetString(s)); +} + +void adv2::m_help() +{ + post("%s - example for tagged messages",thisName()); +} + + diff --git a/externals/grill/flext/tutorial/adv3/adv3.cw b/externals/grill/flext/tutorial/adv3/adv3.cw Binary files differnew file mode 100755 index 00000000..dd30edd4 --- /dev/null +++ b/externals/grill/flext/tutorial/adv3/adv3.cw diff --git a/externals/grill/flext/tutorial/adv3/adv3.dsp b/externals/grill/flext/tutorial/adv3/adv3.dsp new file mode 100644 index 00000000..87f026af --- /dev/null +++ b/externals/grill/flext/tutorial/adv3/adv3.dsp @@ -0,0 +1,95 @@ +# Microsoft Developer Studio Project File - Name="adv3" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** NICHT BEARBEITEN ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=adv3 - Win32 Debug +!MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE +!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl +!MESSAGE +!MESSAGE NMAKE /f "adv3.mak". +!MESSAGE +!MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben +!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: +!MESSAGE +!MESSAGE NMAKE /f "adv3.mak" CFG="adv3 - Win32 Debug" +!MESSAGE +!MESSAGE Für die Konfiguration stehen zur Auswahl: +!MESSAGE +!MESSAGE "adv3 - Win32 Release" (basierend auf "Win32 (x86) Dynamic-Link Library") +!MESSAGE "adv3 - Win32 Debug" (basierend auf "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "adv3" +# PROP Scc_LocalPath "." +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "adv3 - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "msvc" +# PROP Intermediate_Dir "msvc" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /YX /FD /c +# ADD CPP /nologo /W3 /O2 /I "..\..\source" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PD" /YX /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0xc07 /d "NDEBUG" +# ADD RSC /l 0xc07 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib /nologo /dll /machine:I386 +# ADD LINK32 kernel32.lib user32.lib pd.lib flext-pdwin.lib /nologo /dll /machine:I386 /out:"../pd-msvc/adv3.dll" /libpath:"..\..\pd-msvc" + +!ELSEIF "$(CFG)" == "adv3 - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "msvc-debug" +# PROP Intermediate_Dir "msvc-debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /ZI /Od /I "..\..\source" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PD" /FR /YX /FD /GZ /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0xc07 /d "_DEBUG" +# ADD RSC /l 0xc07 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib pd.lib flext_d-pdwin.lib /nologo /dll /debug /machine:I386 /pdbtype:sept /libpath:"..\..\pd-msvc" + +!ENDIF + +# Begin Target + +# Name "adv3 - Win32 Release" +# Name "adv3 - Win32 Debug" +# Begin Source File + +SOURCE=.\main.cpp +# End Source File +# End Target +# End Project diff --git a/externals/grill/flext/tutorial/adv3/main.cpp b/externals/grill/flext/tutorial/adv3/main.cpp new file mode 100644 index 00000000..0306e68f --- /dev/null +++ b/externals/grill/flext/tutorial/adv3/main.cpp @@ -0,0 +1,152 @@ +/* +flext tutorial - advanced 3 + +Copyright (c) 2002 Thomas Grill (xovo@gmx.net) +For information on usage and redistribution, and for a DISCLAIMER OF ALL +WARRANTIES, see the file, "license.txt," in this distribution. + +------------------------------------------------------------------------- + +This is a port of Iohannes Zmölnigs "counter" example to the flext paradigm. +Find the original at http://iem.kug.ac.at/pd/externals-HOWTO/node5.html + +The functionality is exactly the same, with one exception: +flext doesn't support default arguments, hence a message "bound 1" will translate into +"bound 1 0" in the original example, but won't be recognized with flext. +This can be easily circumvented by using a method digesting a variable argument list, but +was omitted for the sake of clearness. + +Apart from that you'll notice several differences: +- with flext, callbacks have to be declared for all registered methods +- Flext allows the full usage of integer types +- there are no real "passive" methods with flext. + These can be emulated by methods, or more flexibly, attributes (see example "attr3") +- Help symbols can't be defined that freely. This is because in Max/MSP help files always + have the name of the object with a suffix .help appended. + However with flext, a path to the respective help file may be specified + +*/ + +// include flext header +#include <flext.h> + +// check for appropriate flext version +#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 401) +#error You need at least flext version 0.4.1 +#endif + +class adv3: + public flext_base +{ + FLEXT_HEADER_S(adv3,flext_base,setup) + +public: + // constructor with no arguments + adv3(int argc,t_atom *argv): + i_step(1) + { + // --- initialize bounds and step size --- + int f1 = 0,f2 = 0; + switch(argc) { + default: + case 3: + i_step = GetInt(argv[2]); + case 2: + f2 = GetInt(argv[1]); + case 1: + f1 = GetInt(argv[0]); + case 0: + ; + } + if(argc < 2) f2 = f1; + + m_bound(f1,f2); + + i_count = i_down; + + // --- define inlets and outlets --- + AddInAnything(); // default inlet + AddInList(); // inlet for bounds + AddInInt(); // inlet for step size + + AddOutInt(); // outlet for integer count + AddOutBang(); // outlet for bang + } + +protected: + void m_reset() + { + i_count = i_down; + } + + void m_set(int argc,t_atom *argv) + { + i_count = argc?GetAInt(argv[0]):0; + } + + void m_bang() + { + int f = i_count; + i_count += i_step; + if(i_down != i_up) { + if((i_step > 0) && (i_count > i_up)) { + i_count = i_down; + ToOutBang(1); + } + else if(i_count < i_down) { + i_count = i_up; + ToOutBang(1); + } + } + ToOutInt(0,f); + } + + void m_bound(int f1,int f2) + { + i_down = f1 < f2?f1:f2; + i_up = f1 > f2?f1:f2; + } + + void m_step(int s) + { + i_step = s; + } + + int i_count,i_down,i_up,i_step; + +private: + static void setup(t_class *c) + { + // --- set up methods (class scope) --- + + // register a bang method to the default inlet (0) + FLEXT_CADDBANG(c,0,m_bang); + + // set up tagged methods for the default inlet (0) + // the underscore _ after CADDMETHOD indicates that a message tag is used + // no, variable list or anything and all single arguments are recognized automatically, ... + FLEXT_CADDMETHOD_(c,0,"reset",m_reset); + FLEXT_CADDMETHOD_(c,0,"set",m_set); + // ..., more complex types (combinations of types) have to be specified + FLEXT_CADDMETHOD_II(c,0,"bound",m_bound); // two int arguments + + // set up methods for inlets 1 and 2 + // no message tag used + FLEXT_CADDMETHOD(c,1,m_bound); // variable arg type recognized automatically + FLEXT_CADDMETHOD(c,2,m_step); // single int arg also recognized automatically + } + + // for every registered method a callback has to be declared + FLEXT_CALLBACK(m_bang) + FLEXT_CALLBACK(m_reset) + FLEXT_CALLBACK_V(m_set) + FLEXT_CALLBACK_II(m_bound) + FLEXT_CALLBACK_I(m_step) +}; + +// instantiate the class (constructor has a variable argument list) +// let "counter" be an alternative name +// before the colon define the name of the path to the help file +FLEXT_NEW_V("help, adv3 counter",adv3) + + diff --git a/externals/grill/flext/tutorial/attr1/main.cpp b/externals/grill/flext/tutorial/attr1/main.cpp index 4945fe8f..2659a9ac 100644 --- a/externals/grill/flext/tutorial/attr1/main.cpp +++ b/externals/grill/flext/tutorial/attr1/main.cpp @@ -44,10 +44,10 @@ protected: private: // callback for method "m_trigger" (with one float argument) - FLEXT_CALLBACK_F(m_trigger); + FLEXT_CALLBACK_F(m_trigger) // define attribute callbacks for variable "arg" (with GET and SET properties) - FLEXT_ATTRVAR_F(arg); + FLEXT_ATTRVAR_F(arg) }; // instantiate the class diff --git a/externals/grill/flext/tutorial/attr2/main.cpp b/externals/grill/flext/tutorial/attr2/main.cpp index b1536117..d6df4e78 100644 --- a/externals/grill/flext/tutorial/attr2/main.cpp +++ b/externals/grill/flext/tutorial/attr2/main.cpp @@ -7,7 +7,11 @@ WARRANTIES, see the file, "license.txt," in this distribution. ------------------------------------------------------------------------- -This is an example of an object doing various float operations +This is an example of an object doing various float operations. + +Methods and attributes are registered at class level (opposed to object level in example "attr1"). +For details, see also example "adv2" + */ @@ -58,26 +62,27 @@ private: static void setup(t_class *); // callback for method "m_trigger" (with one float argument) - FLEXT_CALLBACK_F(m_trigger); + FLEXT_CALLBACK_F(m_trigger) // define attribute callbacks for variable "arg" ("ATTRVAR" means GET and SET) - FLEXT_ATTRVAR_F(arg); + FLEXT_ATTRVAR_F(arg) // define attribute callbacks for variable "res" (GET only) - FLEXT_ATTRGET_F(res); + FLEXT_ATTRGET_F(res) // methods for getting/setting the operation mode void opget(const t_symbol *&s) const; void opset(const t_symbol *&s); // define attribute callbacks for variable "res" (GET only) - FLEXT_CALLGET_S(opget); - FLEXT_CALLSET_S(opset); + FLEXT_CALLGET_S(opget) + FLEXT_CALLSET_S(opset) }; // instantiate the class FLEXT_NEW("attr2",attr2) + // instantiate static variables const t_symbol *attr2::sym_set, @@ -85,7 +90,7 @@ const t_symbol *attr2::sym_div,*attr2::sym_mul, *attr2::sym_pow; -void attr2::setup(t_class *) +void attr2::setup(t_class *c) { // Upon class creation setup some symbols // This is done only upon creation of of the first "attr2" object @@ -95,6 +100,21 @@ void attr2::setup(t_class *) sym_mul = MakeSymbol("*"); sym_div = MakeSymbol("/"); sym_pow = MakeSymbol("**"); + + + // setup methods and attributes at class scope + + // register method (for floats) "m_trigger" for inlet 0 + FLEXT_CADDMETHOD(c,0,m_trigger); + + // register attribute "arg" with the variable "arg" + FLEXT_CADDATTR_VAR1(c,"arg",arg); + + // register attribute "result" with variable "res" + FLEXT_CADDATTR_GET(c,"result",res); + + // register attribute "op" with methods "opget" and "opset" + FLEXT_CADDATTR_VAR(c,"op",opget,opset); } @@ -107,18 +127,6 @@ attr2::attr2(): // define outlets AddOutFloat(); // one float outlet (has index 0) - - // register method (for floats) "m_trigger" for inlet 0 - FLEXT_ADDMETHOD(0,m_trigger); - - // register attribute "arg" with the variable "arg" - FLEXT_ADDATTR_VAR1("arg",arg); - - // register attribute "result" with variable "res" - FLEXT_ADDATTR_GET("result",res); - - // register attribute "op" with methods "opget" and "opset" - FLEXT_ADDATTR_VAR("op",opget,opset); } // receive an operand, do the math operation and trigger the output diff --git a/externals/grill/flext/tutorial/attr3/attr3.cw b/externals/grill/flext/tutorial/attr3/attr3.cw Binary files differnew file mode 100755 index 00000000..fb08c819 --- /dev/null +++ b/externals/grill/flext/tutorial/attr3/attr3.cw diff --git a/externals/grill/flext/tutorial/attr3/attr3.dsp b/externals/grill/flext/tutorial/attr3/attr3.dsp new file mode 100644 index 00000000..6d22106d --- /dev/null +++ b/externals/grill/flext/tutorial/attr3/attr3.dsp @@ -0,0 +1,95 @@ +# Microsoft Developer Studio Project File - Name="attr3" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** NICHT BEARBEITEN ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=attr3 - Win32 Debug +!MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE +!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl +!MESSAGE +!MESSAGE NMAKE /f "attr3.mak". +!MESSAGE +!MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben +!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: +!MESSAGE +!MESSAGE NMAKE /f "attr3.mak" CFG="attr3 - Win32 Debug" +!MESSAGE +!MESSAGE Für die Konfiguration stehen zur Auswahl: +!MESSAGE +!MESSAGE "attr3 - Win32 Release" (basierend auf "Win32 (x86) Dynamic-Link Library") +!MESSAGE "attr3 - Win32 Debug" (basierend auf "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "attr3" +# PROP Scc_LocalPath "." +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "attr3 - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "msvc" +# PROP Intermediate_Dir "msvc" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /YX /FD /c +# ADD CPP /nologo /W3 /O2 /I "..\..\source" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PD" /YX /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0xc07 /d "NDEBUG" +# ADD RSC /l 0xc07 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib /nologo /dll /machine:I386 +# ADD LINK32 kernel32.lib user32.lib pd.lib flext-pdwin.lib /nologo /dll /machine:I386 /out:"../pd-msvc/attr3.dll" /libpath:"..\..\pd-msvc" + +!ELSEIF "$(CFG)" == "attr3 - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "msvc-debug" +# PROP Intermediate_Dir "msvc-debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /ZI /Od /I "..\..\source" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PD" /FR /YX /FD /GZ /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0xc07 /d "_DEBUG" +# ADD RSC /l 0xc07 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib pd.lib flext_d-pdwin.lib /nologo /dll /debug /machine:I386 /pdbtype:sept /libpath:"..\..\pd-msvc" + +!ENDIF + +# Begin Target + +# Name "attr3 - Win32 Release" +# Name "attr3 - Win32 Debug" +# Begin Source File + +SOURCE=.\main.cpp +# End Source File +# End Target +# End Project diff --git a/externals/grill/flext/tutorial/attr3/main.cpp b/externals/grill/flext/tutorial/attr3/main.cpp new file mode 100644 index 00000000..835c2881 --- /dev/null +++ b/externals/grill/flext/tutorial/attr3/main.cpp @@ -0,0 +1,163 @@ +/* +flext tutorial - attributes 3 + +Copyright (c) 2002 Thomas Grill (xovo@gmx.net) +For information on usage and redistribution, and for a DISCLAIMER OF ALL +WARRANTIES, see the file, "license.txt," in this distribution. + +------------------------------------------------------------------------- + +This is tutorial example "advanced 3" with the usage of attributes. + +*/ + +// IMPORTANT: enable attribute processing (specify before inclusion of flext headers!) +// For clarity, this is done here, but you'd better specify it as a compiler definition +// FLEXT_ATTRIBUTES must be 0 or 1, +#define FLEXT_ATTRIBUTES 1 + +// include flext header +#include <flext.h> + +// check for appropriate flext version +#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 401) +#error You need at least flext version 0.4.1 +#endif + +class attr3: + public flext_base +{ + FLEXT_HEADER_S(attr3,flext_base,setup) + +public: + // constructor with no arguments + attr3(int argc,t_atom *argv): + i_step(1) + { + // --- initialize bounds and step size --- + int f1 = 0,f2 = 0; + switch(argc) { + default: + case 3: + i_step = GetInt(argv[2]); + case 2: + f2 = GetInt(argv[1]); + case 1: + f1 = GetInt(argv[0]); + case 0: + ; + } + if(argc < 2) f2 = f1; + + m_bound(f1,f2); + + i_count = i_down; + + // --- define inlets and outlets --- + AddInAnything(); // default inlet + AddInList(); // inlet for bounds + AddInInt(); // inlet for step size + + AddOutInt(); // outlet for integer count + AddOutBang(); // outlet for bang + } + +protected: + + void m_reset() { i_count = i_down; } + + void m_set(int argc,t_atom *argv) + { + i_count = argc?GetAInt(argv[0]):0; + } + + void m_bang() + { + int f = i_count; + i_count += i_step; + if(i_down != i_up) { + if((i_step > 0) && (i_count > i_up)) { + i_count = i_down; + ToOutBang(1); + } + else if(i_count < i_down) { + i_count = i_up; + ToOutBang(1); + } + } + ToOutInt(0,f); + } + + void m_bound(int f1,int f2) + { + i_down = f1 < f2?f1:f2; + i_up = f1 > f2?f1:f2; + } + + void m_step(int s) { i_step = s; } + + int i_count,i_down,i_up,i_step; + + // setter method of bounds variables + void ms_bound(const AtomList &l) + { + if(l.Count() == 2 && CanbeInt(l[0]) && CanbeInt(l[1])) + // if it is a two element integer list use m_bound method + m_bound(GetAInt(l[0]),GetAInt(l[1])); + else + // else post a warning + post("%s - bound needs to integer parameters",thisName()); + } + + // getter method of bounds variables + void mg_bound(AtomList &l) const + { + l(2); // initialize two element list + SetInt(l[0],i_down); // set first element + SetInt(l[1],i_up); // set second element + } + +private: + + static void setup(t_class *c) + { + // --- set up methods (class scope) --- + + // register a bang method to the default inlet (0) + FLEXT_CADDBANG(c,0,m_bang); + + // set up tagged methods for the default inlet (0) + FLEXT_CADDMETHOD_(c,0,"reset",m_reset); + FLEXT_CADDMETHOD_(c,0,"set",m_set); + + // set up methods for inlets 1 and 2 + // no message tag used + FLEXT_CADDMETHOD(c,1,m_bound); // variable arg type recognized automatically + FLEXT_CADDMETHOD(c,2,m_step); // single int arg also recognized automatically + + // --- set up attributes (class scope) --- + + FLEXT_CADDATTR_VAR1(c,"count",i_count); + FLEXT_CADDATTR_VAR1(c,"step",i_step); + + FLEXT_CADDATTR_VAR(c,"bound",mg_bound,ms_bound); + } + + // normal method callbacks for bang and reset + FLEXT_CALLBACK(m_bang) + FLEXT_CALLBACK(m_reset) + + FLEXT_CALLBACK_V(m_set) // normal method wrapper for m_set + FLEXT_ATTRVAR_I(i_count) // wrapper function for integer variable i_count + + FLEXT_CALLBACK_II(m_bound) // normal method wrapper for m_bound + FLEXT_CALLVAR_V(mg_bound,ms_bound) // getter and setter method of bounds + + FLEXT_CALLBACK_I(m_step) // normal method wrapper for m_step + FLEXT_ATTRVAR_I(i_step) // wrapper function for integer variable i_step +}; + +// instantiate the class (constructor has a variable argument list) +FLEXT_NEW_V("attr3",attr3) + + diff --git a/externals/grill/flext/tutorial/build-pd-bcc.bat b/externals/grill/flext/tutorial/build-pd-bcc.bat index 90ed411b..45961f13 100644 --- a/externals/grill/flext/tutorial/build-pd-bcc.bat +++ b/externals/grill/flext/tutorial/build-pd-bcc.bat @@ -16,6 +16,14 @@ @make -f ..\makefile.pd-bcc NAME=adv1 SETUPFUNCTION=adv1_setup @cd .. +@cd adv2 +@make -f ..\makefile.pd-bcc NAME=adv2 SETUPFUNCTION=adv2_setup +@cd .. + +@cd adv3 +@make -f ..\makefile.pd-bcc NAME=adv3 SETUPFUNCTION=adv3_setup +@cd .. + @cd attr1 @make -f ..\makefile.pd-bcc NAME=attr1 SETUPFUNCTION=attr1_setup @cd .. @@ -24,6 +32,10 @@ @make -f ..\makefile.pd-bcc NAME=attr2 SETUPFUNCTION=attr2_setup @cd .. +@cd attr3 +@make -f ..\makefile.pd-bcc NAME=attr3 SETUPFUNCTION=attr3_setup +@cd .. + @cd signal1 @make -f ..\makefile.pd-bcc NAME=signal1~ SETUPFUNCTION=signal1_tilde_setup @cd .. diff --git a/externals/grill/flext/tutorial/build-pd-msvc.bat b/externals/grill/flext/tutorial/build-pd-msvc.bat index 2c63951b..a01bee53 100644 --- a/externals/grill/flext/tutorial/build-pd-msvc.bat +++ b/externals/grill/flext/tutorial/build-pd-msvc.bat @@ -4,8 +4,11 @@ nmake /f makefile.pd-msvc NAME=simple1 DIR=simple1 nmake /f makefile.pd-msvc NAME=simple2 DIR=simple2 nmake /f makefile.pd-msvc NAME=simple3 DIR=simple3 nmake /f makefile.pd-msvc NAME=adv1 DIR=adv1 +nmake /f makefile.pd-msvc NAME=adv2 DIR=adv2 +nmake /f makefile.pd-msvc NAME=adv3 DIR=adv3 nmake /f makefile.pd-msvc NAME=attr1 DIR=attr1 nmake /f makefile.pd-msvc NAME=attr2 DIR=attr2 +nmake /f makefile.pd-msvc NAME=attr3 DIR=attr3 nmake /f makefile.pd-msvc NAME=signal1~ DIR=signal1 nmake /f makefile.pd-msvc NAME=signal2~ DIR=signal2 nmake /f makefile.pd-msvc NAME=sndobj1~ DIR=sndobj1 diff --git a/externals/grill/flext/tutorial/lib1/main.cpp b/externals/grill/flext/tutorial/lib1/main.cpp index 485bdf09..1f0a3120 100644 --- a/externals/grill/flext/tutorial/lib1/main.cpp +++ b/externals/grill/flext/tutorial/lib1/main.cpp @@ -49,8 +49,8 @@ protected: float arg; // argument variable private: - FLEXT_CALLBACK_F(m_trigger); // callback for method "m_trigger" (with one float argument) - FLEXT_ATTRVAR_F(arg); + FLEXT_CALLBACK_F(m_trigger) // callback for method "m_trigger" (with one float argument) + FLEXT_ATTRVAR_F(arg) }; libbase::libbase(): diff --git a/externals/grill/flext/tutorial/makefile.pd-cygwin b/externals/grill/flext/tutorial/makefile.pd-cygwin index fae2014d..6568273a 100644 --- a/externals/grill/flext/tutorial/makefile.pd-cygwin +++ b/externals/grill/flext/tutorial/makefile.pd-cygwin @@ -26,7 +26,7 @@ LIBS=m pd # all the source files from the package -EXAMPLES=simple1 simple2 simple3 adv1 attr1 attr2 signal1~ signal2~ sndobj1~ lib1 # thread1 thread2 +EXAMPLES=simple1 simple2 simple3 adv1 adv2 adv3 attr1 attr2 attr3 signal1~ signal2~ sndobj1~ lib1 # thread1 thread2 TARGETS=$(patsubst %,$(OUTPATH)/%.dll,$(EXAMPLES)) diff --git a/externals/grill/flext/tutorial/makefile.pd-darwin b/externals/grill/flext/tutorial/makefile.pd-darwin index 20f4a298..8a2ae255 100644 --- a/externals/grill/flext/tutorial/makefile.pd-darwin +++ b/externals/grill/flext/tutorial/makefile.pd-darwin @@ -24,7 +24,7 @@ LDFLAGS=-bundle -bundle_loader $(PD) # all the source files from the package -EXAMPLES=simple1 simple2 simple3 adv1 attr1 attr2 signal1~ signal2~ sndobj1~ lib1 thread1 thread2 +EXAMPLES=simple1 simple2 simple3 adv1 adv2 adv3 attr1 attr2 attr3 signal1~ signal2~ sndobj1~ lib1 thread1 thread2 TARGETS=$(patsubst %,$(OUTPATH)/%.pd_darwin,$(EXAMPLES)) diff --git a/externals/grill/flext/tutorial/makefile.pd-linux b/externals/grill/flext/tutorial/makefile.pd-linux index 6bbb4a06..58fee63d 100644 --- a/externals/grill/flext/tutorial/makefile.pd-linux +++ b/externals/grill/flext/tutorial/makefile.pd-linux @@ -24,7 +24,7 @@ LIBS=m # all the source files from the package -EXAMPLES=simple1 simple2 simple3 adv1 attr1 attr2 sndobj1~ signal1~ signal2~ lib1 thread1 thread2 +EXAMPLES=simple1 simple2 simple3 adv1 adv2 adv3 attr1 attr2 attr3 sndobj1~ signal1~ signal2~ lib1 thread1 thread2 TARGETS=$(patsubst %,$(OUTPATH)/%.pd_linux,$(EXAMPLES)) diff --git a/externals/grill/flext/tutorial/pd/ex-adv2.pd b/externals/grill/flext/tutorial/pd/ex-adv2.pd new file mode 100644 index 00000000..af534de2 --- /dev/null +++ b/externals/grill/flext/tutorial/pd/ex-adv2.pd @@ -0,0 +1,23 @@ +#N canvas 329 97 587 348 12;
+#X msg 26 97 help;
+#X msg 123 146 born;
+#X msg 172 147 to;
+#X msg 214 149 hula;
+#X msg 228 230 yeah;
+#X msg 228 192 hula 1;
+#X text 280 231 other symbol;
+#X text 261 150 tag without argument;
+#X text 297 190 tag and argument;
+#X text 72 97 print a help message;
+#X obj 16 7 cnv 15 550 40 empty empty adv2 10 22 0 24 -260818 -1 0
+;
+#X text 174 8 flext tutorial \, (C)2002 Thomas Grill;
+#X text 174 28 http://www.parasitaere-kapazitaeten.net;
+#X obj 148 293 adv2;
+#X text 21 49 this is identical to the simple3 example;
+#X connect 0 0 13 0;
+#X connect 1 0 13 0;
+#X connect 2 0 13 0;
+#X connect 3 0 13 0;
+#X connect 4 0 13 0;
+#X connect 5 0 13 0;
diff --git a/externals/grill/flext/tutorial/pd/ex-adv3.pd b/externals/grill/flext/tutorial/pd/ex-adv3.pd new file mode 100644 index 00000000..d58567f3 --- /dev/null +++ b/externals/grill/flext/tutorial/pd/ex-adv3.pd @@ -0,0 +1,40 @@ +#N canvas 175 139 597 355 12;
+#X obj 16 7 cnv 15 550 40 empty empty adv3 10 22 0 24 -260818 -1 0
+;
+#X text 174 8 flext tutorial \, (C)2002 Thomas Grill;
+#X text 174 28 http://www.parasitaere-kapazitaeten.net;
+#X obj 229 266 adv3 2 5 1;
+#X obj 305 303 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X obj 223 300 nbx 5 18 -1e+037 1e+037 0 0 empty empty empty 0 -6 0
+12 -228992 -1 -1 0 256;
+#X msg 269 120 1 10;
+#X msg 389 118 1;
+#X msg 424 118 -1;
+#X msg 460 118 2;
+#X obj 88 119 bng 25 250 50 0 empty empty empty 0 -6 0 8 -258699 -1
+-1;
+#X msg 313 119 7 2;
+#X text 325 300 end has been reached;
+#X obj 157 117 nbx 5 18 -1e+037 1e+037 0 0 empty empty empty 0 -6 0
+12 -228992 -1 -1 0 256;
+#X msg 158 140 set \$1;
+#X text 72 98 trigger;
+#X text 147 98 set counter;
+#X text 264 99 set bounds;
+#X text 390 96 set step size;
+#X msg 80 186 reset;
+#X text 83 166 reset;
+#X text 21 49 this is a port of IOhannes Zmoelnings "counter" example
+;
+#X connect 3 0 5 0;
+#X connect 3 1 4 0;
+#X connect 6 0 3 1;
+#X connect 7 0 3 2;
+#X connect 8 0 3 2;
+#X connect 9 0 3 2;
+#X connect 10 0 3 0;
+#X connect 11 0 3 1;
+#X connect 13 0 14 0;
+#X connect 14 0 3 0;
+#X connect 19 0 3 0;
diff --git a/externals/grill/flext/tutorial/pd/ex-attr3.pd b/externals/grill/flext/tutorial/pd/ex-attr3.pd new file mode 100644 index 00000000..de7d6bf2 --- /dev/null +++ b/externals/grill/flext/tutorial/pd/ex-attr3.pd @@ -0,0 +1,60 @@ +#N canvas 175 139 603 453 12;
+#X obj 16 7 cnv 15 550 40 empty empty attr3 10 22 0 24 -260818 -1 0
+;
+#X text 174 8 flext tutorial \, (C)2002 Thomas Grill;
+#X text 174 28 http://www.parasitaere-kapazitaeten.net;
+#X obj 293 364 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X obj 196 361 nbx 5 18 -1e+037 1e+037 0 0 empty empty empty 0 -6 0
+12 -228992 -1 -1 8 256;
+#X msg 264 129 1 10;
+#X msg 384 127 1;
+#X msg 419 127 -1;
+#X msg 455 127 2;
+#X obj 36 128 bng 25 250 50 0 empty empty empty 0 -6 0 8 -258699 -1
+-1;
+#X msg 308 128 7 2;
+#X obj 159 123 nbx 5 18 -1e+037 1e+037 0 0 empty empty empty 0 -6 0
+12 -228992 -1 -1 0 256;
+#X msg 160 146 set \$1;
+#X text 20 107 trigger;
+#X text 149 104 set counter;
+#X text 259 108 set bounds;
+#X text 385 105 set step size;
+#X msg 87 135 reset;
+#X text 90 115 reset;
+#X text 23 63 with attributes;
+#X obj 197 327 attr3 @bounds 2 5 @step 1;
+#X msg 32 195 getattributes;
+#X obj 392 363 print;
+#X text 440 362 attributes;
+#X msg 32 237 getcount;
+#X msg 258 234 getbounds;
+#X msg 388 232 getstep;
+#X text 149 193 list all attributes;
+#X msg 32 266 count 3;
+#X text 109 238 get count;
+#X text 104 266 set count;
+#X msg 257 261 bounds 5 15;
+#X msg 387 259 step 3;
+#X text 21 49 this is a port of IOhannes Zmoelnings "counter" example
+;
+#X connect 5 0 20 1;
+#X connect 6 0 20 2;
+#X connect 7 0 20 2;
+#X connect 8 0 20 2;
+#X connect 9 0 20 0;
+#X connect 10 0 20 1;
+#X connect 11 0 12 0;
+#X connect 12 0 20 0;
+#X connect 17 0 20 0;
+#X connect 20 0 4 0;
+#X connect 20 1 3 0;
+#X connect 20 2 22 0;
+#X connect 21 0 20 0;
+#X connect 24 0 20 0;
+#X connect 25 0 20 0;
+#X connect 26 0 20 0;
+#X connect 28 0 20 0;
+#X connect 31 0 20 0;
+#X connect 32 0 20 0;
diff --git a/externals/grill/flext/tutorial/pd/ex-sndobj1.pd b/externals/grill/flext/tutorial/pd/ex-sndobj1.pd new file mode 100644 index 00000000..c343558e --- /dev/null +++ b/externals/grill/flext/tutorial/pd/ex-sndobj1.pd @@ -0,0 +1,34 @@ +#N canvas 405 36 584 392 12;
+#X obj 56 348 dac~;
+#X obj 15 8 cnv 15 550 40 empty empty sndobj1 10 22 0 24 -260818 -1
+0;
+#X text 175 8 flext tutorial \, (C)2002 Thomas Grill;
+#X text 175 28 http://www.parasitaere-kapazitaeten.net;
+#X text 170 285 adjust the volume;
+#X text 35 97 source;
+#X obj 171 268 hsl 128 15 0.01 1 1 0 empty empty empty -2 -6 0 8 -261681
+-1 -1 7200 1;
+#X msg 160 148 shL \$1;
+#X msg 218 148 shR \$1;
+#X obj 244 84 hsl 128 15 0.5 2 1 0 empty empty empty -2 -6 0 8 -261681
+-1 -1 1800 1;
+#X obj 244 104 hsl 128 15 0.5 2 1 0 empty empty empty -2 -6 0 8 -261681
+-1 -1 5100 1;
+#X text 149 82 pitch left;
+#X text 149 102 pitch right;
+#X obj 31 119 osc~ 442;
+#X obj 32 226 sndobj1~ @shL 0.7 @shR 1.2;
+#X obj 32 304 *~ 0.3;
+#X obj 91 304 *~ 0.3;
+#X connect 6 0 15 1;
+#X connect 6 0 16 1;
+#X connect 7 0 14 0;
+#X connect 8 0 14 0;
+#X connect 9 0 7 0;
+#X connect 10 0 8 0;
+#X connect 13 0 14 0;
+#X connect 13 0 14 1;
+#X connect 14 0 15 0;
+#X connect 14 1 16 0;
+#X connect 15 0 0 0;
+#X connect 16 0 0 1;
diff --git a/externals/grill/flext/tutorial/signal1/main.cpp b/externals/grill/flext/tutorial/signal1/main.cpp index f745be3b..3714e1f6 100644 --- a/externals/grill/flext/tutorial/signal1/main.cpp +++ b/externals/grill/flext/tutorial/signal1/main.cpp @@ -6,8 +6,8 @@ #include <flext.h> -#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 400) -#error You need at least flext version 0.4.0 +#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 401) +#error You need at least flext version 0.4.1 #endif @@ -34,10 +34,14 @@ class signal1: // The constructor of your class is responsible for // setting up inlets and outlets and for registering // inlet-methods: - - AddInSignal(2); // 2 audio ins - AddInFloat(); // 1 float in - AddOutSignal(); // 1 audio out [ == AddOutSignal(1) ] + // The descriptions of the inlets and outlets are output + // via the Max/MSP assist method (when mousing over them in edit mode). + // PD will hopefully provide such a feature as well soon + + AddInSignal("left audio in"); // left audio in + AddInSignal("right audio in"); // right audio in + AddInFloat("panning parameter"); // 1 float in + AddOutSignal("audio out"); // 1 audio out // Now we need to bind the handler function to our // panning inlet, which is inlet 2 (counting all inlets @@ -87,7 +91,7 @@ class signal1: // that be for? Registering is made easy with the FLEXT_NEW_* macros defined // in flext.h. For tilde objects without arguments call: -FLEXT_NEW_DSP("signal1~ signal1~", signal1) +FLEXT_NEW_DSP("signal1~ pan~", signal1) // T.Grill: there are two names for the object: signal1~ as main name and pan~ as its alias // Now we define our DSP function. It gets this arguments: diff --git a/externals/grill/flext/tutorial/signal2/main.cpp b/externals/grill/flext/tutorial/signal2/main.cpp index 661625b2..76a2ca7b 100644 --- a/externals/grill/flext/tutorial/signal2/main.cpp +++ b/externals/grill/flext/tutorial/signal2/main.cpp @@ -37,7 +37,7 @@ protected: void m_bang(); // method for bang private: - FLEXT_CALLBACK(m_bang); // callback for method "m_bang" + FLEXT_CALLBACK(m_bang) // callback for method "m_bang" }; // instantiate the class diff --git a/externals/grill/flext/tutorial/simple1/main.cpp b/externals/grill/flext/tutorial/simple1/main.cpp index 5406cc8a..599e97f6 100755 --- a/externals/grill/flext/tutorial/simple1/main.cpp +++ b/externals/grill/flext/tutorial/simple1/main.cpp @@ -38,7 +38,7 @@ protected: void m_float(float f); // method for float values private: - FLEXT_CALLBACK_1(m_float,float); // callback for method "m_float" (with one float argument) + FLEXT_CALLBACK_1(m_float,float) // callback for method "m_float" (with one float argument) }; // instantiate the class diff --git a/externals/grill/flext/tutorial/simple2/main.cpp b/externals/grill/flext/tutorial/simple2/main.cpp index f23e1745..49b05351 100755 --- a/externals/grill/flext/tutorial/simple2/main.cpp +++ b/externals/grill/flext/tutorial/simple2/main.cpp @@ -37,8 +37,8 @@ protected: private: // FLEXT_CALLBACK_F(...) is a shortcut for FLEXT_CALLBACK_1(...,float) - FLEXT_CALLBACK_F(m_float1); // callback for method "m_float1" (with one float argument) - FLEXT_CALLBACK_F(m_float2); // callback for method "m_float2" (with one float argument) + FLEXT_CALLBACK_F(m_float1) // callback for method "m_float1" (with one float argument) + FLEXT_CALLBACK_F(m_float2) // callback for method "m_float2" (with one float argument) }; // instantiate the class (constructor has one float argument) diff --git a/externals/grill/flext/tutorial/simple3/main.cpp b/externals/grill/flext/tutorial/simple3/main.cpp index b09893ab..d13ce42d 100644 --- a/externals/grill/flext/tutorial/simple3/main.cpp +++ b/externals/grill/flext/tutorial/simple3/main.cpp @@ -25,7 +25,7 @@ class simple3: FLEXT_HEADER(simple3,flext_base) public: - // constructor with variable argument list + // constructor with no arguments simple3(); protected: @@ -38,12 +38,12 @@ protected: private: - FLEXT_CALLBACK(m_tag); // callback for method "m_tag" (no arguments) - FLEXT_CALLBACK_I(m_tag_and_int); // callback for method "m_tag" (int arguments) - FLEXT_CALLBACK_S(m_sym); // callback for method "m_sym" (with one symbol argument) + FLEXT_CALLBACK(m_tag) // callback for method "m_tag" (no arguments) + FLEXT_CALLBACK_I(m_tag_and_int) // callback for method "m_tag_and_int" (int arguments) + FLEXT_CALLBACK_S(m_sym) // callback for method "m_sym" (with one symbol argument) }; -// instantiate the class (constructor has a variable argument list) +// instantiate the class (constructor takes no arguments) FLEXT_NEW("simple3",simple3) diff --git a/externals/grill/flext/tutorial/thread1/main.cpp b/externals/grill/flext/tutorial/thread1/main.cpp index f5e2a651..c0d172e6 100644 --- a/externals/grill/flext/tutorial/thread1/main.cpp +++ b/externals/grill/flext/tutorial/thread1/main.cpp @@ -39,7 +39,7 @@ protected: private: // define threaded callback for method m_start // the same syntax as with FLEXT_CALLBACK is used here - FLEXT_THREAD(m_start); + FLEXT_THREAD(m_start) }; FLEXT_NEW("thread1",thread1) diff --git a/externals/grill/flext/tutorial/thread2/main.cpp b/externals/grill/flext/tutorial/thread2/main.cpp index 2cdc37c3..0abb5962 100644 --- a/externals/grill/flext/tutorial/thread2/main.cpp +++ b/externals/grill/flext/tutorial/thread2/main.cpp @@ -41,11 +41,11 @@ protected: void m_textout(); private: - FLEXT_THREAD_I(m_start); // define threaded callback for method m_start - FLEXT_CALLBACK(m_stop); // normal callback for m_stop - FLEXT_CALLBACK(m_text); // turn on console output + FLEXT_THREAD_I(m_start) // define threaded callback for method m_start + FLEXT_CALLBACK(m_stop) // normal callback for m_stop + FLEXT_CALLBACK(m_text) // turn on console output - FLEXT_THREAD(m_textout); // text output + FLEXT_THREAD(m_textout) // text output float delay; volatile int count; diff --git a/externals/grill/flext/tutorial/tutorial.dsw b/externals/grill/flext/tutorial/tutorial.dsw index 8a9d9707..e7338c60 100644 --- a/externals/grill/flext/tutorial/tutorial.dsw +++ b/externals/grill/flext/tutorial/tutorial.dsw @@ -19,6 +19,38 @@ Package=<4> ############################################################################### +Project: "adv2"=.\adv2\adv2.dsp - Package Owner=<4> + +Package=<5> +{{{ + begin source code control + adv2 + .\adv2 + end source code control +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "adv3"=.\adv3\adv3.dsp - Package Owner=<4> + +Package=<5> +{{{ + begin source code control + adv3 + .\adv3 + end source code control +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + Project: "attr1"=.\attr1\attr1.dsp - Package Owner=<4> Package=<5> @@ -51,6 +83,22 @@ Package=<4> ############################################################################### +Project: "attr3"=.\attr3\attr3.dsp - Package Owner=<4> + +Package=<5> +{{{ + begin source code control + attr3 + .\attr3 + end source code control +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + Project: "flext"=..\flext.dsp - Package Owner=<4> Package=<5> |