Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jonathan Wilkes
flext
Commits
de2b6646
Commit
de2b6646
authored
Feb 17, 2002
by
thomas
Browse files
no message
git-svn-id:
https://svn.grrrr.org/ext/trunk@48
4d9ac71a-51e6-0310-8455-cad1006bcd31
parent
3adf5235
Changes
10
Hide whitespace changes
Inline
Side-by-side
flext.dsp
View file @
de2b6646
...
...
@@ -80,6 +80,14 @@ LIB32=link.exe -lib
# Name "flext - Win32 Release"
# Name "flext - Win32 Debug"
# Begin Group "doc"
# PROP Default_Filter ""
# Begin Source File
SOURCE=.\readme.txt
# End Source File
# End Group
# Begin Source File
SOURCE=.\flbase.cpp
...
...
license.txt
View file @
de2b6646
flext - C++
compatibility
layer for Max/MSP and pd (pure data) externals
flext - C++ layer for Max/MSP and pd (pure data) externals
Copyright (C) 2001,2002 Thomas Grill
This program is free software; you can redistribute it and/or
...
...
readme.txt
View file @
de2b6646
flext - C
ompatibility library
for Max/MSP and pd (pure data) externals
flext - C
++ layer
for Max/MSP and pd (pure data) externals
version 0.1.1
Copyright (c) 2001,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.
Donations for further development of the package are highly appreciated.
----------------------------------------------------------------------------
...
...
@@ -23,39 +24,45 @@ Package files:
The package should at least compile (and is tested) with the following compilers:
- pd - Windows:
o Borland C++ 5.5 (free):
ok
- makefile is no real make but works
o Microsoft Visual C++ 6:
no makefile yet
o Borland C++ 5.5 (free):
makefile.bcc
- makefile is no real make but works
(you have to edit the pd path!)
o Microsoft Visual C++ 6:
flext.dsp - project file (you have to edit the pd path in the project properties/C-C++/preprocessor tab!)
- pd - linux:
o GCC:
no
makefile
yet
o GCC: makefile
.gcc - (you have to edit the pd path!)
- Max/MSP - MacOS:
o Metrowerks CodeWarrior V6:
ok
o Metrowerks CodeWarrior V6:
flext - CodeWarrior project file
for Max/MSP you will also need the Max/MSP SDK
for PD you need the source code (which is most likely part of the distribution)
for PD you need the
pd
source code (which is most likely part of the distribution)
----------------------------------------------------------------------------
Features:
Goals/features of the package:
- better readability of code compared to straight C externals
- faster development, more robust coding
- sharing of common methods, data by using base classes
- sharing of common methods and data by using base classes
see flext.h for the documented base classes
----------------------------------------------------------------------------
Version history:
0.1.1:
- documentation for flext.h
- more emancipation from GEM code
- virtually everything renamed
- abstraction for dsp processing
- makefile for BCC
- manual call of extern_setup or main unnecessary for single objects - only in pd libraries
- delayed buffer init (only name is set beforehand)
- loadbang also in PD
- introduced "compatibility mode" which denies platform-specific features
0.1.0:
- max-pd 0.2 became flext 0.1.0
...
...
@@ -76,15 +83,19 @@ Restrictions in compatibility mode:
----------------------------------------------------------------------------
TODO list:
general:
- documentation
- add
warnin
g messages for debugging version
- add
lo
g messages for debugging version
- exchange more preprocessor definitions for C++ base class code
- cleaner makefiles
- makefile and project for MS VC++ 6
- flext project and example template for CodeWarrior
- better function names
- prevent buffer warning message at max patcher load (wait for loadbang)
- abstraction for parsing GIMME args
- abstraction for creating lists
- cleaner makefile for BCC
- makefile for MS VC++ 6
- should we use a namespace?
bugs:
- "float method overwritten" warning in pd
features:
- abstraction for parsing argument lists
- abstraction for creating lists and anythings
source/flbase.cpp
View file @
de2b6646
/*
flext - C++
compatibility
layer for Max/MSP and pd (pure data) externals
flext - C++ layer for Max/MSP and pd (pure data) externals
Copyright (c) 2001,2002 Thomas Grill (xovo@gmx.net)
For information on usage and redistribution, and for a DISCLAIMER OF ALL
...
...
source/flbase.h
View file @
de2b6646
/*
flext - C++
compatibility
layer for Max/MSP and pd (pure data) externals
flext - C++ layer for Max/MSP and pd (pure data) externals
Copyright (c) 2001,2002 Thomas Grill (xovo@gmx.net)
For information on usage and redistribution, and for a DISCLAIMER OF ALL
...
...
@@ -38,9 +38,10 @@ struct FLEXT_EXT flext_hdr
{
//////////
// The obligatory object header
t_sigobj
pd_obj
;
// default signal
t_sigobj
pd_obj
;
#ifdef PD
F
defsig
;
float
defsig
;
// float signal holder for pd
#endif
//////////
...
...
@@ -104,16 +105,6 @@ class FLEXT_EXT flext_obj
// Creation callback
static
void
callb_setup
(
t_class
*
)
{}
// to be called in object _setup function
static
void
enable_signal
(
t_class
*
classPtr
,
float
def
=
0.
)
{
#ifdef PD
((
flext_hdr
*
)
classPtr
)
->
defsig
=
def
;
#elif defined(MAXMSP)
dsp_initclass
();
#endif
}
private:
//////////
...
...
@@ -129,6 +120,7 @@ class FLEXT_EXT flext_obj
//////////
// The object's name in the patcher
const
char
*
m_name
;
};
// This has a dummy arg so that NT won't complain
...
...
@@ -167,7 +159,7 @@ static void cb_setup(t_class *classPtr);
#define FLEXTTYPE_F A_FLOAT
#define FLEXTTYPE_float A_FLOAT
#define FLEXTTYPE_FI A_FLINT
#define FLEXTTYPE_flint A_FLINT
#define FLEXTTYPE_
t_
flint A_FLINT
#define FLEXTTYPE_t_symbol A_SYMBOL
#define FLEXTTYPE_t_pointer A_POINTER
...
...
source/flbuf.cpp
View file @
de2b6646
/*
flext - C++
compatibility
layer for Max/MSP and pd (pure data) externals
flext - C++ layer for Max/MSP and pd (pure data) externals
Copyright (c) 2001,2002 Thomas Grill (xovo@gmx.net)
For information on usage and redistribution, and for a DISCLAIMER OF ALL
...
...
@@ -57,7 +57,7 @@ I flext_base::buffer::Set(t_symbol *s,BL nameonly)
if
(
!
a
)
{
if
(
*
sym
->
s_name
)
error
(
"
%s
: no such array '%s'"
,
thisName
(),
sym
->
s_name
);
error
(
"
buffer
: no such array '%s'"
,
sym
->
s_name
);
sym
=
NULL
;
ret
=
-
1
;
}
...
...
source/flcwmax.h
View file @
de2b6646
/*
flext - C++
compatibility
layer for Max/MSP and pd (pure data) externals
flext - C++ layer for Max/MSP and pd (pure data) externals
Copyright (c) 2001,2002 Thomas Grill (xovo@gmx.net)
For information on usage and redistribution, and for a DISCLAIMER OF ALL
...
...
source/flext.cpp
View file @
de2b6646
/*
flext - C++
compatibility
layer for Max/MSP and pd (pure data) externals
flext - C++ layer for Max/MSP and pd (pure data) externals
Copyright (c) 2001,2002 Thomas Grill (xovo@gmx.net)
For information on usage and redistribution, and for a DISCLAIMER OF ALL
...
...
@@ -10,7 +10,8 @@ WARRANTIES, see the file, "license.txt," in this distribution.
#include <flext.h>
// -- flext_base --------------------------
// === flext_base ============================================
BL
flext_base
::
compatibility
=
true
;
...
...
@@ -67,7 +68,6 @@ BL flext_base::setup_inout()
case
xlet
::
tp_def
:
break
;
case
xlet
::
tp_sig
:
CLASS_MAINSIGNALIN
(
thisClass
(),
flext_hdr
,
defsig
);
++
insigs
;
break
;
default:
...
...
@@ -81,10 +81,11 @@ BL flext_base::setup_inout()
case
xlet
::
tp_flint
:
{
C
sym
[]
=
"ft??"
;
if
(
ix
>=
10
)
{
if
(
compatibility
)
if
(
compatibility
)
{
// Max allows max. 9 inlets
post
(
"%s: Only 9 float inlets allowed in compatibility mode"
,
thisName
());
ok
=
false
;
}
else
sym
[
2
]
=
'0'
+
ix
/
10
,
sym
[
3
]
=
'0'
+
ix
%
10
;
}
...
...
@@ -236,11 +237,16 @@ V flext_base::m_help()
post
(
"%s (using flext) - compiled on %s %s"
,
thisName
(),
__DATE__
,
__TIME__
);
}
// -- flext_dsp --------------------------
// === flext_dsp ==============================================
V
flext_dsp
::
cb_setup
(
t_class
*
c
)
{
enable_signal
(
c
);
#ifdef PD
CLASS_MAINSIGNALIN
(
c
,
flext_hdr
,
defsig
);
#elif defined(MAXMSP)
dsp_initclass
();
#endif
add_dsp
(
c
,
cb_dsp
);
add_method1
(
c
,
cb_enable
,
"enable"
,
A_FLINT
);
...
...
source/flext.h
View file @
de2b6646
/*
flext - C++
compatibility
layer for Max/MSP and pd (pure data) externals
flext - C++ layer for Max/MSP and pd (pure data) externals
Copyright (c) 2001,2002 Thomas Grill (xovo@gmx.net)
For information on usage and redistribution, and for a DISCLAIMER OF ALL
...
...
@@ -11,6 +11,8 @@ WARRANTIES, see the file, "license.txt," in this distribution.
#ifndef __FLEXT_H
#define __FLEXT_H
#define FLEXT_VERSION 101
#include <flbase.h>
...
...
@@ -160,10 +162,6 @@ protected:
flext_base
();
virtual
~
flext_base
();
private:
friend
class
flext_dsp
;
struct
xlet
{
enum
type
{
tp_none
=
0
,
tp_def
,
tp_float
,
tp_flint
,
tp_sym
,
tp_list
,
tp_sig
...
...
@@ -179,6 +177,8 @@ private:
V
AddInlet
(
xlet
::
type
tp
,
I
mult
)
{
AddXlet
(
tp
,
mult
,
inlist
);
}
V
AddOutlet
(
xlet
::
type
tp
,
I
mult
)
{
AddXlet
(
tp
,
mult
,
outlist
);
}
private:
xlet
*
inlist
,
*
outlist
;
I
incnt
,
outcnt
,
insigs
,
outsigs
;
t_outlet
**
outlets
;
...
...
@@ -214,10 +214,16 @@ public:
// --- inheritable virtual methods --------------------------------
// called on every dsp init
// called on every dsp init (don't expect valid data in the signal vectors!)
// n: frames (aka samples) in one signal vector
// insigs: array of input vectors (get number with function cnt_insig())
// outsigs: array of output vectors (get number with function cnt_outsig())
virtual
V
m_dsp
(
I
n
,
F
*
const
*
insigs
,
F
*
const
*
outsigs
);
// called with every signal vector
// called with every signal vector (here you do the dsp calculation)
// n: frames (aka samples) in one signal vector
// insigs: array of input vectors (get number with function cnt_insig())
// outsigs: array of output vectors (get number with function cnt_outsig())
virtual
V
m_signal
(
I
n
,
F
*
const
*
insigs
,
F
*
const
*
outsigs
)
=
0
;
// called with "enable" message: pauses/resumes dsp
...
...
source/flstdc.h
View file @
de2b6646
/*
flext - C++
compatibility
layer for Max/MSP and pd (pure data) externals
flext - C++ layer for Max/MSP and pd (pure data) externals
Copyright (c) 2001,2002 Thomas Grill (xovo@gmx.net)
For information on usage and redistribution, and for a DISCLAIMER OF ALL
...
...
@@ -28,7 +28,11 @@ once drifted apart in Max and PD. It is not elegant but helps.
#pragma warning (push)
#pragma warning (disable:4091)
extern
"C"
{
#ifdef _DEBUG
#include <m_pd.h>
#else
#include <m_imp.h> // for easier debugging
#endif
}
#pragma warning (pop)
...
...
@@ -57,6 +61,7 @@ typedef t_float t_flint;
#define add_method3(clss,meth,text,a1,a2,a3) class_addmethod(clss, (t_method)meth, gensym(text), a1,a2,a3,A_NULL)
#define add_method4(clss,meth,text,a1,a2,a3,a4) class_addmethod(clss, (t_method)meth, gensym(text), a1,a2,a3,a4,A_NULL)
#define add_method5(clss,meth,text,a1,a2,a3,a5) class_addmethod(clss, (t_method)meth, gensym(text), a1,a2,a3,a4,a5,A_NULL)
#define add_loadbang(clss,meth) class_addmethod(clss,(t_method)meth, gensym("loadbang"), A_CANT, A_NULL)
#define newout_signal(clss) outlet_new(clss,&s_signal)
#define newout_float(clss) outlet_new(clss,&s_float)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment