aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/flext/source/flqueue.cpp
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2004-12-17 05:01:18 +0000
committerThomas Grill <xovo@users.sourceforge.net>2004-12-17 05:01:18 +0000
commitf688c9de1efee2e09fbb9b39a715853b23fadcb3 (patch)
tree406b8c29f9957621fa82bfe7415a33bc0c8240ab /externals/grill/flext/source/flqueue.cpp
parent1be9429281d7eb7a0cae509b23ed4482768a68f1 (diff)
global system lock functions
fixed a thread sensitive spot fix for _long_ attribute dialogs build system for flext-based externals typo fixed in attribute editor atom outlet functions svn path=/trunk/; revision=2394
Diffstat (limited to 'externals/grill/flext/source/flqueue.cpp')
-rwxr-xr-xexternals/grill/flext/source/flqueue.cpp41
1 files changed, 38 insertions, 3 deletions
diff --git a/externals/grill/flext/source/flqueue.cpp b/externals/grill/flext/source/flqueue.cpp
index 41b201d7..9277887b 100755
--- a/externals/grill/flext/source/flqueue.cpp
+++ b/externals/grill/flext/source/flqueue.cpp
@@ -32,7 +32,11 @@ flext::thrid_t flext::thrmsgid = 0;
class qmsg
{
public:
- void Set(flext_base *t,int o,const t_symbol *s,int ac,const t_atom *av) { th = t,out = o,sym = s,argc = ac,argv = av; }
+ void Set(flext_base *t,int o,const t_symbol *s,int ac,const t_atom *av)
+ {
+ th = t; out = o;
+ sym = s,argc = ac,argv = av;
+ }
// \note PD sys lock must already be held by caller
void Send() const
@@ -98,10 +102,11 @@ public:
{
t_atom *at = GetAtoms(1);
SetInt(*at,dt);
+ const t_symbol *sym;
#if FLEXT_SYS == FLEXT_SYS_PD
- const t_symbol *sym = sym_float;
+ sym = sym_float;
#elif FLEXT_SYS == FLEXT_SYS_MAX
- const t_symbol *sym = sym_int;
+ sym = sym_int;
#else
#error Not implemented!
#endif
@@ -115,6 +120,30 @@ public:
Set(th,o,sym_symbol,1,at);
}
+ void Push(flext_base *th,int o,const t_atom &a)
+ {
+ t_atom *at = GetAtoms(1);
+ *at = a;
+ const t_symbol *sym;
+ if(IsSymbol(a))
+ sym = sym_symbol;
+ else if(IsFloat(a))
+ sym = sym_float;
+#if FLEXT_SYS == FLEXT_SYS_MAX
+ else if(IsInt(a))
+ sym = sym_int;
+#endif
+#if FLEXT_SYS == FLEXT_SYS_PD
+ else if(IsPointer(a))
+ sym = sym_pointer;
+#endif
+ else {
+ error("atom type not supported");
+ return;
+ }
+ Set(th,o,sym,1,at);
+ }
+
void Push(flext_base *th,int o,int argc,const t_atom *argv)
{
t_atom *at = GetAtoms(argc);
@@ -312,6 +341,12 @@ void flext_base::ToQueueSymbol(int o,const t_symbol *s) const
Trigger();
}
+void flext_base::ToQueueAtom(int o,const t_atom &at) const
+{
+ queue.Push(const_cast<flext_base *>(this),o,at);
+ Trigger();
+}
+
void flext_base::ToQueueList(int o,int argc,const t_atom *argv) const
{
queue.Push(const_cast<flext_base *>(this),o,argc,argv);