aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2004-12-31 04:58:29 +0000
committerThomas Grill <xovo@users.sourceforge.net>2004-12-31 04:58:29 +0000
commit7873938d18daf4a94ca77eeb970457f89e679374 (patch)
tree8de0488af4f068ad7aa37f1ffc08482e04efb258
parent889c04fdf4fa9239c7442ed3b381ad5d004782f1 (diff)
fix for showing attributes on select (and recreate the object on edit)
reconsidered flext::buffer:Update build system for flext-based externals added object construction and destruction flags svn path=/trunk/; revision=2438
-rw-r--r--externals/grill/flext/buildsys/config-mac-max-gcc.txt16
-rw-r--r--externals/grill/flext/buildsys/config-mac-pd-gcc.txt18
-rw-r--r--externals/grill/flext/changes.txt2
-rw-r--r--externals/grill/flext/flext.vcproj4
-rw-r--r--externals/grill/flext/source/flbase.cpp11
-rw-r--r--externals/grill/flext/source/flbase.h11
-rw-r--r--externals/grill/flext/source/flbuf.cpp8
-rwxr-xr-xexternals/grill/flext/source/fllib.cpp11
8 files changed, 38 insertions, 43 deletions
diff --git a/externals/grill/flext/buildsys/config-mac-max-gcc.txt b/externals/grill/flext/buildsys/config-mac-max-gcc.txt
deleted file mode 100644
index b10869b2..00000000
--- a/externals/grill/flext/buildsys/config-mac-max-gcc.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-# where are the Max/MSP SDK header files?
-# you should have the latest version!
-MAXSDKPATH=/Volumes/Daten/Prog/MaxMSP-SDK/4.5\ headers/c74support
-
-# where should the external be installed?
-INSTPATH=/Library/Application\ Support/Cycling\ \'74/externals
-
-# where do the flext headers and libraries reside?
-FLEXTPATH=/Library/Application\ Support/Cycling\ \'74/flext
-
-# where should the external be built?
-OUTPATH=max-darwin
-
-# user defined compiler flags
-# (check if they match your system!)
-OFLAGS=-O2 -mcpu=G4 -malign-natural -maltivec -faltivec
diff --git a/externals/grill/flext/buildsys/config-mac-pd-gcc.txt b/externals/grill/flext/buildsys/config-mac-pd-gcc.txt
deleted file mode 100644
index e15b67a6..00000000
--- a/externals/grill/flext/buildsys/config-mac-pd-gcc.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-# where is the PD installation including source code?
-PDPATH=/Applications/Pd-0.38-0test10.app/Contents/Resources
-
-# where is the PD executable?
-PDBIN=$(PDPATH)/bin/pd
-
-# where should the external be installed?
-INSTPATH=$(PDPATH)/extra
-
-# where do the flext headers and libraries reside?
-FLEXTPATH=$(PDPATH)/flext
-
-# where should the external be built?
-OUTPATH=pd-darwin
-
-# user defined compiler flags
-# (check if they match your system!)
-OFLAGS=-O2 -mcpu=G4 -malign-natural -maltivec -faltivec
diff --git a/externals/grill/flext/changes.txt b/externals/grill/flext/changes.txt
index e073de04..7d91724d 100644
--- a/externals/grill/flext/changes.txt
+++ b/externals/grill/flext/changes.txt
@@ -24,6 +24,8 @@ Version history:
- added global system locking
- added general atom outlet functions To{Sys,Out,Queue}Atom
- added build system for flext-based externals
+- flags for object construction and destruction phase (Initing() and Exiting())
+- reconsidered flext::buffer::Update
0.4.7:
- added flext::GetBool (just because flext::GetInt has been there for a while)
diff --git a/externals/grill/flext/flext.vcproj b/externals/grill/flext/flext.vcproj
index 1d026be6..4854e348 100644
--- a/externals/grill/flext/flext.vcproj
+++ b/externals/grill/flext/flext.vcproj
@@ -273,7 +273,7 @@
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="c:\programme\audio\pd\src,f:\prog\audio\sndobj\include,f:\prog\audio\stk\include"
+ AdditionalIncludeDirectories="c:\programme\audio\pd\src;c:\data\prog\audio\sndobj\include;c:\data\prog\audio\stk\include"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;FLEXT_SYS=2;FLEXT_USE_SIMD"
StringPooling="TRUE"
RuntimeLibrary="0"
@@ -646,7 +646,7 @@ copy F:\prog\max\flext\max-msvc\flext.max.dll f:\prog\dll
AdditionalIncludeDirectories="&quot;C:\data\prog\audio\maxmspsdk_win\4.5 headers\c74support\max-includes&quot;;&quot;C:\data\prog\audio\maxmspsdk_win\4.5 headers\c74support\msp-includes&quot;;f:\prog\packs\pthreads;f:\prog\audio\sndobj\include;f:\prog\audio\stk\include"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;FLEXT_SYS_MAX;FLEXT_USE_SIMD;FLEXT_EXPORTS"
StringPooling="TRUE"
- RuntimeLibrary="1"
+ RuntimeLibrary="0"
StructMemberAlignment="2"
EnableEnhancedInstructionSet="1"
RuntimeTypeInfo="TRUE"
diff --git a/externals/grill/flext/source/flbase.cpp b/externals/grill/flext/source/flbase.cpp
index 032f869d..fd666632 100644
--- a/externals/grill/flext/source/flbase.cpp
+++ b/externals/grill/flext/source/flbase.cpp
@@ -44,6 +44,9 @@ int flext_obj::m_holdaargc = 0;
const t_atom *flext_obj::m_holdaargv = NULL;
bool flext_obj::process_attributes = false;
+bool flext_obj::initing = false;
+bool flext_obj::exiting = false;
+
void flext_obj::ProcessAttributes(bool attr) { process_attributes = attr; }
/////////////////////////////////////////////////////////
@@ -51,10 +54,10 @@ void flext_obj::ProcessAttributes(bool attr) { process_attributes = attr; }
//
/////////////////////////////////////////////////////////
flext_obj :: FLEXT_CLASSDEF(flext_obj)()
- : x_obj(m_holder)
- , procattr(m_holdattr)
- , init_ok(true)
- , m_name(m_holdname)
+ : x_obj(m_holder)
+ , procattr(m_holdattr)
+ , init_ok(true)
+ , m_name(m_holdname)
{
#if FLEXT_SYS == FLEXT_SYS_PD
m_canvas = canvas_getcurrent();
diff --git a/externals/grill/flext/source/flbase.h b/externals/grill/flext/source/flbase.h
index a9a9d8e5..47db0618 100644
--- a/externals/grill/flext/source/flbase.h
+++ b/externals/grill/flext/source/flbase.h
@@ -219,6 +219,9 @@ class FLEXT_SHARE FLEXT_CLASSDEF(flext_obj):
//! Flag for successful object construction
bool init_ok;
+ // flags for init and exit procedure;
+ static bool initing,exiting;
+
public:
//! Creation callback
@@ -242,6 +245,14 @@ class FLEXT_SHARE FLEXT_CLASSDEF(flext_obj):
//! Check whether construction was successful
bool InitOk() const { return init_ok; }
+ /*! Return true if in object initialization phase
+ true when in constructor or Init, false when in Finalize
+ */
+ static bool Initing() { return initing; }
+
+ //! Return true if in object destruction phase (Exit or destructor)
+ static bool Exiting() { return exiting; }
+
// Definitions for library objects
static void lib_init(const char *name,void setupfun(),bool attr);
static void obj_add(bool lib,bool dsp,bool attr,const char *idname,const char *names,void setupfun(t_classid),FLEXT_CLASSDEF(flext_obj) *(*newfun)(int,t_atom *),void (*freefun)(flext_hdr *),int argtp1,...);
diff --git a/externals/grill/flext/source/flbuf.cpp b/externals/grill/flext/source/flbuf.cpp
index 4dc0b6e8..649e1b8d 100644
--- a/externals/grill/flext/source/flbuf.cpp
+++ b/externals/grill/flext/source/flbuf.cpp
@@ -81,7 +81,7 @@ int flext::buffer::Set(const t_symbol *s,bool nameonly)
if(!arr)
{
if (*GetString(sym)) FLEXT_LOG1("buffer: no such array '%s'",GetString(sym));
- sym = NULL;
+// sym = NULL;
if(valid) ret = -1;
}
else if(!garray_getfloatarray(arr, &frames1, &data1))
@@ -147,11 +147,13 @@ bool flext::buffer::Valid() const
bool flext::buffer::Update()
{
- if(!Ok()) return false;
+// if(!Ok()) return false;
bool ok = false;
#if FLEXT_SYS == FLEXT_SYS_PD
+ if(!sym || !arr) return data == NULL;
+
int frames1;
t_sample *data1;
if(!garray_getfloatarray(arr, &frames1, &data1)) {
@@ -166,6 +168,8 @@ bool flext::buffer::Update()
ok = true;
}
#elif FLEXT_SYS == FLEXT_SYS_MAX
+ if(!sym) return data == NULL;
+
if(sym->s_thing) {
const _buffer *p = (const _buffer *)sym->s_thing;
if(data != p->b_samples || chns != p->b_nchans || frames != p->b_frames) {
diff --git a/externals/grill/flext/source/fllib.cpp b/externals/grill/flext/source/fllib.cpp
index 509ba2c2..2132ddf2 100755
--- a/externals/grill/flext/source/fllib.cpp
+++ b/externals/grill/flext/source/fllib.cpp
@@ -413,6 +413,7 @@ flext_hdr *flext_obj::obj_new(const t_symbol *s,int _argc_,t_atom *argv)
flext_obj::m_holder = obj;
flext_obj::m_holdname = s;
flext_obj::m_holdattr = lo->attr;
+ flext_obj::initing = true;
// get actual flext object (newfun calls "new flext_obj()")
if(lo->argc >= 0)
@@ -446,6 +447,8 @@ flext_hdr *flext_obj::obj_new(const t_symbol *s,int _argc_,t_atom *argv)
// here, inlets, outlets, methods and attributes can be set up
ok = obj->data->Init();
+ flext_obj::initing = false;
+
// call another virtual init function
if(ok) ok = obj->data->Finalize();
@@ -467,6 +470,8 @@ flext_hdr *flext_obj::obj_new(const t_symbol *s,int _argc_,t_atom *argv)
ok = false;
}
+ flext_obj::initing = false;
+
if(!ok) {
// there was some init error, free object
lo->freefun(obj);
@@ -500,6 +505,8 @@ void flext_obj::obj_free(flext_hdr *h)
if(lcl) {
try {
+ flext_obj::exiting = true;
+
// call virtual exit function
hdr->data->Exit();
@@ -515,7 +522,9 @@ void flext_obj::obj_free(flext_hdr *h)
catch(...) {
error("%s - Unknown exception while destroying object",GetString(name));
}
- }
+
+ flext_obj::exiting = false;
+ }
#ifdef FLEXT_DEBUG
else
#if FLEXT_SYS == FLEXT_SYS_MAX