Commit 76f2ffc3 authored by thomas's avatar thomas
Browse files

no message


git-svn-id: https://svn.grrrr.org/ext/trunk@629 4d9ac71a-51e6-0310-8455-cad1006bcd31
parent ef6ee34d
No preview for this file type
......@@ -2858,7 +2858,7 @@
OTHER_LDFLAGS = "-bundle_loader /usr/local/pd/bin/pd";
OTHER_LIBTOOL_FLAGS = "";
OTHER_REZFLAGS = "";
PRODUCT_NAME = flext.dylib;
PRODUCT_NAME = libflext.dylib;
REZ_EXECUTABLE = YES;
SECTORDER_FLAGS = "";
WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
......@@ -3139,7 +3139,7 @@
};
F5CBC5B704757A5901A0C81C = {
isa = PBXLibraryReference;
path = flext.dylib;
path = libflext.dylib;
refType = 3;
};
F5CBC5B804757BC801A0C81C = {
......@@ -3831,7 +3831,7 @@
OTHER_LDFLAGS = "-bundle_loader /usr/local/pd/bin/pd";
OTHER_LIBTOOL_FLAGS = "";
OTHER_REZFLAGS = "";
PRODUCT_NAME = flext_d.dylib;
PRODUCT_NAME = libflext_d.dylib;
REZ_EXECUTABLE = YES;
SECTORDER_FLAGS = "";
WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
......@@ -4190,7 +4190,7 @@
};
F5CBC69B047584CD01A0C81C = {
isa = PBXLibraryReference;
path = flext_d.dylib;
path = libflext_d.dylib;
refType = 3;
};
};
......
......@@ -19,7 +19,7 @@ FLAGS+=${UFLAGS}
CFLAGS=-O6
CFLAGS_D=-g
CFLAGS_T=-DFLEXT_THREADS
LIBS=
LIBS=gcc
# ----------------------------------------------
......@@ -45,17 +45,17 @@ HDRS+=$(HDRS_STK)
endif
# for FLEXT_USE_SIMD
CFLAGS+=-framework veclib -Fveclib
CFLAGS+=-framework Carbon -framework veclib -Fveclib -FCarbon
MAKEFILE=makefile.pd-darwin
TARGET=$(TARGDIR)/$(NAME).a
TARGET_D=$(TARGDIR)/$(NAME)_d.a
TARGET_T=$(TARGDIR)/$(NAME)_t.a
TARGET_TD=$(TARGDIR)/$(NAME)_td.a
TARGET_S=$(TARGDIR)/$(NAME).dylib
TARGET_SD=$(TARGDIR)/$(NAME)_d.dylib
TARGET=$(TARGDIR)/lib$(NAME).a
TARGET_D=$(TARGDIR)/lib$(NAME)_d.a
TARGET_T=$(TARGDIR)/lib$(NAME)_t.a
TARGET_TD=$(TARGDIR)/lib$(NAME)_td.a
TARGET_S=$(TARGDIR)/lib$(NAME).dylib
TARGET_SD=$(TARGDIR)/lib$(NAME)_d.dylib
all: $(TARGDIR) $(TARGET) $(TARGET_D) $(TARGET_T) $(TARGET_TD) # $(TARGET_S) $(TARGET_SD)
all: $(TARGDIR) $(TARGET) $(TARGET_D) $(TARGET_T) $(TARGET_TD) $(TARGET_S) $(TARGET_SD)
$(TARGDIR):
mkdir $(TARGDIR)
......@@ -64,22 +64,22 @@ $(patsubst %,$(SRCDIR)/%,$(SRCS)): $(patsubst %,$(SRCDIR)/%,$(HDRS)) $(patsubst
touch $@
$(TARGDIR)/%.o : $(SRCDIR)/%.cpp
$(CXX) -c $(CFLAGS) $(FLAGS) $(patsubst %,-I%,$(INCLUDES) $(SRCDIR)) $< -o $@
$(CXX) -c -dynamic $(CFLAGS) $(FLAGS) $(patsubst %,-I%,$(INCLUDES) $(SRCDIR)) $< -o $@
$(TARGDIR)/%.do : $(SRCDIR)/%.cpp
$(CXX) -c $(CFLAGS_D) $(FLAGS) $(patsubst %,-I%,$(INCLUDES) $(SRCDIR)) $< -o $@
$(CXX) -c -dynamic $(CFLAGS_D) $(FLAGS) $(patsubst %,-I%,$(INCLUDES) $(SRCDIR)) $< -o $@
$(TARGDIR)/%.to : $(SRCDIR)/%.cpp
$(CXX) -c $(CFLAGS) $(CFLAGS_T) $(FLAGS) $(patsubst %,-I%,$(INCLUDES) $(SRCDIR)) $< -o $@
$(CXX) -c -dynamic $(CFLAGS) $(CFLAGS_T) $(FLAGS) $(patsubst %,-I%,$(INCLUDES) $(SRCDIR)) $< -o $@
$(TARGDIR)/%.tdo : $(SRCDIR)/%.cpp
$(CXX) -c $(CFLAGS_D) $(CFLAGS_T) $(FLAGS) $(patsubst %,-I%,$(INCLUDES) $(SRCDIR)) $< -o $@
$(CXX) -c -dynamic $(CFLAGS_D) $(CFLAGS_T) $(FLAGS) $(patsubst %,-I%,$(INCLUDES) $(SRCDIR)) $< -o $@
$(TARGDIR)/%.so : $(SRCDIR)/%.cpp
$(CXX) -c -dynamic $(CFLAGS) $(CFLAGS_T) $(FLAGS) $(patsubst %,-I%,$(INCLUDES) $(SRCDIR)) $< -o $@
$(CXX) -c -dynamic $(CFLAGS) $(CFLAGS_T) $(FLAGS) -DFLEXT_SHARED $(patsubst %,-I%,$(INCLUDES) $(SRCDIR)) $< -o $@
$(TARGDIR)/%.sdo : $(SRCDIR)/%.cpp
$(CXX) -c -dyanmic $(CFLAGS_D) $(CFLAGS_T) $(FLAGS) $(patsubst %,-I%,$(INCLUDES) $(SRCDIR)) $< -o $@
$(CXX) -c -dynamic $(CFLAGS_D) $(CFLAGS_T) $(FLAGS) -DFLEXT_SHARED $(patsubst %,-I%,$(INCLUDES) $(SRCDIR)) $< -o $@
$(TARGET) : $(patsubst %.cpp,$(TARGDIR)/%.o,$(SRCS))
libtool -static -o $@ $^
......@@ -94,10 +94,10 @@ $(TARGET_TD) : $(patsubst %.cpp,$(TARGDIR)/%.tdo,$(SRCS))
libtool -static -o $@ $^
$(TARGET_S) : $(patsubst %.cpp,$(TARGDIR)/%.so,$(SRCS))
libtool -dynamic -flat_namespace -undefined suppress -o $@ $^
ld -dylib -dynamic -flat_namespace -undefined suppress -lgcc -lstdc++ -ldylib1.o -o $@ $^
$(TARGET_SD) : $(patsubst %.cpp,$(TARGDIR)/%.sdo,$(SRCS))
libtool -dynamic -flat_namespace -undefined suppress -o $@ $^
ld -dylib -dynamic -flat_namespace -undefined suppress -lgcc -lstdc++ -ldylib1.o -o $@ $^
.PHONY: clean install
......@@ -111,8 +111,9 @@ $(INSTDIR):
install:: $(INSTDIR)
endif
install:: $(TARGET) $(TARGET_D) $(TARGET_T) $(TARGET_TD) $(patsubst %,$(SRCDIR)/%,$(HDRS)) # $(TARGET_S) $(TARGET_SD)
install:: $(TARGET) $(TARGET_D) $(TARGET_T) $(TARGET_TD) $(TARGET_S) $(TARGET_SD) $(patsubst %,$(SRCDIR)/%,$(HDRS))
cp $^ $(INSTDIR)
mv $(INSTDIR)/lib*.dylib /usr/local/lib
ranlib $(INSTDIR)/*.a # have to rerun ranlib at install dir ?!
# chmod 755 $(patsubst %,$(INSTDIR)/%,$(notdir $^))
# chgrp admin $(patsubst %,$(INSTDIR)/%,$(notdir $^))
......
......@@ -99,6 +99,11 @@ bool flext_base::BindMethod(const t_symbol *sym,bool (*fun)(flext_base *,t_symbo
post("%s - Symbol already bound",thisName());
return false;
}
if(bindhead->Count() > 20) {
// Hash it!
bindhead->Finalize();
}
}
SetupBindProxy();
......@@ -152,7 +157,7 @@ bool flext_base::UnbindMethod(const t_symbol *sym,bool (*fun)(flext_base *,t_sym
if(!sz) sz = 1;
for(int i = 0; i < sz; ++i) {
for(it = (binditem *)bindhead->Item(0); it; it = (binditem *)it->nxt) {
for(it = (binditem *)bindhead->Item(i); it; it = (binditem *)it->nxt) {
if(it->tag == sym && (!fun || it->fun == fun)) break;
}
if(it) break;
......@@ -167,6 +172,26 @@ bool flext_base::UnbindMethod(const t_symbol *sym,bool (*fun)(flext_base *,t_sym
return ok;
}
bool flext_base::UnbindAll()
{
// bool memleak = false;
int sz = bindhead->Size();
if(!sz) sz = 1;
for(int i = 0; i < sz; ++i) {
for(binditem *it = (binditem *)bindhead->Item(i); it; it = (binditem *)it->nxt) {
// if(it->px->data) memleak = true;
if(bindhead->Remove(it)) delete it;
}
}
/*
if(memleak)
post("%s - Memory was not deallocated while unbinding methods",thisName());
*/
return true;
}
void flext_base::pxbnd_object::px_method(pxbnd_object *c,const t_symbol *s,int argc,t_atom *argv)
{
c->item->fun(c->base,(t_symbol *)s,argc,(t_atom *)argv,c->data);
......
......@@ -437,6 +437,11 @@ public:
//! \brief Unbind a method from a symbol (as string)
bool UnbindMethod(const char *sym,bool (*meth)(flext_base *obj,t_symbol *sym,int argc,t_atom *argv,void *data) = NULL,void **data = NULL) { return UnbindMethod(MakeSymbol(sym),meth,data); }
/*! Unbind all symbol bindings
\note Memory associated to data pointers passed by BindMethod will not be freed!
*/
bool UnbindAll();
//! @} FLEXT_C_BIND
// --- thread stuff -----------------------------------------------
......
......@@ -16,7 +16,7 @@ Currently there exist two widely used modular systems for real-time audio that c
extended by self-written objects (so called "externals"):<br>
Max/MSP (http://www.cycling74.com) and Pure Data (http://www.pure-data.org).
Both come with APIs that are not very different (as they share their origins), but as well not quite the same.
Both come with APIs that are not very different (as they share their origin), but as well not quite the same.
Flext seeks to provide a unifying interface for the APIs of those real-time systems while also
concentrating on making use of the advantages of the object orientation of the C++ language.
......@@ -35,12 +35,13 @@ The advantages of flext are:
<li>Libraries of externals in Max/MSP
<li>More than 3 typed creation arguments possible for Max/MSP
<li>Any input to any object's inlet (with the exception of signal streams)
<li>Control of the object state by use of Max/Jitter-like "attributes"
</ul>
Naturally there are some cons, too:
<ul>
<li>Introduces a small overhead to speed of message handling
<li>Overhead in object size (due to possibly unneeded library code)
<li>Overhead in object size (due to possibly unneeded library code) when statically linked
</ul>
Currently, flext supports
......@@ -71,7 +72,8 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
In the official flext distribution, the GNU General Public License is
in the file gpl.txt<BR> Also see the file license.txt for notes on
in the file gpl.txt<BR>
Also see the file license.txt for notes on
referenced works and their license texts.
\section DOWNLOAD Download
......
......@@ -79,7 +79,7 @@ flext_base::~flext_base()
// delete message lists
if(methhead) delete methhead;
if(bindhead) delete bindhead;
if(bindhead) delete bindhead; // ATTENTION: the object must free all memory associated to bindings itself
if(attrhead) delete attrhead;
// destroy inlets and outlets and their proxy objects
......
......@@ -446,16 +446,10 @@ void flext::MulSamples(t_sample *dst,const t_sample *src,t_sample mul,int cnt)
while(cnt--) *(dst++) = *(src++)*mul;
}
else
/*
#elif FLEXT_OS == FLEXT_OS_MAC && defined(__VEC__) && defined(__VECTOROPS__)
{
int n = cnt>>2,n4 = n<<2;
cnt -= n4;
vScopy(n4,src,dst);
src += n4,dst += n4;
while(cnt--) *(dst++) = *(src++);
vsmul(src,1,&mul,dst,1,cnt);
}
*/
#endif // _MSC_VER
#endif // FLEXT_USE_SIMD
{
......
......@@ -661,7 +661,7 @@ protected:
static bool StopHelper();
static void ThrHelper(void *);
//! system's thread id
//! the system's thread id
static thrid_t thrid; // the system thread
public:
......
No preview for this file type
No preview for this file type
No preview for this file type
......@@ -48,7 +48,7 @@ FLEXT_NEW("simple1",simple1)
simple1::simple1()
{
// define inlets:
// first inlet must always by of type anything (or signal for dsp objects)
// first inlet must always be of type anything (or signal for dsp objects)
AddInAnything(); // add one inlet for any message
// define outlets:
......
Markdown is supported
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