aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/flext/source/flext.cpp
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2005-09-26 13:59:34 +0000
committerThomas Grill <xovo@users.sourceforge.net>2005-09-26 13:59:34 +0000
commit0f849641afd27b4e7c9326fbcd402105fd62ced0 (patch)
tree6f825a8f7a0e0520797f788a6be4f1274d4225d1 /externals/grill/flext/source/flext.cpp
parent2b91966061ead3c4aa260033e95cfc4adb396496 (diff)
- better handling of click callback
bugfixes and optimizations, especially for DSP under Max/MSP - more compatible handling of attributes in patcher (hiding is now an option - define FLEXT_ATTRHIDE) svn path=/trunk/; revision=3636
Diffstat (limited to 'externals/grill/flext/source/flext.cpp')
-rw-r--r--externals/grill/flext/source/flext.cpp63
1 files changed, 32 insertions, 31 deletions
diff --git a/externals/grill/flext/source/flext.cpp b/externals/grill/flext/source/flext.cpp
index 70184bef..4d62633e 100644
--- a/externals/grill/flext/source/flext.cpp
+++ b/externals/grill/flext/source/flext.cpp
@@ -48,19 +48,42 @@ flext_base::FLEXT_CLASSDEF(flext_base)()
}
}
-flext_base::~FLEXT_CLASSDEF(flext_base)()
+/*! This virtual function is called after the object has been created, that is,
+ after the constructor has been processed.
+ It creates the inlets and outlets and the message and attribute lists.
+ \note You can override it in your own class, but be sure to call it,
+ \note otherwise no inlets/outlets will be created
+ \note All inlet, outlets, method and attribute declarations must be made before a call to Init!
+ \remark Creation of inlets/outlets can't be done upon declaration, as Max/MSP needs creation
+ \remark in reverse.
+*/
+bool flext_base::Init()
+{
+ bool ok = flext_obj::Init();
+
+ if(ok) ok = InitInlets() && InitOutlets();
+
+ if(ok) {
+ if(HasAttributes() && m_holdaargc && m_holdaargv) {
+ // initialize creation attributes
+ ok = InitAttrib(m_holdaargc,m_holdaargv);
+ }
+ }
+
+ return ok;
+}
+
+
+/*! This virtual function is called before the destructor.
+ We do this because here we can still call virtual methods.
+*/
+void flext_base::Exit()
{
#if FLEXT_SYS == FLEXT_SYS_PD && !defined(FLEXT_NOATTREDIT)
// attribute editor window may still be open -> close it
gfxstub_deleteforkey(thisHdr());
#endif
-#if FLEXT_SYS == FLEXT_SYS_MAX
- // according to David Z. one should do that first...
- if(insigs) dsp_free(thisHdr());
-// if(insigs) dsp_freebox(thisHdr());
-#endif
-
#ifdef FLEXT_THREADS
StopThreads();
#endif
@@ -101,33 +124,11 @@ flext_base::~FLEXT_CLASSDEF(flext_base)()
delete[] outdesc;
}
#endif
-}
-/*! This virtual function is called after the object has been created, that is,
- after the constructor has been processed.
- It creates the inlets and outlets and the message and attribute lists.
- \note You can override it in your own class, but be sure to call it,
- \note otherwise no inlets/outlets will be created
- \note All inlet, outlets, method and attribute declarations must be made before a call to Init!
- \remark Creation of inlets/outlets can't be done upon declaration, as Max/MSP needs creation
- \remark in reverse.
-*/
-bool flext_base::Init()
-{
- bool ok = flext_obj::Init();
-
- if(ok) ok = InitInlets() && InitOutlets();
-
- if(ok) {
- if(HasAttributes() && m_holdaargc && m_holdaargv) {
- // initialize creation attributes
- ok = InitAttrib(m_holdaargc,m_holdaargv);
- }
- }
-
- return ok;
+ flext_obj::Exit();
}
+
/*! Set up proxy classes and basic methods at class creation time
This ensures that they are processed before the registered flext messages
*/