aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/flext/tutorial
diff options
context:
space:
mode:
Diffstat (limited to 'externals/grill/flext/tutorial')
-rw-r--r--externals/grill/flext/tutorial/build-pd-bcc.bat4
-rw-r--r--externals/grill/flext/tutorial/config-pd-cygwin.txt5
-rw-r--r--externals/grill/flext/tutorial/config-pd-darwin.txt5
-rw-r--r--externals/grill/flext/tutorial/config-pd-linux.txt5
-rwxr-xr-xexternals/grill/flext/tutorial/lib1/lib1.cwbin101183 -> 148873 bytes
-rw-r--r--externals/grill/flext/tutorial/makefile.pd-cygwin5
-rw-r--r--externals/grill/flext/tutorial/makefile.pd-darwin6
-rw-r--r--externals/grill/flext/tutorial/makefile.pd-linux6
-rw-r--r--externals/grill/flext/tutorial/makefile.pd-msvc1
-rwxr-xr-xexternals/grill/flext/tutorial/maxmsp/ex-timer1bin0 -> 1247 bytes
-rwxr-xr-xexternals/grill/flext/tutorial/pd/ex-timer1.pd64
-rw-r--r--externals/grill/flext/tutorial/readme.txt9
-rwxr-xr-xexternals/grill/flext/tutorial/timer1/main.cpp100
-rwxr-xr-xexternals/grill/flext/tutorial/timer1/timer1.cwbin0 -> 207765 bytes
-rwxr-xr-xexternals/grill/flext/tutorial/timer1/timer1.dsp95
15 files changed, 291 insertions, 14 deletions
diff --git a/externals/grill/flext/tutorial/build-pd-bcc.bat b/externals/grill/flext/tutorial/build-pd-bcc.bat
index 5c180607..fd2c9264 100644
--- a/externals/grill/flext/tutorial/build-pd-bcc.bat
+++ b/externals/grill/flext/tutorial/build-pd-bcc.bat
@@ -36,6 +36,10 @@
@make -f ..\makefile.pd-bcc NAME=attr3 SETUPFUNCTION=attr3_setup
@cd ..
+@cd timer1
+@make -f ..\makefile.pd-bcc NAME=timer1 SETUPFUNCTION=timer1_setup
+@cd ..
+
@cd signal1
@make -f ..\makefile.pd-bcc NAME=signal1~ SETUPFUNCTION=signal1_tilde_setup
@cd ..
diff --git a/externals/grill/flext/tutorial/config-pd-cygwin.txt b/externals/grill/flext/tutorial/config-pd-cygwin.txt
index 237cd519..82705200 100644
--- a/externals/grill/flext/tutorial/config-pd-cygwin.txt
+++ b/externals/grill/flext/tutorial/config-pd-cygwin.txt
@@ -21,3 +21,8 @@ FLEXTPATH=${PDPATH}/flext
# where should the examples be built?
OUTPATH=./pd-cygwin
+
+# additional compiler flags
+# (check if they fit to your system!)
+UFLAGS=-mcpu=pentiumpro # gcc 2.95
+#UFLAGS=-mcpu=pentium3 -msse # gcc 3.2
diff --git a/externals/grill/flext/tutorial/config-pd-darwin.txt b/externals/grill/flext/tutorial/config-pd-darwin.txt
index eb65fcdf..7990fa2a 100644
--- a/externals/grill/flext/tutorial/config-pd-darwin.txt
+++ b/externals/grill/flext/tutorial/config-pd-darwin.txt
@@ -30,3 +30,8 @@ OUTPATH=./pd-darwin
# where should the examples be installed?
# (leave blank to omit installation)
INSTPATH=${FLEXTPATH}/tutorial
+
+# additional compiler flags
+# (check if they fit to your system!)
+UFLAGS=-malign-power -maltivec
+
diff --git a/externals/grill/flext/tutorial/config-pd-linux.txt b/externals/grill/flext/tutorial/config-pd-linux.txt
index 3c263221..bd16411a 100644
--- a/externals/grill/flext/tutorial/config-pd-linux.txt
+++ b/externals/grill/flext/tutorial/config-pd-linux.txt
@@ -30,3 +30,8 @@ OUTPATH=./pd-linux
# where should the examples be installed?
# (leave blank to omit installation)
INSTPATH=${FLEXTPATH}/tutorial
+
+# additional compiler flags
+# (check if they fit to your system!)
+UFLAGS=-mcpu=pentiumpro # gcc 2.95
+#UFLAGS=-mcpu=pentium3 -msse # gcc 3.2
diff --git a/externals/grill/flext/tutorial/lib1/lib1.cw b/externals/grill/flext/tutorial/lib1/lib1.cw
index 8310c18d..afa029c5 100755
--- a/externals/grill/flext/tutorial/lib1/lib1.cw
+++ b/externals/grill/flext/tutorial/lib1/lib1.cw
Binary files differ
diff --git a/externals/grill/flext/tutorial/makefile.pd-cygwin b/externals/grill/flext/tutorial/makefile.pd-cygwin
index 31224ed3..853abfc6 100644
--- a/externals/grill/flext/tutorial/makefile.pd-cygwin
+++ b/externals/grill/flext/tutorial/makefile.pd-cygwin
@@ -18,8 +18,7 @@ FLEXTLIB=$(FLEXTPATH)/flext-pdwin.lib
INCLUDES=$(PDPATH)/src
LIBPATH=$(PDPATH)/bin
FLAGS=-DFLEXT_SYS=2
-CFLAGS=-O6 -fno-rtti
-CFLAGS+=-mcpu=pentium3 -msse # cygwin gcc 3.2
+CFLAGS=${UFLAGS} -O6 -fno-rtti
LIBS=m pd
@@ -28,7 +27,7 @@ LIBS=m pd
# all the source files from the package
-EXAMPLES=simple1 simple2 simple3 adv1 adv2 adv3 attr1 attr2 attr3 signal1~ signal2~ lib1 # thread1 thread2
+EXAMPLES=simple1 simple2 simple3 adv1 adv2 adv3 timer1 attr1 attr2 attr3 signal1~ signal2~ lib1 # thread1 thread2
ifdef SNDOBJ
INCLUDES+=$(SNDOBJ)
diff --git a/externals/grill/flext/tutorial/makefile.pd-darwin b/externals/grill/flext/tutorial/makefile.pd-darwin
index b384d9cc..086d1334 100644
--- a/externals/grill/flext/tutorial/makefile.pd-darwin
+++ b/externals/grill/flext/tutorial/makefile.pd-darwin
@@ -15,8 +15,8 @@ FLEXTLIB=$(FLEXTPATH)/flext_t.a # take threaded library for all
# compiler+linker stuff ### EDIT! ###
INCLUDES=$(PDPATH)
LIBPATH=
-FLAGS=-DFLEXT_SYS=2 -DFLEXT_THREADS -Wno-unused -Wno-parentheses -Wno-switch -Wstrict-prototypes # -maltivec
-CFLAGS=-O6 -fno-rtti
+FLAGS=-DFLEXT_SYS=2 -DFLEXT_THREADS -Wno-unused -Wno-parentheses -Wno-switch -Wstrict-prototypes -Wno-long-double
+CFLAGS=${UFLAGS} -O6 -fno-rtti
LIBS=m
LDFLAGS=-bundle -bundle_loader $(PD)
@@ -25,7 +25,7 @@ LDFLAGS=-bundle -bundle_loader $(PD)
# all the source files from the package
-EXAMPLES=simple1 simple2 simple3 adv1 adv2 adv3 attr1 attr2 attr3 signal1~ signal2~ lib1 thread1 thread2
+EXAMPLES=simple1 simple2 simple3 timer1 adv1 adv2 adv3 attr1 attr2 attr3 signal1~ signal2~ lib1 thread1 thread2
ifdef SNDOBJ
INCLUDES+=$(SNDOBJ)
diff --git a/externals/grill/flext/tutorial/makefile.pd-linux b/externals/grill/flext/tutorial/makefile.pd-linux
index 3b0bc3d3..b370e59d 100644
--- a/externals/grill/flext/tutorial/makefile.pd-linux
+++ b/externals/grill/flext/tutorial/makefile.pd-linux
@@ -16,9 +16,7 @@ FLEXTLIB=$(FLEXTPATH)/flext_t.a # take threaded library for all
INCLUDES=$(PDPATH)/src
LIBPATH=
FLAGS=-DFLEXT_SYS=2 -DFLEXT_THREADS
-CFLAGS=-O6 -fno-rtti
-CFLAGS+=-mcpu=pentiumpro # gcc 2.95
-# CFLAGS+=-mcpu=pentium3 -msse # gcc 3.2
+CFLAGS=${UFLAGS} -O6 -fno-rtti
LIBS=m
@@ -27,7 +25,7 @@ LIBS=m
# all the source files from the package
-EXAMPLES=simple1 simple2 simple3 adv1 adv2 adv3 attr1 attr2 attr3 signal1~ signal2~ lib1 thread1 thread2
+EXAMPLES=simple1 simple2 simple3 adv1 adv2 adv3 timer1 attr1 attr2 attr3 signal1~ signal2~ lib1 thread1 thread2
ifdef SNDOBJ
INCLUDES+=$(SNDOBJ)
diff --git a/externals/grill/flext/tutorial/makefile.pd-msvc b/externals/grill/flext/tutorial/makefile.pd-msvc
index 51c3a58b..a5979454 100644
--- a/externals/grill/flext/tutorial/makefile.pd-msvc
+++ b/externals/grill/flext/tutorial/makefile.pd-msvc
@@ -27,6 +27,7 @@ normal:
nmake /f make-sub.pd-msvc NAME=adv1 DIR=adv1
nmake /f make-sub.pd-msvc NAME=adv2 DIR=adv2
nmake /f make-sub.pd-msvc NAME=adv3 DIR=adv3
+ nmake /f make-sub.pd-msvc NAME=timer1 DIR=timer1
nmake /f make-sub.pd-msvc NAME=attr1 DIR=attr1
nmake /f make-sub.pd-msvc NAME=attr2 DIR=attr2
nmake /f make-sub.pd-msvc NAME=attr3 DIR=attr3
diff --git a/externals/grill/flext/tutorial/maxmsp/ex-timer1 b/externals/grill/flext/tutorial/maxmsp/ex-timer1
new file mode 100755
index 00000000..d3828986
--- /dev/null
+++ b/externals/grill/flext/tutorial/maxmsp/ex-timer1
Binary files differ
diff --git a/externals/grill/flext/tutorial/pd/ex-timer1.pd b/externals/grill/flext/tutorial/pd/ex-timer1.pd
new file mode 100755
index 00000000..7434eb00
--- /dev/null
+++ b/externals/grill/flext/tutorial/pd/ex-timer1.pd
@@ -0,0 +1,64 @@
+#N canvas 110 259 821 364 12;
+#X msg 29 92 help;
+#X obj 16 8 cnv 15 550 40 empty empty timer1 10 22 32 24 -260818 -1
+0;
+#X text 167 30 http://www.parasitaere-kapazitaeten.net;
+#X text 167 10 flext tutorial \, (C)2003 Thomas Grill;
+#X obj 241 241 timer1;
+#X obj 241 267 print;
+#X msg 105 104 resetA;
+#X msg 176 104 resetB;
+#X msg 260 147 oneshotA \$1;
+#X obj 259 124 f 100;
+#X obj 303 107 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 32
+10 -262144 -1 -1 0 256;
+#X obj 260 105 bng 15 250 50 0 empty empty empty 0 -6 32 8 -24198 -1
+-1;
+#X obj 382 124 f 100;
+#X obj 426 107 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 32
+10 -262144 -1 -1 0 256;
+#X obj 383 105 bng 15 250 50 0 empty empty empty 0 -6 32 8 -24198 -1
+-1;
+#X obj 515 124 f 100;
+#X obj 559 107 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 32
+10 -262144 -1 -1 0 256;
+#X obj 516 105 bng 15 250 50 0 empty empty empty 0 -6 32 8 -24198 -1
+-1;
+#X obj 652 123 f 100;
+#X obj 696 106 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 32
+10 -262144 -1 -1 0 256;
+#X obj 653 104 bng 15 250 50 0 empty empty empty 0 -6 32 8 -24198 -1
+-1;
+#X msg 383 147 oneshotB \$1;
+#X msg 516 147 periodicA \$1;
+#X msg 653 146 periodicB \$1;
+#X text 119 82 reset timer;
+#X text 275 81 trigger single event;
+#X text 523 80 trigger periodic event;
+#X msg 30 161 gettime;
+#X msg 30 191 getostime;
+#X text 106 162 get time;
+#X text 127 191 get OS time;
+#X connect 0 0 4 0;
+#X connect 4 0 5 0;
+#X connect 4 1 5 0;
+#X connect 6 0 4 0;
+#X connect 7 0 4 0;
+#X connect 8 0 4 0;
+#X connect 9 0 8 0;
+#X connect 10 0 9 1;
+#X connect 11 0 9 0;
+#X connect 12 0 21 0;
+#X connect 13 0 12 1;
+#X connect 14 0 12 0;
+#X connect 15 0 22 0;
+#X connect 16 0 15 1;
+#X connect 17 0 15 0;
+#X connect 18 0 23 0;
+#X connect 19 0 18 1;
+#X connect 20 0 18 0;
+#X connect 21 0 4 0;
+#X connect 22 0 4 0;
+#X connect 23 0 4 0;
+#X connect 27 0 4 0;
+#X connect 28 0 4 0;
diff --git a/externals/grill/flext/tutorial/readme.txt b/externals/grill/flext/tutorial/readme.txt
index 3be656e7..faceaaad 100644
--- a/externals/grill/flext/tutorial/readme.txt
+++ b/externals/grill/flext/tutorial/readme.txt
@@ -17,12 +17,13 @@ The recommended order to go through the tutorial examples is the following:
1) simple*
2) adv*
3) attr*
-4) signal*
-5) lib*
-6) thread*
+4) timer*
+5) signal*
+6) lib*
+7) thread*
and, if needed
-7) sndobj* and/or stk*
+8) sndobj* and/or stk*
if you choose to compile with SndObj support you will need the respective library
download from: http://www.may.ie/academic/music/musictec/SndObj/main.html
diff --git a/externals/grill/flext/tutorial/timer1/main.cpp b/externals/grill/flext/tutorial/timer1/main.cpp
new file mode 100755
index 00000000..6388eb4a
--- /dev/null
+++ b/externals/grill/flext/tutorial/timer1/main.cpp
@@ -0,0 +1,100 @@
+/*
+flext tutorial - timer 1
+
+Copyright (c) 2003 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 an object using timers
+*/
+
+// enable flext attributes
+#define FLEXT_ATTRIBUTES 1
+
+// include flext header
+#include <flext.h>
+
+// check for appropriate flext version
+#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 403)
+#error You need at least flext version 0.4.3
+#endif
+
+
+// define the class that stands for a pd/Max object
+
+class timer1:
+ // inherit from basic flext class
+ public flext_base
+{
+ // obligatory flext header (class name,base class name)
+ FLEXT_HEADER_S(timer1,flext_base,Setup)
+
+public:
+ // constructor
+ timer1();
+
+protected:
+ // timers
+ Timer tmrA,tmrB;
+
+ void m_getostime(float &f) { f = GetOSTime(); } // method for operating system time attribute
+ void m_getrttime(float &f) { f = GetTime(); } // method for real-time system time attribute
+
+ void m_timerA(void *) { ToOutString(0,"Timer A"); } // timer A method
+ void m_timerB(void *) { ToOutString(0,"Timer B"); } // timer B method
+
+ void m_resetA() { tmrA.Reset(); } // timer A reset
+ void m_resetB() { tmrB.Reset(); } // timer B reset
+ void m_oneshotA(int del) { tmrA.Delay(del*0.001); } // timer A one shot
+ void m_oneshotB(int del) { tmrB.Delay(del*0.001); } // timer B one shot
+ void m_periodicA(int del) { tmrA.Periodic(del*0.001); } // timer A periodic
+ void m_periodicB(int del) { tmrB.Periodic(del*0.001); } // timer B periodic
+
+private:
+ static void Setup(t_classid c);
+
+ // register timer callbacks
+ FLEXT_CALLBACK_T(m_timerA)
+ FLEXT_CALLBACK_T(m_timerB)
+
+ // register method callbacks
+ FLEXT_CALLGET_F(m_getostime)
+ FLEXT_CALLGET_F(m_getrttime)
+ FLEXT_CALLBACK(m_resetA)
+ FLEXT_CALLBACK(m_resetB)
+ FLEXT_CALLBACK_I(m_oneshotA)
+ FLEXT_CALLBACK_I(m_oneshotB)
+ FLEXT_CALLBACK_I(m_periodicA)
+ FLEXT_CALLBACK_I(m_periodicB)
+};
+
+// instantiate the class
+FLEXT_NEW("timer1",timer1)
+
+// class setup function
+void timer1::Setup(t_classid c)
+{
+ FLEXT_CADDATTR_GET(c,"ostime",m_getostime); // register attribute for OS time
+ FLEXT_CADDATTR_GET(c,"time",m_getrttime); // register attribute for RT time
+
+ FLEXT_CADDMETHOD_(c,0,"resetA",m_resetA); // register reset method for timer A
+ FLEXT_CADDMETHOD_(c,0,"resetB",m_resetB); // register reset method for timer B
+ FLEXT_CADDMETHOD_(c,0,"oneshotA",m_oneshotA); // register one shot method for timer A
+ FLEXT_CADDMETHOD_(c,0,"oneshotB",m_oneshotB); // register one shot method for timer B
+ FLEXT_CADDMETHOD_(c,0,"periodicA",m_periodicA); // register periodic method for timer A
+ FLEXT_CADDMETHOD_(c,0,"periodicB",m_periodicB); // register periodic method for timer B
+}
+
+// class constructor
+timer1::timer1():
+ tmrA(false),tmrB(false)
+{
+ AddInAnything("Control timers"); // add inlet for control commands
+ AddOutAnything("Timer output"); // add outlet for timer output
+
+ // register methods
+ FLEXT_ADDTIMER(tmrA,m_timerA); // register method "m_timerA" for timer A
+ FLEXT_ADDTIMER(tmrB,m_timerB); // register method "m_timerB" for timer B
+}
diff --git a/externals/grill/flext/tutorial/timer1/timer1.cw b/externals/grill/flext/tutorial/timer1/timer1.cw
new file mode 100755
index 00000000..08e05996
--- /dev/null
+++ b/externals/grill/flext/tutorial/timer1/timer1.cw
Binary files differ
diff --git a/externals/grill/flext/tutorial/timer1/timer1.dsp b/externals/grill/flext/tutorial/timer1/timer1.dsp
new file mode 100755
index 00000000..35716adc
--- /dev/null
+++ b/externals/grill/flext/tutorial/timer1/timer1.dsp
@@ -0,0 +1,95 @@
+# Microsoft Developer Studio Project File - Name="simple1" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** NICHT BEARBEITEN **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=simple1 - 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 "simple1.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 "simple1.mak" CFG="simple1 - Win32 Debug"
+!MESSAGE
+!MESSAGE Für die Konfiguration stehen zur Auswahl:
+!MESSAGE
+!MESSAGE "simple1 - Win32 Release" (basierend auf "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "simple1 - Win32 Debug" (basierend auf "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName "simple1"
+# PROP Scc_LocalPath "."
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "simple1 - 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/simple1.dll" /libpath:"..\..\pd-msvc"
+
+!ELSEIF "$(CFG)" == "simple1 - 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 "simple1 - Win32 Release"
+# Name "simple1 - Win32 Debug"
+# Begin Source File
+
+SOURCE=.\main.cpp
+# End Source File
+# End Target
+# End Project