diff options
author | David Robillard <d@drobilla.net> | 2008-08-17 03:10:58 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-08-17 03:10:58 +0000 |
commit | cc1d61ad8ab6712e819545cd225896143f9fe8c4 (patch) | |
tree | a5d846d4a67f1c7d86863b56661c4fe661fcaf9e /raul/AtomLiblo.hpp | |
parent | afe4ba241fbd9163e4fbf3156d10895f369cc903 (diff) | |
download | raul-cc1d61ad8ab6712e819545cd225896143f9fe8c4.tar.gz raul-cc1d61ad8ab6712e819545cd225896143f9fe8c4.tar.bz2 raul-cc1d61ad8ab6712e819545cd225896143f9fe8c4.zip |
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
Diffstat (limited to 'raul/AtomLiblo.hpp')
-rw-r--r-- | raul/AtomLiblo.hpp | 16 |
1 files changed, 13 insertions, 3 deletions
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 <iostream> #include <lo/lo.h> #include <raul/Atom.hpp> @@ -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<void*>(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(); } } |