From cc1d61ad8ab6712e819545cd225896143f9fe8c4 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 17 Aug 2008 03:10:58 +0000 Subject: There! Loader uses only CommonInterface and is now able to parse into a client or engine. Proper OSC serialisation of boolean atoms. Remove patch_enabled and patch_disabled calls/signals/etc in favour of new generic "property" mechanism (courtesy of which much more killed API is to come). git-svn-id: http://svn.drobilla.net/lad/raul@1410 a436a847-0d15-0410-975c-d299462d15a1 --- raul/AtomLiblo.hpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'raul/AtomLiblo.hpp') diff --git a/raul/AtomLiblo.hpp b/raul/AtomLiblo.hpp index 682026a..ffe98ec 100644 --- a/raul/AtomLiblo.hpp +++ b/raul/AtomLiblo.hpp @@ -18,6 +18,7 @@ #ifndef RAUL_ATOM_LIBLO_HPP #define RAUL_ATOM_LIBLO_HPP +#include #include #include @@ -43,6 +44,12 @@ lo_message_add_atom(lo_message m, const Atom& atom) case Atom::STRING: lo_message_add_string(m, atom.get_string()); break; + case Atom::BOOL: + if (atom.get_bool()) + lo_message_add_true(m); + else + lo_message_add_false(m); + break; case Atom::BLOB: // FIXME: is this okay? what does liblo do? lo_message_add_blob(m, const_cast(atom.get_blob())); @@ -66,10 +73,13 @@ lo_arg_to_atom(char type, lo_arg* arg) return Atom(arg->f); case 's': return Atom(&arg->s); - //case 'b' - // FIXME: How to get a blob from a lo_arg? - //return Atom(arg->b); + case 'T': + return Atom((bool)true); + case 'F': + return Atom((bool)false); default: + std::cerr << "WARNING: Unable to convert OSC type '" + << type << "' to Atom" << std::endl; return Atom(); } } -- cgit v1.2.1