From d62e56f4df9594f72ce501f5e19c974fd18e7295 Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Tue, 22 Oct 2002 23:07:10 +0000 Subject: This commit was generated by cvs2svn to compensate for changes in r186, which included commits to RCS files with non-trunk default branches. svn path=/trunk/; revision=187 --- externals/grill/flext/tutorial/adv1/adv1.cw | Bin 0 -> 98601 bytes externals/grill/flext/tutorial/adv1/adv1.dsp | 96 +++++++++++++++++++++++++ externals/grill/flext/tutorial/adv1/main.cpp | 104 +++++++++++++++++++++++++++ 3 files changed, 200 insertions(+) create mode 100755 externals/grill/flext/tutorial/adv1/adv1.cw create mode 100644 externals/grill/flext/tutorial/adv1/adv1.dsp create mode 100755 externals/grill/flext/tutorial/adv1/main.cpp (limited to 'externals/grill/flext/tutorial/adv1') diff --git a/externals/grill/flext/tutorial/adv1/adv1.cw b/externals/grill/flext/tutorial/adv1/adv1.cw new file mode 100755 index 00000000..bd68d0e8 Binary files /dev/null and b/externals/grill/flext/tutorial/adv1/adv1.cw differ diff --git a/externals/grill/flext/tutorial/adv1/adv1.dsp b/externals/grill/flext/tutorial/adv1/adv1.dsp new file mode 100644 index 00000000..8917c44e --- /dev/null +++ b/externals/grill/flext/tutorial/adv1/adv1.dsp @@ -0,0 +1,96 @@ +# Microsoft Developer Studio Project File - Name="adv1" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** NICHT BEARBEITEN ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=adv1 - 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 "adv1.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 "adv1.mak" CFG="adv1 - Win32 Debug" +!MESSAGE +!MESSAGE Für die Konfiguration stehen zur Auswahl: +!MESSAGE +!MESSAGE "adv1 - Win32 Release" (basierend auf "Win32 (x86) Dynamic-Link Library") +!MESSAGE "adv1 - Win32 Debug" (basierend auf "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "adv1" +# PROP Scc_LocalPath "." +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "adv1 - 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 /GR- /GX- /O2 /I "..\..\source" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "NT" /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:"../msvc/adv1.dll" /libpath:"..\..\pd-msvc" +# SUBTRACT LINK32 /nodefaultlib + +!ELSEIF "$(CFG)" == "adv1 - 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 /GR- /GX- /ZI /Od /I "..\..\source" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "NT" /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 "adv1 - Win32 Release" +# Name "adv1 - Win32 Debug" +# Begin Source File + +SOURCE=.\main.cpp +# End Source File +# End Target +# End Project diff --git a/externals/grill/flext/tutorial/adv1/main.cpp b/externals/grill/flext/tutorial/adv1/main.cpp new file mode 100755 index 00000000..f59ebddd --- /dev/null +++ b/externals/grill/flext/tutorial/adv1/main.cpp @@ -0,0 +1,104 @@ +/* +flext tutorial - advanced 1 + +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 example of a simplified prepend object +*/ + +#include + +#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 400) +#error You need at least flext version 0.4.0 +#endif + + +class adv1: + public flext_base +{ + FLEXT_HEADER(adv1,flext_base) + +public: + // constructor with variable argument list + adv1(int argc,t_atom *argv); + +protected: + void m_any(const t_symbol *s,int argc,t_atom *argv); // method which digests anything + + AtomList lst; +private: + FLEXT_CALLBACK_A(m_any); // callback for method "m_any" (with anything argument) +}; + +// instantiate the class (constructor has a variable argument list) +// note the two words in the string: prepend acts as an alias for adv1! +FLEXT_NEW_V("adv1 prepend",adv1) + + + +// constructor + +adv1::adv1(int argc,t_atom *argv) +{ + AddInAnything(); // one inlet that can receive anything + AddOutAnything(); // one outlet for anything + + // set up inlets and outlets + SetupInOut(); + + // register method + FLEXT_ADDMETHOD(0,m_any); // register method "m_any" for inlet 0 + + if(argc != 0) { // check for arg count + // store arg list + lst(argc,argv); + } + else { + // no args given + post("%s - no arguments given",thisName()); + + // tell flext that the initialization was not successful... object will not live + InitProblem(); + } +} + + + +// method + +void adv1::m_any(const t_symbol *s,int argc,t_atom *argv) +{ + // reserve space for as many atoms as possibly necessary + AtomList result(lst.Count()+argc+2); + + // ix is our counter of atoms to output + int ix = 0; + + int i = 0; + if(!IsSymbol(lst[0])) { + // if first element to prepend is no symbol then make it a "list" + SetSymbol(result[ix++],sym_list); + } + // copy atoms to prepend to result list + for(; i < lst.Count(); ++i) CopyAtom(&result[ix++],&lst[i]); + + // if anything is no "list" or "float" then append it to result list + if(s != sym_list && s != sym_float +#ifdef MAXMSP + && s != sym_int // in Max integers are system data types +#endif + ) + SetSymbol(result[ix++],s); + + // append pending arguments to result list + for(i = 0; i < argc; ++i) CopyAtom(&result[ix++],argv+i); + + // output result list as an anything + ToOutAnything(0,GetSymbol(result[0]),ix-1,result.Atoms()+1); +} + + -- cgit v1.2.1