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/adv2 | |
parent | 562dcc336797951b2a8707413aa44177484c9f2a (diff) |
""
svn path=/trunk/; revision=310
Diffstat (limited to 'externals/grill/flext/tutorial/adv2')
-rwxr-xr-x | externals/grill/flext/tutorial/adv2/adv2.cw | bin | 0 -> 101183 bytes | |||
-rw-r--r-- | externals/grill/flext/tutorial/adv2/adv2.dsp | 95 | ||||
-rw-r--r-- | externals/grill/flext/tutorial/adv2/main.cpp | 97 |
3 files changed, 192 insertions, 0 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()); +} + + |