aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/flext/source/flsupport.h
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2005-01-06 04:59:21 +0000
committerThomas Grill <xovo@users.sourceforge.net>2005-01-06 04:59:21 +0000
commited4ce25dc69fd6361f7655a3ab5d05186754316c (patch)
tree39f14a7ccb5116b0368a921944469f747e95c1d0 /externals/grill/flext/source/flsupport.h
parentaeb9247272c2772c491df8f682aebf0097c98519 (diff)
build system for flext-based externals
reconsidered flext::buffer:Update improved buffer handling added object construction and destruction flags updated autoconf system updated documentation updated build system svn path=/trunk/; revision=2467
Diffstat (limited to 'externals/grill/flext/source/flsupport.h')
-rw-r--r--externals/grill/flext/source/flsupport.h43
1 files changed, 39 insertions, 4 deletions
diff --git a/externals/grill/flext/source/flsupport.h b/externals/grill/flext/source/flsupport.h
index 31b64f2a..e7e284c4 100644
--- a/externals/grill/flext/source/flsupport.h
+++ b/externals/grill/flext/source/flsupport.h
@@ -148,6 +148,15 @@ public:
public flext_root
{
public:
+
+#if FLEXT_SYS == FLEXT_SYS_PD
+ typedef bool lock_t;
+#elif FLEXT_SYS == FLEXT_SYS_MAX
+ typedef long lock_t;
+#else
+#error Not implemented
+#endif
+
/*! \brief Construct buffer.
\param s: symbol name, can be NULL
\param delayed = true: only sets name, needs another Set(NULL) to really initialize the buffer
@@ -158,17 +167,43 @@ public:
//! Destroy buffer
~buffer();
- /*! \brief Check if the data is valid
+ /*! \brief Check if the buffer is valid for use
+ \note This must be true to use any of the other functions except set
*/
- bool Ok() const { return sym != NULL && data != NULL; }
+ bool Ok() const { return sym && data; }
- /*! \brief Check if buffer is valid
+ /*! \brief Check if buffer content is valid (not in state of content change)
+ \note buffer must be Ok()
*/
- bool Valid() const;
+ bool Valid() const
+ {
+ FLEXT_ASSERT(sym);
+#if FLEXT_SYS == FLEXT_SYS_PD
+ return true;
+#elif FLEXT_SYS == FLEXT_SYS_MAX
+ const t_buffer *p = (const t_buffer *)sym->s_thing;
+ return p && p->b_valid;
+#else
+#error not implemented
+#endif
+ }
/*! \brief Check and update if the buffer has been changed (e.g. resized)
+ \note buffer must be Ok()
*/
bool Update();
+
+ /*! \brief Lock buffer
+ \return previous state (needed for Unlock)
+ \note buffer must be Ok()
+ */
+ lock_t Lock();
+
+ /*! \brief Unlock buffer
+ \param prv: Previous state is returned by Lock()
+ \note buffer must be Ok()
+ */
+ void Unlock(lock_t prv);
/*! \brief Set to specified buffer.
\param nameonly: if true sets name only, but doesn't look at buffer actually