Commit 01568726 authored by thomas's avatar thomas
Browse files

no message


git-svn-id: https://svn.grrrr.org/ext/trunk@224 4d9ac71a-51e6-0310-8455-cad1006bcd31
parent b36a9810
# flext - C++ layer for Max/MSP and pd (pure data) externals
# Copyright (c) 2001,2002 Thomas Grill (xovo@gmx.net)
#
# Makefile for gcc @ linux
# Makefile for gcc @ cygwin
#
# usage:
# to build run "make -f makefile.pd-cygwin"
# to install (as root), do "make -f makefile.pd-cygwin install"
#
# ---------------------------------------------
#
# compiling for threaded usage is not yet possible
# compiling for threaded usage is not supported
#
## EDIT ZONE ##################################
......@@ -17,9 +16,6 @@
# pd path
PDPATH=c:/programme/audio/pd/src
# where to install
INSTDIR=
###############################################
# where to build (temporary)
......@@ -27,7 +23,7 @@ TARGDIR=./pd-cygwin
# compiler+linker stuff
INCLUDES=$(PDPATH)
FLAGS=-DPD
FLAGS=-DPD -DNT
CFLAGS=-O6 -mcpu=pentiumpro
CFLAGS_D=-mcpu=pentiumpro -g
CFLAGS_T=-DFLEXT_THREADS
......@@ -41,7 +37,7 @@ LIBS=
NAME=flext
# all the source files from the package
SRCS=flbase.cpp flext.cpp flbuf.cpp fldsp.cpp fllib.cpp flxlet.cpp flsetup.cpp flutil.cpp
SRCS=flbase.cpp flext.cpp flbuf.cpp fldsp.cpp fllib.cpp flxlet.cpp flsetup.cpp flutil.cpp flatom.cpp
HDRS=flstdc.h flbase.h flclass.h fldefs.h flext.h
IHDRS=flinternal.h
......@@ -87,15 +83,6 @@ $(TARGET_TD) : $(patsubst %.cpp,$(TARGDIR)/%.tdo,$(SRCS))
ar rc $@ $^
chmod 755 $@
$(INSTDIR):
mkdir $(INSTDIR)
install:: $(INSTDIR)
install:: $(TARGET) $(TARGET_D) $(HDRS)
cp $^ $(INSTDIR)
chown root.root $(patsubst %,$(INSTDIR)/%,$(notdir $^))
.PHONY: clean
clean:
rm -f $(TARGDIR)/*.o $(TARGET) $(TARGET_D)
......
# flext tutorial examples
#
# Makefile for gcc @ cygwin
#
# usage: make -f makefile.pd-cygwin
#
# -----------------------------------------------------
#
# note: the thread examples don't compile with cygwin
#
# -----------------------------------------------------
# where to build
TARGDIR=./pd-cygwin
# flext stuff ### EDIT! ###
FLEXTPATH=..
FLEXTLIB=$(FLEXTPATH)/pd-cygwin/flext.lib
# compiler+linker stuff ### EDIT! ###
INCLUDES=c:/programme/audio/pd/src
LIBPATH=c:/programme/audio/pd/bin
FLAGS=-DPD -DNT
CFLAGS=-O6 -mcpu=pentiumpro
LIBS=m pd
# the rest can stay untouched
# ----------------------------------------------
# all the source files from the package
EXAMPLES=simple1 simple2 simple3 adv1 signal1~ signal2~ # thread1 thread2
TARGETS=$(patsubst %,$(TARGDIR)/%.dll,$(EXAMPLES))
# default target
all: $(TARGDIR) $(TARGETS)
$(TARGDIR)/%~.dll : $(TARGDIR)/%.dll
mv $^ $@
$(SRCS): $(HDRS)
touch $@
$(TARGDIR):
mkdir $(TARGDIR)
$(TARGDIR)/%.o : %/main.cpp
$(CXX) -c $(CFLAGS) $(FLAGS) $(patsubst %,-I%,$(INCLUDES) $(FLEXTPATH)) $< -o $@
$(TARGDIR)/%.dll : $(TARGDIR)/%.o $(FLEXTLIB)
$(CXX) $(LDFLAGS) -shared $(patsubst %,-L%,$(LIBPATH)) $^ $(patsubst %,-l%,$(LIBS)) -o $@
chmod 755 $@
.PHONY: clean
clean:
rm -f $(TARGDIR)/*.o $(TARGETS)
# flext tutorial examples
#
# Makefile for gcc @ linux
#
# usage: make -f makefile.pd-linux
#
# -----------------------------------------------------
# pd path
PDPATH=/usr/local/include
# where to build
TARGDIR=./pd-linux
# flext stuff ### EDIT! ###
FLEXTPATH=/usr/local/lib/pd/flext
FLEXTLIB=$(FLEXTPATH)/flext_t.a # take threaded library for all
# where to install
INSTDIR=/usr/local/lib/pd/flext/tutorial
# compiler+linker stuff ### EDIT! ###
INCLUDES=$(PDPATH)
LIBPATH=
FLAGS=-DPD -DFLEXT_THREADS
CFLAGS=-O6 -mcpu=pentiumpro
LIBS=m pd
# the rest can stay untouched
# ----------------------------------------------
# all the source files from the package
EXAMPLES=simple1 simple2 simple3 adv1 signal1~ signal2~ thread1 thread2
TARGETS=$(patsubst %,$(TARGDIR)/%.pd_linux,$(EXAMPLES))
# default target
all: $(TARGDIR) $(TARGETS)
$(TARGDIR)/%~.pd_linux : $(TARGDIR)/%.pd_linux
mv $^ $@
$(SRCS): $(HDRS)
touch $@
$(TARGDIR):
mkdir $(TARGDIR)
$(TARGDIR)/%.o : %/main.cpp
$(CXX) -c $(CFLAGS) $(FLAGS) $(patsubst %,-I%,$(INCLUDES) $(FLEXTPATH)) $< -o $@
$(TARGDIR)/%.pd_linux : $(TARGDIR)/%.o $(FLEXTLIB)
$(CXX) $(LDFLAGS) -shared $(patsubst %,-L%,$(LIBPATH)) $^ $(patsubst %,-l%,$(LIBS)) -o $@
chmod 755 $@
.PHONY: clean
clean:
rm -f $(TARGDIR)/*.o $(TARGETS)
#N canvas 391 528 450 300 10;
#X obj 179 144 pan~;
#X obj 221 104 hsl 128 15 0 1 0 0 empty empty empty 20 8 0 8 -260818
#N canvas 335 232 452 302 10;
#X obj 233 98 hsl 128 15 0 1 0 0 empty empty empty 20 8 0 8 -260818
-1 -1 0 1;
#X obj 117 46 osc~ 440;
#X obj 179 171 *~ 0.6;
#X obj 172 205 dac~;
#X obj 155 173 *~ 0.6;
#X obj 147 218 dac~;
#X obj 184 47 osc~ 880;
#X floatatom 214 73 5 0 0;
#X connect 0 0 3 0;
#X connect 1 0 0 2;
#X connect 2 0 0 0;
#X connect 3 0 4 0;
#X connect 3 0 4 1;
#X connect 5 0 0 1;
#X connect 6 0 0 2;
#X floatatom 210 80 5 0 0;
#X obj 155 139 signal1~;
#X connect 0 0 6 2;
#X connect 1 0 6 0;
#X connect 2 0 3 0;
#X connect 2 0 3 1;
#X connect 4 0 6 1;
#X connect 5 0 6 2;
#X connect 6 0 2 0;
// pan~ - a flext tutorial external written by Frank Barknecht
// signal1~ - a flext tutorial external written by Frank Barknecht
//
// This is a commented port of the pan~ example from the PD-Externals-Howto to
// illustrate the usage of flext. You can get the original code at
......@@ -7,13 +7,13 @@
#include <flext.h>
#include <math.h>
#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 202)
#error You need at least flext version 0.2.2
#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 300)
#error You need at least flext version 0.3.0
#endif
// A flext dsp external ("tilde object") inherits from the class flext_dsp
class pan:
class signal1:
public flext_dsp
{
// Each external that is written in C++ needs to use #defines
......@@ -26,10 +26,10 @@ class pan:
// should be somewhere in your dsp file.
// A good place is here:
FLEXT_HEADER(pan, flext_dsp)
FLEXT_HEADER(signal1, flext_dsp)
public:
pan()
signal1()
{
// The constructor of your class is responsible for
// setting up inlets and outlets and for registering
......@@ -82,15 +82,16 @@ class pan:
// following line:
//post("Set panning to %.2f, maybe clipped from %.2f", f_pan,f);
} // end setPan
}; // end of class deklaration for pan
}; // end of class declaration for signal1
// Before we can run our pan-class in PD, the object has to be registered as a
// Before we can run our signal1-class in PD, the object has to be registered as a
// PD object. Otherwise it would be a simple C++-class, and what good would
// that be for? Registering is made easy with the FLEXT_NEW_* macros defined
// in flext.h. For tilde objects without argguments call:
// in flext.h. For tilde objects without arguments call:
FLEXT_NEW_TILDE("pan~", pan)
FLEXT_NEW_DSP("signal1~ signal1~", 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:
//
......@@ -99,7 +100,7 @@ FLEXT_NEW_TILDE("pan~", pan)
// These are arrays of the signals in the objects signal inlets rsp.
// oulets. We come to that later inside the function.
void pan::m_signal(int n, float *const *in, float *const *out)
void signal1::m_signal(int n, float *const *in, float *const *out)
{
const float *ins1 = in[0];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment