Commit 991bead8 authored by thomas's avatar thomas
Browse files

no message


git-svn-id: https://svn.grrrr.org/ext/trunk@218 4d9ac71a-51e6-0310-8455-cad1006bcd31
parent cb04c940
# pan~ - tutorial example (by Frank Barknecht)
#
# Makefile for gcc
#
# usage: make -f makefile.pd-cygwin
#
# ---------------------------------------------
NAME=pan~
# where to build
TARGDIR=./pd-cygwin
# where to install ### EDIT! ###
INSTDIR=c:/programme/audio/pd/extra
# 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
CFLAGS=-O6 -mpentium
LIBS=m pd
# the rest can stay untouched
# ----------------------------------------------
# all the source files from the package
SRCS=main.cpp
HDRS=
TARGET=$(TARGDIR)/$(NAME).dll
# default target
all: $(TARGDIR) $(TARGET)
$(SRCS): $(HDRS)
touch $@
$(TARGDIR):
mkdir $(TARGDIR)
$(TARGDIR)/%.o : %.cpp
$(CXX) -c $(CFLAGS) $(FLAGS) $(patsubst %,-I%,$(INCLUDES) $(FLEXTPATH)) $< -o $@
$(TARGET) : $(patsubst %.cpp,$(TARGDIR)/%.o,$(SRCS)) $(FLEXTLIB)
$(CXX) $(LDFLAGS) -shared $(patsubst %,-L%,$(LIBPATH)) $^ $(patsubst %,-l%,$(LIBS)) -o $@
chmod 755 $@
$(INSTDIR):
mkdir $(INSTDIR)
install:: $(INSTDIR)
install:: $(TARGET)
cp $^ $(INSTDIR)
chown root.root $(patsubst %,$(INSTDIR)/%,$(notdir $^))
.PHONY: clean
clean:
rm -f $(TARGDIR)/*.o $(TARGET)
......@@ -23,8 +23,8 @@ CFG=signal1 - Win32 Debug
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
# PROP Scc_ProjName "max/flext/tutorial/signal1"
# PROP Scc_LocalPath "."
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
......
/*
flext tutorial - signal 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 object showing varous parameters of the pd audio system
*/
// include flext header
#include <flext.h>
// check for appropriate flext version
#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 300)
#error You need at least flext version 0.3.0
#endif
// define the class that stands for a pd/Max object
// Attention: the class name must be the same as the object name!! (without the ~)
class signal2:
// inherit from flext dsp class
public flext_dsp
{
// obligatory flext header (class name,base class name)
FLEXT_HEADER(signal2,flext_dsp)
public:
// constructor
signal2();
protected:
void m_bang(); // method for bang
// this virtual function is obligatory for objects derived from flext_dsp
virtual void m_signal(int n, float *const *in, float *const *out);
private:
FLEXT_CALLBACK(m_bang); // callback for method "m_bang"
};
// instantiate the class
FLEXT_NEW_DSP("signal2~",signal2)
signal2::signal2()
{
// define inlets:
// first inlet must always by of type anything (or signal for dsp objects)
AddInAnything(); // add one inlet for any message
// add outlets for sample rate, block size, audio in and out channel count
AddOutFloat(1);
AddOutInt(3); // although PD knows no int type, flext does!
// set up inlets and outlets - obligatory!
SetupInOut();
// register methods
FLEXT_ADDBANG(0,m_bang); // register method "m_bang" for bang message into inlet 0
}
void signal2::m_bang()
{
// output various parameters of the pd audio system
ToOutFloat(0,Samplerate());
ToOutInt(1,Blocksize());
ToOutInt(2,ChannelsIn());
ToOutInt(3,ChannelsOut());
}
void signal2::m_signal(int n, float *const *in, float *const *out)
{
// do no dsp work
}
# Microsoft Developer Studio Project File - Name="signal2" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** NICHT BEARBEITEN **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=signal2 - Win32 Debug
!MESSAGE Dies ist kein gltiges Makefile. Zum Erstellen dieses Projekts mit NMAKE
!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und fhren Sie den Befehl
!MESSAGE
!MESSAGE NMAKE /f "signal2.mak".
!MESSAGE
!MESSAGE Sie knnen beim Ausfhren von NMAKE eine Konfiguration angeben
!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:
!MESSAGE
!MESSAGE NMAKE /f "signal2.mak" CFG="signal2 - Win32 Debug"
!MESSAGE
!MESSAGE Fr die Konfiguration stehen zur Auswahl:
!MESSAGE
!MESSAGE "signal2 - Win32 Release" (basierend auf "Win32 (x86) Dynamic-Link Library")
!MESSAGE "signal2 - Win32 Debug" (basierend auf "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "signal2 - 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 /GX /O2 /I "..\.." /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:"../signal2~.dll" /libpath:"..\msvc" /libpath:"..\..\msvc-debug"
!ELSEIF "$(CFG)" == "signal2 - 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 "..\.." /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-pdwin.lib /nologo /dll /debug /machine:I386 /out:"msvc-debug/signal2~.dll" /pdbtype:sept /libpath:"..\msvc-debug" /libpath:"..\..\msvc-debug"
!ENDIF
# Begin Target
# Name "signal2 - Win32 Release"
# Name "signal2 - Win32 Debug"
# Begin Source File
SOURCE=.\main.cpp
# End Source File
# End Target
# End Project
......@@ -46,17 +46,18 @@ FLEXT_NEW("simple1",simple1)
simple1::simple1()
{
// define inlets
AddInAnything(); // first inlet must by of type anything (or signal)
// define inlets:
// first inlet must always by of type anything (or signal for dsp objects)
AddInAnything(); // add one inlet for any message
// define outlets
AddOutFloat(); // one float outlet (has index 0)
// define outlets:
AddOutFloat(); // add one float outlet (has index 0)
// set up inlets and outlets - obligatory! (do only once!!!)
// set up inlets and outlets - obligatory!
SetupInOut();
// register methods
FLEXT_ADDMETHOD(0,m_float); // register method (for floats) "m_float" for inlet 0
FLEXT_ADDMETHOD(0,m_float); // register method (for float messages) "m_float" for inlet 0
}
void simple1::m_float(float f)
......@@ -72,6 +73,6 @@ void simple1::m_float(float f)
res = 1/f;
// output value to outlet
ToOutFloat(0,res); // (0 stands for the outlet index 0)
ToOutFloat(0,res); // (0 stands for the outlet index 0 - the leftmost outlet)
}
......@@ -55,7 +55,7 @@ simple2::simple2(float init):
// define outlets
AddOutFloat(); // one float outlet (has index 0)
// set up inlets and outlets - obligatory! (do only once!!!)
// set up inlets and outlets - obligatory!
SetupInOut();
// register methods
......@@ -74,6 +74,7 @@ void simple2::m_float1(float f)
void simple2::m_float2(float f)
{
// store float
arg = f;
}
......@@ -3,6 +3,22 @@ Microsoft Developer Studio Workspace File, Format Version 6.00
###############################################################################
Project: "adv1"=.\adv1\adv1.dsp - Package Owner=<4>
Package=<5>
{{{
begin source code control
adv1
.\adv1
end source code control
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "flext"=..\flext.dsp - Package Owner=<4>
Package=<5>
......@@ -31,8 +47,40 @@ Package=<4>
###############################################################################
Project: "prepend"=..\..\prepend\prepend.dsp - Package Owner=<4>
Package=<5>
{{{
begin source code control
prepend
..\..\prepend
end source code control
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "signal1"=.\signal1\signal1.dsp - Package Owner=<4>
Package=<5>
{{{
begin source code control
max/flext/tutorial/signal1
.\signal1
end source code control
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "signal2"=.\signal2\signal2.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
......
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