diff options
90 files changed, 402 insertions, 372 deletions
diff --git a/ingen/AtomReader.hpp b/ingen/AtomReader.hpp index 8a821194..1cf55bb5 100644 --- a/ingen/AtomReader.hpp +++ b/ingen/AtomReader.hpp @@ -49,7 +49,7 @@ public: bool write(const LV2_Atom* msg); private: - void get_atom(const LV2_Atom* in, Raul::Atom& out); + void get_atom(const LV2_Atom* in, Atom& out); const char* atom_to_uri(const LV2_Atom* atom); boost::optional<Raul::Path> atom_to_path(const LV2_Atom* atom); diff --git a/ingen/AtomWriter.hpp b/ingen/AtomWriter.hpp index 3dab20ec..4b5555b1 100644 --- a/ingen/AtomWriter.hpp +++ b/ingen/AtomWriter.hpp @@ -66,9 +66,9 @@ public: void disconnect_all(const Raul::Path& graph, const Raul::Path& path); - void set_property(const Raul::URI& subject, - const Raul::URI& predicate, - const Raul::Atom& value); + void set_property(const Raul::URI& subject, + const Raul::URI& predicate, + const Atom& value); void set_response_id(int32_t id); diff --git a/ingen/ClashAvoider.hpp b/ingen/ClashAvoider.hpp index ac3f7e07..60affa2a 100644 --- a/ingen/ClashAvoider.hpp +++ b/ingen/ClashAvoider.hpp @@ -74,9 +74,9 @@ public: virtual void disconnect_all(const Raul::Path& graph, const Raul::Path& path); - virtual void set_property(const Raul::URI& subject_path, - const Raul::URI& predicate, - const Raul::Atom& value); + virtual void set_property(const Raul::URI& subject_path, + const Raul::URI& predicate, + const Atom& value); virtual void del(const Raul::URI& uri); diff --git a/ingen/Configuration.hpp b/ingen/Configuration.hpp index 6002a178..ffa9723e 100644 --- a/ingen/Configuration.hpp +++ b/ingen/Configuration.hpp @@ -25,10 +25,9 @@ #include <map> #include <string> +#include "ingen/Atom.hpp" #include "ingen/Forge.hpp" #include "ingen/URIMap.hpp" - -#include "raul/Atom.hpp" #include "raul/Exception.hpp" namespace Ingen { @@ -60,13 +59,13 @@ public: * @param type Type * @param value Default value */ - Configuration& add(const std::string& key, - const std::string& name, - char letter, - const std::string& desc, - Scope scope, - const Raul::Atom::TypeID type, - const Raul::Atom& value); + Configuration& add(const std::string& key, + const std::string& name, + char letter, + const std::string& desc, + Scope scope, + const LV2_URID type, + const Atom& value); void print_usage(const std::string& program, std::ostream& os); @@ -108,8 +107,8 @@ public: std::list<std::string> load_default(const std::string& app, const std::string& filename); - const Raul::Atom& option(const std::string& long_name) const; - bool set(const std::string& long_name, const Raul::Atom& value); + const Atom& option(const std::string& long_name) const; + bool set(const std::string& long_name, const Atom& value); const std::list<std::string>& files() const { return _files; } @@ -118,19 +117,19 @@ private: public: Option(const std::string& k, const std::string& n, char l, const std::string& d, Scope s, - const Raul::Atom::TypeID type, const Raul::Atom& def) + const LV2_URID type, const Atom& def) : key(k), name(n), letter(l) , desc(d), scope(s) , type(type), value(def) {} - std::string key; - std::string name; - char letter; - std::string desc; - Scope scope; - Raul::Atom::TypeID type; - Raul::Atom value; + std::string key; + std::string name; + char letter; + std::string desc; + Scope scope; + LV2_URID type; + Atom value; }; struct OptionNameOrder { diff --git a/ingen/Forge.hpp b/ingen/Forge.hpp index e92a9501..de32b3e8 100644 --- a/ingen/Forge.hpp +++ b/ingen/Forge.hpp @@ -1,6 +1,6 @@ /* This file is part of Ingen. - Copyright 2007-2012 David Robillard <http://drobilla.net/> + Copyright 2007-2013 David Robillard <http://drobilla.net/> Ingen is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free @@ -19,20 +19,53 @@ #include <string> -#include "raul/Atom.hpp" +#include "ingen/Atom.hpp" +#include "lv2/lv2plug.in/ns/ext/atom/forge.h" namespace Ingen { class URIMap; -/** Forge for Raul Atoms. +/** Forge for Atoms. * @ingroup IngenShared */ -class Forge : public Raul::Forge { +class Forge : public LV2_Atom_Forge { public: explicit Forge(URIMap& map); - std::string str(const Raul::Atom& atom); + std::string str(const Atom& atom); + + Atom make() { return Atom(); } + Atom make(int32_t v) { return Atom(sizeof(v), Int, &v); } + Atom make(float v) { return Atom(sizeof(v), Float, &v); } + Atom make(bool v) { + const int32_t iv = v ? 1 : 0; + return Atom(sizeof(int32_t), Bool, &iv); + } + + Atom make_urid(int32_t v) { return Atom(sizeof(int32_t), URID, &v); } + + Atom alloc(uint32_t size, uint32_t type, const void* val) { + return Atom(size, type, val); + } + + Atom alloc(const char* v) { + const size_t len = strlen(v); + return Atom(len + 1, String, v); + } + + Atom alloc(const std::string& v) { + return Atom(v.length() + 1, String, v.c_str()); + } + + Atom alloc_uri(const char* v) { + const size_t len = strlen(v); + return Atom(len + 1, URI, v); + } + + Atom alloc_uri(const std::string& v) { + return Atom(v.length() + 1, URI, v.c_str()); + } private: URIMap& _map; diff --git a/ingen/Interface.hpp b/ingen/Interface.hpp index 023221bd..0fc90d42 100644 --- a/ingen/Interface.hpp +++ b/ingen/Interface.hpp @@ -81,9 +81,9 @@ public: virtual void disconnect_all(const Raul::Path& graph, const Raul::Path& path) = 0; - virtual void set_property(const Raul::URI& subject, - const Raul::URI& predicate, - const Raul::Atom& value) = 0; + virtual void set_property(const Raul::URI& subject, + const Raul::URI& predicate, + const Atom& value) = 0; /** Set the ID to use to respond to the next message. * Setting the ID to -1 will disable responses. diff --git a/ingen/Resource.hpp b/ingen/Resource.hpp index e741a633..756419d8 100644 --- a/ingen/Resource.hpp +++ b/ingen/Resource.hpp @@ -20,8 +20,8 @@ #include <map> #include <string> +#include "ingen/Atom.hpp" #include "ingen/URIs.hpp" -#include "raul/Atom.hpp" #include "raul/Deletable.hpp" #include "raul/URI.hpp" @@ -70,10 +70,10 @@ public: } /** A property value (an Atom with a context). */ - class Property : public Raul::Atom { + class Property : public Atom { public: - Property(const Raul::Atom& atom, Graph ctx=Graph::DEFAULT) - : Raul::Atom(atom) + Property(const Atom& atom, Graph ctx=Graph::DEFAULT) + : Atom(atom) , _ctx(ctx) {} @@ -93,16 +93,16 @@ public: * This is only useful for properties with a single value. If the * requested property has several values, the first will be returned. */ - virtual const Raul::Atom& get_property(const Raul::URI& uri) const; + virtual const Atom& get_property(const Raul::URI& uri) const; /** Set (replace) a property value. * * This will first erase any properties with the given @p uri, so after * this call exactly one property with predicate @p uri will be set. */ - virtual const Raul::Atom& set_property( + virtual const Atom& set_property( const Raul::URI& uri, - const Raul::Atom& value, + const Atom& value, Graph ctx=Graph::DEFAULT); /** Add a property value. @@ -111,21 +111,21 @@ public: * predicate @p uri and values other than @p value exist, this will result * in multiple values for the property. */ - virtual void add_property(const Raul::URI& uri, - const Raul::Atom& value, - Graph ctx=Graph::DEFAULT); + virtual void add_property(const Raul::URI& uri, + const Atom& value, + Graph ctx = Graph::DEFAULT); /** Remove a property. * * If @p value is ingen:wildcard then any property with @p uri for a * predicate will be removed. */ - virtual void remove_property(const Raul::URI& uri, - const Raul::Atom& value); + virtual void remove_property(const Raul::URI& uri, + const Atom& value); /** Return true iff a property is set. */ - virtual bool has_property(const Raul::URI& uri, - const Raul::Atom& value) const; + virtual bool has_property(const Raul::URI& uri, + const Atom& value) const; /** Set (replace) several properties at once. * @@ -150,7 +150,7 @@ public: * This can be used by derived classes to implement special behaviour for * particular properties (e.g. ingen:value for ports). */ - virtual void on_property(const Raul::URI& uri, const Raul::Atom& value) {} + virtual void on_property(const Raul::URI& uri, const Atom& value) {} /** Get the ingen type from a set of Properties. * @@ -175,7 +175,7 @@ public: Properties& properties() { return _properties; } protected: - const Raul::Atom& set_property(const Raul::URI& uri, const Raul::Atom& value) const; + const Atom& set_property(const Raul::URI& uri, const Atom& value) const; URIs& _uris; diff --git a/ingen/URIs.hpp b/ingen/URIs.hpp index a09037e6..4cbe62a6 100644 --- a/ingen/URIs.hpp +++ b/ingen/URIs.hpp @@ -17,9 +17,9 @@ #ifndef INGEN_URIS_HPP #define INGEN_URIS_HPP +#include "ingen/Atom.hpp" #include "ingen/Forge.hpp" #include "lv2/lv2plug.in/ns/ext/urid/urid.h" -#include "raul/Atom.hpp" #include "raul/Noncopyable.hpp" #include "raul/URI.hpp" @@ -46,9 +46,9 @@ public: struct Quark : public Raul::URI { Quark(Ingen::Forge& forge, URIMap* map, const char* str); operator LV2_URID() const { return id; } - operator Raul::Atom() const { return atom; } + operator Atom() const { return atom; } uint32_t id; - Raul::Atom atom; + Atom atom; }; Ingen::Forge& forge; diff --git a/ingen/client/ClientStore.hpp b/ingen/client/ClientStore.hpp index e9c85ba9..f53217b4 100644 --- a/ingen/client/ClientStore.hpp +++ b/ingen/client/ClientStore.hpp @@ -84,9 +84,9 @@ public: void move(const Raul::Path& old_path, const Raul::Path& new_path); - void set_property(const Raul::URI& subject_path, - const Raul::URI& predicate, - const Raul::Atom& value); + void set_property(const Raul::URI& subject_path, + const Raul::URI& predicate, + const Atom& value); void connect(const Raul::Path& tail, const Raul::Path& head); diff --git a/ingen/client/ObjectModel.hpp b/ingen/client/ObjectModel.hpp index 52655949..66c3db7c 100644 --- a/ingen/client/ObjectModel.hpp +++ b/ingen/client/ObjectModel.hpp @@ -59,9 +59,9 @@ public: bool is_a(const Raul::URI& type) const; - const Raul::Atom& get_property(const Raul::URI& key) const; + const Atom& get_property(const Raul::URI& key) const; - void on_property(const Raul::URI& uri, const Raul::Atom& value); + void on_property(const Raul::URI& uri, const Atom& value); const Raul::Path& path() const { return _path; } const Raul::Symbol& symbol() const { return _symbol; } @@ -73,7 +73,7 @@ public: // Signals INGEN_SIGNAL(new_child, void, SPtr<ObjectModel>); INGEN_SIGNAL(removed_child, void, SPtr<ObjectModel>); - INGEN_SIGNAL(property, void, const Raul::URI&, const Raul::Atom&); + INGEN_SIGNAL(property, void, const Raul::URI&, const Atom&); INGEN_SIGNAL(destroyed, void); INGEN_SIGNAL(moved, void); diff --git a/ingen/client/PluginModel.hpp b/ingen/client/PluginModel.hpp index dea85651..7f409f02 100644 --- a/ingen/client/PluginModel.hpp +++ b/ingen/client/PluginModel.hpp @@ -55,7 +55,7 @@ public: Type type() const { return _type; } - virtual const Raul::Atom& get_property(const Raul::URI& key) const; + virtual const Atom& get_property(const Raul::URI& key) const; Raul::Symbol default_block_symbol() const; std::string human_name() const; @@ -91,7 +91,7 @@ public: // Signals INGEN_SIGNAL(changed, void); - INGEN_SIGNAL(property, void, const Raul::URI&, const Raul::Atom&); + INGEN_SIGNAL(property, void, const Raul::URI&, const Atom&); protected: friend class ClientStore; diff --git a/ingen/client/PortModel.hpp b/ingen/client/PortModel.hpp index 568975fc..84a5d0d8 100644 --- a/ingen/client/PortModel.hpp +++ b/ingen/client/PortModel.hpp @@ -45,11 +45,11 @@ public: bool supports(const Raul::URI& value_type) const; - inline uint32_t index() const { return _index; } - inline const Raul::Atom& value() const { return get_property(_uris.ingen_value); } - inline bool connected() const { return (_connections > 0); } - inline bool is_input() const { return (_direction == Direction::INPUT); } - inline bool is_output() const { return (_direction == Direction::OUTPUT); } + inline uint32_t index() const { return _index; } + inline const Atom& value() const { return get_property(_uris.ingen_value); } + inline bool connected() const { return (_connections > 0); } + inline bool is_input() const { return (_direction == Direction::INPUT); } + inline bool is_output() const { return (_direction == Direction::OUTPUT); } bool port_property(const Raul::URI& uri) const; @@ -65,12 +65,12 @@ public: inline bool operator==(const PortModel& pm) const { return (path() == pm.path()); } - void on_property(const Raul::URI& uri, const Raul::Atom& value); + void on_property(const Raul::URI& uri, const Atom& value); // Signals - INGEN_SIGNAL(value_changed, void, const Raul::Atom&); - INGEN_SIGNAL(voice_changed, void, uint32_t, const Raul::Atom&); - INGEN_SIGNAL(activity, void, const Raul::Atom&); + INGEN_SIGNAL(value_changed, void, const Atom&); + INGEN_SIGNAL(voice_changed, void, uint32_t, const Atom&); + INGEN_SIGNAL(activity, void, const Atom&); INGEN_SIGNAL(connection, void, SPtr<PortModel>); INGEN_SIGNAL(disconnection, void, SPtr<PortModel>); diff --git a/ingen/client/SigClientInterface.hpp b/ingen/client/SigClientInterface.hpp index 900a9923..2210d4f4 100644 --- a/ingen/client/SigClientInterface.hpp +++ b/ingen/client/SigClientInterface.hpp @@ -58,7 +58,7 @@ public: INGEN_SIGNAL(connection, void, Raul::Path, Raul::Path) INGEN_SIGNAL(disconnection, void, Raul::Path, Raul::Path) INGEN_SIGNAL(disconnect_all, void, Raul::Path, Raul::Path) - INGEN_SIGNAL(property_change, void, Raul::URI, Raul::URI, Raul::Atom) + INGEN_SIGNAL(property_change, void, Raul::URI, Raul::URI, Atom) /** Fire pending signals. Only does anything on derived classes (that may queue) */ virtual bool emit_signals() { return false; } @@ -106,7 +106,7 @@ protected: void disconnect_all(const Raul::Path& graph, const Raul::Path& path) { EMIT(disconnect_all, graph, path); } - void set_property(const Raul::URI& subject, const Raul::URI& key, const Raul::Atom& value) + void set_property(const Raul::URI& subject, const Raul::URI& key, const Atom& value) { EMIT(property_change, subject, key, value); } void set_response_id(int32_t id) {} diff --git a/ingen/client/ThreadedSigClientInterface.hpp b/ingen/client/ThreadedSigClientInterface.hpp index d4e5f6d6..562c5fca 100644 --- a/ingen/client/ThreadedSigClientInterface.hpp +++ b/ingen/client/ThreadedSigClientInterface.hpp @@ -25,11 +25,10 @@ #include <sigc++/sigc++.h> #include <glibmm/thread.h> -#include "raul/Atom.hpp" -#include "raul/SRSWQueue.hpp" - +#include "ingen/Atom.hpp" #include "ingen/Interface.hpp" #include "ingen/client/SigClientInterface.hpp" +#include "raul/SRSWQueue.hpp" /** Returns nothing and takes no parameters (because they have all been bound) */ typedef sigc::slot<void> Closure; @@ -104,7 +103,7 @@ public: void disconnect_all(const Raul::Path& graph, const Raul::Path& path) { push_sig(sigc::bind(disconnect_all_slot, graph, path)); } - void set_property(const Raul::URI& subject, const Raul::URI& key, const Raul::Atom& value) + void set_property(const Raul::URI& subject, const Raul::URI& key, const Atom& value) { push_sig(sigc::bind(property_change_slot, subject, key, value)); } /** Process all queued events - Called from GTK thread to emit signals. */ @@ -145,21 +144,21 @@ private: Raul::SRSWQueue<Closure> _sigs; - sigc::slot<void> bundle_begin_slot; - sigc::slot<void> bundle_end_slot; - sigc::slot<void, int32_t, Status, std::string> response_slot; - sigc::slot<void, std::string> error_slot; - sigc::slot<void, Raul::URI, Raul::URI, Raul::Symbol> new_plugin_slot; + sigc::slot<void> bundle_begin_slot; + sigc::slot<void> bundle_end_slot; + sigc::slot<void, int32_t, Status, std::string> response_slot; + sigc::slot<void, std::string> error_slot; + sigc::slot<void, Raul::URI, Raul::URI, Raul::Symbol> new_plugin_slot; sigc::slot<void, Raul::URI, Resource::Properties, - Resource::Graph> put_slot; + Resource::Graph> put_slot; sigc::slot<void, Raul::URI, Resource::Properties, - Resource::Properties> delta_slot; - sigc::slot<void, Raul::Path, Raul::Path> connection_slot; - sigc::slot<void, Raul::URI> object_deleted_slot; - sigc::slot<void, Raul::Path, Raul::Path> object_moved_slot; - sigc::slot<void, Raul::Path, Raul::Path> disconnection_slot; - sigc::slot<void, Raul::Path, Raul::Path> disconnect_all_slot; - sigc::slot<void, Raul::URI, Raul::URI, Raul::Atom> property_change_slot; + Resource::Properties> delta_slot; + sigc::slot<void, Raul::Path, Raul::Path> connection_slot; + sigc::slot<void, Raul::URI> object_deleted_slot; + sigc::slot<void, Raul::Path, Raul::Path> object_moved_slot; + sigc::slot<void, Raul::Path, Raul::Path> disconnection_slot; + sigc::slot<void, Raul::Path, Raul::Path> disconnect_all_slot; + sigc::slot<void, Raul::URI, Raul::URI, Atom> property_change_slot; }; } // namespace Client diff --git a/src/AtomReader.cpp b/src/AtomReader.cpp index b41d2fd2..ae2f19c1 100644 --- a/src/AtomReader.cpp +++ b/src/AtomReader.cpp @@ -39,7 +39,7 @@ AtomReader::AtomReader(URIMap& map, } void -AtomReader::get_atom(const LV2_Atom* in, Raul::Atom& out) +AtomReader::get_atom(const LV2_Atom* in, Atom& out) { if (in) { if (in->type == _uris.atom_URID) { @@ -67,7 +67,7 @@ AtomReader::get_props(const LV2_Atom_Object* obj, _forge.alloc_uri(_map.unmap_uri(obj->body.otype)))); } LV2_ATOM_OBJECT_FOREACH(obj, p) { - Raul::Atom val; + Atom val; get_atom(&p->value, val); props.insert(std::make_pair(Raul::URI(_map.unmap_uri(p->key)), val)); } @@ -218,7 +218,7 @@ AtomReader::write(const LV2_Atom* msg) return false; } - Raul::Atom atom; + Atom atom; get_atom(value, atom); _iface.set_property(Raul::URI(subject_uri), Raul::URI(_map.unmap_uri(prop->body)), diff --git a/src/AtomWriter.cpp b/src/AtomWriter.cpp index c41b9598..7afd6056 100644 --- a/src/AtomWriter.cpp +++ b/src/AtomWriter.cpp @@ -233,9 +233,9 @@ AtomWriter::disconnect_all(const Raul::Path& graph, } void -AtomWriter::set_property(const Raul::URI& subject, - const Raul::URI& predicate, - const Raul::Atom& value) +AtomWriter::set_property(const Raul::URI& subject, + const Raul::URI& predicate, + const Atom& value) { LV2_Atom_Forge_Frame msg; lv2_atom_forge_blank(&_forge, &msg, next_id(), _uris.patch_Set); diff --git a/src/Builder.cpp b/src/Builder.cpp index dedd5cca..7de24ed1 100644 --- a/src/Builder.cpp +++ b/src/Builder.cpp @@ -15,11 +15,11 @@ */ #include "ingen/Arc.hpp" +#include "ingen/Atom.hpp" #include "ingen/Builder.hpp" #include "ingen/Interface.hpp" #include "ingen/Node.hpp" #include "ingen/URIs.hpp" -#include "raul/Atom.hpp" #include "raul/Path.hpp" using namespace std; diff --git a/src/ClashAvoider.cpp b/src/ClashAvoider.cpp index 54ca7eb8..5ac7a773 100644 --- a/src/ClashAvoider.cpp +++ b/src/ClashAvoider.cpp @@ -178,9 +178,9 @@ ClashAvoider::disconnect_all(const Raul::Path& graph, } void -ClashAvoider::set_property(const Raul::URI& subject, - const Raul::URI& predicate, - const Raul::Atom& value) +ClashAvoider::set_property(const Raul::URI& subject, + const Raul::URI& predicate, + const Atom& value) { _target.set_property(map_uri(subject), predicate, value); } diff --git a/src/Configuration.cpp b/src/Configuration.cpp index 25f3355c..a18e6d2c 100644 --- a/src/Configuration.cpp +++ b/src/Configuration.cpp @@ -49,7 +49,7 @@ Configuration::Configuration(Forge& forge) " ingen -egl foo.ingen # Run an engine and a GUI and load a graph") , _max_name_length(0) { - add("clientPort", "client-port", 'C', "Client port", SESSION, forge.Int, Raul::Atom()); + add("clientPort", "client-port", 'C', "Client port", SESSION, forge.Int, Atom()); add("connect", "connect", 'c', "Connect to engine URI", SESSION, forge.String, forge.alloc("unix:///tmp/ingen.sock")); add("engine", "engine", 'e', "Run (JACK) engine", SESSION, forge.Bool, forge.make(false)); add("enginePort", "engine-port", 'E', "Engine listen port", SESSION, forge.Int, forge.make(16180)); @@ -58,24 +58,24 @@ Configuration::Configuration(Forge& forge) add("", "help", 'h', "Print this help message", SESSION, forge.Bool, forge.make(false)); add("jackName", "jack-name", 'n', "JACK name", SESSION, forge.String, forge.alloc("ingen")); add("jackServer", "jack-server", 's', "JACK server name", GLOBAL, forge.String, forge.alloc("")); - add("uuid", "uuid", 'u', "JACK session UUID", SESSION, forge.String, Raul::Atom()); - add("load", "load", 'l', "Load graph", SESSION, forge.String, Raul::Atom()); - add("path", "path", 'L', "Target path for loaded graph", SESSION, forge.String, Raul::Atom()); + add("uuid", "uuid", 'u', "JACK session UUID", SESSION, forge.String, Atom()); + add("load", "load", 'l', "Load graph", SESSION, forge.String, Atom()); + add("path", "path", 'L', "Target path for loaded graph", SESSION, forge.String, Atom()); add("queueSize", "queue-size", 'q', "Event queue size", GLOBAL, forge.Int, forge.make(4096)); - add("run", "run", 'r', "Run script", SESSION, forge.String, Raul::Atom()); + add("run", "run", 'r', "Run script", SESSION, forge.String, Atom()); add("humanNames", "human-names", 0, "Show human names in GUI", GUI, forge.Bool, forge.make(true)); add("portLabels", "port-labels", 0, "Show port labels in GUI", GUI, forge.Bool, forge.make(true)); - add("graphDirectory", "graph-directory", 0, "Default directory for opening graphs", GUI, forge.String, Raul::Atom()); + add("graphDirectory", "graph-directory", 0, "Default directory for opening graphs", GUI, forge.String, Atom()); } Configuration& -Configuration::add(const std::string& key, - const std::string& name, - char letter, - const std::string& desc, - Scope scope, - const Raul::Atom::TypeID type, - const Raul::Atom& value) +Configuration::add(const std::string& key, + const std::string& name, + char letter, + const std::string& desc, + Scope scope, + const LV2_URID type, + const Atom& value) { assert(value.type() == type || value.type() == 0); _max_name_length = std::max(_max_name_length, name.length()); @@ -282,7 +282,7 @@ Configuration::save(URIMap& uri_map, // Write a statement for each valid option for (auto o : _options) { - const Raul::Atom& value = o.second.value; + const Atom& value = o.second.value; if (!(o.second.scope & scopes) || o.second.key.empty() || !value.is_valid()) { @@ -328,10 +328,10 @@ Configuration::load_default(const std::string& app, return loaded; } -const Raul::Atom& +const Atom& Configuration::option(const std::string& long_name) const { - static const Raul::Atom nil; + static const Atom nil; Options::const_iterator o = _options.find(long_name); if (o == _options.end()) { return nil; @@ -341,7 +341,7 @@ Configuration::option(const std::string& long_name) const } bool -Configuration::set(const std::string& long_name, const Raul::Atom& value) +Configuration::set(const std::string& long_name, const Atom& value) { Options::iterator o = _options.find(long_name); if (o != _options.end()) { diff --git a/src/Forge.cpp b/src/Forge.cpp index 14d727d2..7380bd8d 100644 --- a/src/Forge.cpp +++ b/src/Forge.cpp @@ -25,16 +25,11 @@ namespace Ingen { Forge::Forge(URIMap& map) : _map(map) { - Int = map.map_uri(LV2_ATOM__Int); - Float = map.map_uri(LV2_ATOM__Float); - Bool = map.map_uri(LV2_ATOM__Bool); - URI = map.map_uri(LV2_ATOM__URI); - URID = map.map_uri(LV2_ATOM__URID); - String = map.map_uri(LV2_ATOM__String); + lv2_atom_forge_init(this, &map.urid_map_feature()->urid_map); } std::string -Forge::str(const Raul::Atom& atom) +Forge::str(const Atom& atom) { std::ostringstream ss; if (atom.type() == Int) { diff --git a/src/Resource.cpp b/src/Resource.cpp index 1a701eca..a8e96e5d 100644 --- a/src/Resource.cpp +++ b/src/Resource.cpp @@ -16,18 +16,18 @@ #include <utility> +#include "ingen/Atom.hpp" #include "ingen/Resource.hpp" #include "ingen/URIs.hpp" -#include "raul/Atom.hpp" using namespace std; namespace Ingen { void -Resource::add_property(const Raul::URI& uri, - const Raul::Atom& value, - Graph ctx) +Resource::add_property(const Raul::URI& uri, + const Atom& value, + Graph ctx) { // Ignore duplicate statements typedef Resource::Properties::const_iterator iterator; @@ -38,14 +38,14 @@ Resource::add_property(const Raul::URI& uri, } } - const Raul::Atom& v = _properties.insert(make_pair(uri, Property(value, ctx)))->second; + const Atom& v = _properties.insert(make_pair(uri, Property(value, ctx)))->second; on_property(uri, v); } -const Raul::Atom& -Resource::set_property(const Raul::URI& uri, - const Raul::Atom& value, - Resource::Graph ctx) +const Atom& +Resource::set_property(const Raul::URI& uri, + const Atom& value, + Resource::Graph ctx) { // Erase existing property in this context for (Properties::iterator i = _properties.find(uri); @@ -59,13 +59,13 @@ Resource::set_property(const Raul::URI& uri, } // Insert new property - const Raul::Atom& v = _properties.insert(make_pair(uri, Property(value, ctx)))->second; + const Atom& v = _properties.insert(make_pair(uri, Property(value, ctx)))->second; on_property(uri, v); return v; } void -Resource::remove_property(const Raul::URI& uri, const Raul::Atom& value) +Resource::remove_property(const Raul::URI& uri, const Atom& value) { if (value == _uris.wildcard) { _properties.erase(uri); @@ -82,7 +82,7 @@ Resource::remove_property(const Raul::URI& uri, const Raul::Atom& value) } bool -Resource::has_property(const Raul::URI& uri, const Raul::Atom& value) const +Resource::has_property(const Raul::URI& uri, const Atom& value) const { Properties::const_iterator i = _properties.find(uri); for (; (i != _properties.end()) && (i->first == uri); ++i) { @@ -93,16 +93,16 @@ Resource::has_property(const Raul::URI& uri, const Raul::Atom& value) const return false; } -const Raul::Atom& -Resource::set_property(const Raul::URI& uri, const Raul::Atom& value) const +const Atom& +Resource::set_property(const Raul::URI& uri, const Atom& value) const { return const_cast<Resource*>(this)->set_property(uri, value); } -const Raul::Atom& +const Atom& Resource::get_property(const Raul::URI& uri) const { - static const Raul::Atom nil; + static const Atom nil; Properties::const_iterator i = _properties.find(uri); return (i != _properties.end()) ? i->second : nil; } @@ -120,7 +120,7 @@ Resource::type(const URIs& uris, graph = block = port = is_output = false; for (iterator i = types_range.first; i != types_range.second; ++i) { - const Raul::Atom& atom = i->second; + const Atom& atom = i->second; if (atom.type() != uris.forge.URI && atom.type() != uris.forge.URID) { continue; // Non-URI type, ignore garbage data } diff --git a/src/bindings/Client.hpp b/src/bindings/Client.hpp index 248c71ec..e2db6644 100644 --- a/src/bindings/Client.hpp +++ b/src/bindings/Client.hpp @@ -38,5 +38,5 @@ public: void del(const Raul::URI& uri) {} void move(const Raul::Path& old_path, const Raul::Path& new_path) {} void disconnect(const Raul::Path& src_port_path, const Raul::Path& dst_port_path) {} - void set_property(const Raul::URI& subject, const Raul::URI& key, const Raul::Atom& value) {} + void set_property(const Raul::URI& subject, const Raul::URI& key, const Atom& value) {} }; diff --git a/src/client/BlockModel.cpp b/src/client/BlockModel.cpp index a8e74847..2c389f90 100644 --- a/src/client/BlockModel.cpp +++ b/src/client/BlockModel.cpp @@ -200,8 +200,8 @@ BlockModel::port_value_range(SPtr<const PortModel> port, default_port_value_range(port, min, max); // Possibly overriden - const Raul::Atom& min_atom = port->get_property(_uris.lv2_minimum); - const Raul::Atom& max_atom = port->get_property(_uris.lv2_maximum); + const Atom& min_atom = port->get_property(_uris.lv2_minimum); + const Atom& max_atom = port->get_property(_uris.lv2_maximum); if (min_atom.type() == _uris.forge.Float) min = min_atom.get<float>(); if (max_atom.type() == _uris.forge.Float) @@ -219,7 +219,7 @@ BlockModel::port_value_range(SPtr<const PortModel> port, std::string BlockModel::label() const { - const Raul::Atom& name_property = get_property(_uris.lv2_name); + const Atom& name_property = get_property(_uris.lv2_name); if (name_property.type() == _uris.forge.String) { return name_property.ptr<char>(); } else if (plugin_model()) { @@ -232,7 +232,7 @@ BlockModel::label() const std::string BlockModel::port_label(SPtr<const PortModel> port) const { - const Raul::Atom& name = port->get_property(Raul::URI(LV2_CORE__name)); + const Atom& name = port->get_property(Raul::URI(LV2_CORE__name)); if (name.is_valid()) { return name.ptr<char>(); } diff --git a/src/client/ClientStore.cpp b/src/client/ClientStore.cpp index 779ff4ca..b7b38df3 100644 --- a/src/client/ClientStore.cpp +++ b/src/client/ClientStore.cpp @@ -229,7 +229,7 @@ ClientStore::put(const Raul::URI& uri, // Check if uri is a plugin Iterator t = properties.find(_uris.rdf_type); if (t != properties.end() && t->second.type() == _uris.forge.URI) { - const Raul::Atom& type(t->second); + const Atom& type(t->second); const Raul::URI type_uri(type.ptr<char>()); const Plugin::Type plugin_type(Plugin::type_from_uri(type_uri)); if (plugin_type == Plugin::Graph) { @@ -347,9 +347,9 @@ ClientStore::delta(const Raul::URI& uri, } void -ClientStore::set_property(const Raul::URI& subject_uri, - const Raul::URI& predicate, - const Raul::Atom& value) +ClientStore::set_property(const Raul::URI& subject_uri, + const Raul::URI& predicate, + const Atom& value) { if (subject_uri == _uris.ingen_engine) { _log.info(Raul::fmt("Engine property <%1%> = %2%\n") diff --git a/src/client/GraphModel.cpp b/src/client/GraphModel.cpp index 0a6ae027..493293a5 100644 --- a/src/client/GraphModel.cpp +++ b/src/client/GraphModel.cpp @@ -150,21 +150,21 @@ GraphModel::remove_arc(const Node* tail, const Node* head) bool GraphModel::enabled() const { - const Raul::Atom& enabled = get_property(_uris.ingen_enabled); + const Atom& enabled = get_property(_uris.ingen_enabled); return (enabled.is_valid() && enabled.get<int32_t>()); } uint32_t GraphModel::internal_poly() const { - const Raul::Atom& poly = get_property(_uris.ingen_polyphony); + const Atom& poly = get_property(_uris.ingen_polyphony); return poly.is_valid() ? poly.get<int32_t>() : 1; } bool GraphModel::polyphonic() const { - const Raul::Atom& poly = get_property(_uris.ingen_polyphonic); + const Atom& poly = get_property(_uris.ingen_polyphonic); return poly.is_valid() && poly.get<int32_t>(); } diff --git a/src/client/ObjectModel.cpp b/src/client/ObjectModel.cpp index 7e6263aa..4cef3188 100644 --- a/src/client/ObjectModel.cpp +++ b/src/client/ObjectModel.cpp @@ -47,15 +47,15 @@ ObjectModel::is_a(const Raul::URI& type) const } void -ObjectModel::on_property(const Raul::URI& uri, const Raul::Atom& value) +ObjectModel::on_property(const Raul::URI& uri, const Atom& value) { _signal_property.emit(uri, value); } -const Raul::Atom& +const Atom& ObjectModel::get_property(const Raul::URI& key) const { - static const Raul::Atom null_atom; + static const Atom null_atom; Resource::Properties::const_iterator i = properties().find(key); return (i != properties().end()) ? i->second : null_atom; } @@ -63,7 +63,7 @@ ObjectModel::get_property(const Raul::URI& key) const bool ObjectModel::polyphonic() const { - const Raul::Atom& polyphonic = get_property(_uris.ingen_polyphonic); + const Atom& polyphonic = get_property(_uris.ingen_polyphonic); return (polyphonic.is_valid() && polyphonic.get<int32_t>()); } diff --git a/src/client/PluginModel.cpp b/src/client/PluginModel.cpp index 775836b9..1025a7dc 100644 --- a/src/client/PluginModel.cpp +++ b/src/client/PluginModel.cpp @@ -21,9 +21,9 @@ #include <boost/optional.hpp> -#include "raul/Atom.hpp" #include "raul/Path.hpp" +#include "ingen/Atom.hpp" #include "ingen/client/GraphModel.hpp" #include "ingen/client/PluginModel.hpp" #include "ingen/client/PluginUI.hpp" @@ -92,11 +92,11 @@ contains_alpha_after(const std::string& str, size_t begin) return false; } -const Raul::Atom& +const Atom& PluginModel::get_property(const Raul::URI& key) const { - static const Raul::Atom nil; - const Raul::Atom& val = Resource::get_property(key); + static const Atom nil; + const Atom& val = Resource::get_property(key); if (val.is_valid()) return val; @@ -117,7 +117,7 @@ PluginModel::get_property(const Raul::URI& key) const } if (_lilv_plugin) { - boost::optional<const Raul::Atom&> ret; + boost::optional<const Atom&> ret; LilvNode* lv2_pred = lilv_new_uri(_lilv_world, key.c_str()); LilvNodes* values = lilv_plugin_get_value(_lilv_plugin, lv2_pred); lilv_node_free(lv2_pred); @@ -170,7 +170,7 @@ PluginModel::set(SPtr<PluginModel> p) Raul::Symbol PluginModel::default_block_symbol() const { - const Raul::Atom& name_atom = get_property(_uris.lv2_symbol); + const Atom& name_atom = get_property(_uris.lv2_symbol); if (name_atom.is_valid() && name_atom.type() == _uris.forge.String) return Raul::Symbol::symbolify(name_atom.ptr<char>()); else @@ -180,7 +180,7 @@ PluginModel::default_block_symbol() const string PluginModel::human_name() const { - const Raul::Atom& name_atom = get_property(_uris.doap_name); + const Atom& name_atom = get_property(_uris.doap_name); if (name_atom.type() == _uris.forge.String) return name_atom.ptr<char>(); else diff --git a/src/client/PluginUI.cpp b/src/client/PluginUI.cpp index 9bd3a195..2bee4249 100644 --- a/src/client/PluginUI.cpp +++ b/src/client/PluginUI.cpp @@ -70,8 +70,8 @@ lv2_ui_write(SuilController controller, ui->world()->forge().make(value)); } else if (format == uris.atom_eventTransfer.id) { - const LV2_Atom* atom = (const LV2_Atom*)buffer; - Raul::Atom val = ui->world()->forge().alloc( + const LV2_Atom* atom = (const LV2_Atom*)buffer; + Atom val = ui->world()->forge().alloc( atom->size, atom->type, LV2_ATOM_BODY_CONST(atom)); ui->world()->interface()->set_property(port->uri(), uris.ingen_value, diff --git a/src/client/PortModel.cpp b/src/client/PortModel.cpp index e72c279d..2c7359f9 100644 --- a/src/client/PortModel.cpp +++ b/src/client/PortModel.cpp @@ -21,7 +21,7 @@ namespace Ingen { namespace Client { void -PortModel::on_property(const Raul::URI& uri, const Raul::Atom& value) +PortModel::on_property(const Raul::URI& uri, const Atom& value) { if (uri == _uris.ingen_activity) { // Don't store activity, it is transient diff --git a/src/gui/App.cpp b/src/gui/App.cpp index 1fb40495..e64465ea 100644 --- a/src/gui/App.cpp +++ b/src/gui/App.cpp @@ -235,9 +235,9 @@ App::error_message(const string& str) } void -App::property_change(const Raul::URI& subject, - const Raul::URI& key, - const Raul::Atom& value) +App::property_change(const Raul::URI& subject, + const Raul::URI& key, + const Atom& value) { if (subject == uris().ingen_engine && key == uris().ingen_sampleRate) { if (value.type() == forge().Int) { diff --git a/src/gui/App.hpp b/src/gui/App.hpp index e435c4a5..1fca42ea 100644 --- a/src/gui/App.hpp +++ b/src/gui/App.hpp @@ -26,10 +26,10 @@ #include <gtkmm/main.h> #include <gtkmm/window.h> +#include "ingen/Atom.hpp" #include "ingen/Status.hpp" #include "ingen/World.hpp" #include "ingen/types.hpp" -#include "raul/Atom.hpp" #include "raul/Deletable.hpp" #include "raul/URI.hpp" @@ -144,9 +144,9 @@ protected: bool animate(); void response(int32_t id, Ingen::Status status, const std::string& subject); - void property_change(const Raul::URI& subject, - const Raul::URI& key, - const Raul::Atom& value); + void property_change(const Raul::URI& subject, + const Raul::URI& key, + const Atom& value); static void* icon_destroyed(void* data); diff --git a/src/gui/GraphBox.cpp b/src/gui/GraphBox.cpp index 53dd085f..d1f76ea4 100644 --- a/src/gui/GraphBox.cpp +++ b/src/gui/GraphBox.cpp @@ -353,7 +353,7 @@ GraphBox::show_status(const ObjectModel* model) } void -GraphBox::show_port_status(const PortModel* port, const Raul::Atom& value) +GraphBox::show_port_status(const PortModel* port, const Atom& value) { std::stringstream msg; msg << port->path(); @@ -418,7 +418,7 @@ GraphBox::event_import() void GraphBox::event_save() { - const Raul::Atom& document = _graph->get_property(_app->uris().ingen_document); + const Atom& document = _graph->get_property(_app->uris().ingen_document); if (!document.is_valid() || document.type() != _app->uris().forge.URI) { event_save_as(); } else { @@ -464,8 +464,8 @@ GraphBox::event_save_as() dialog.set_filter(filt); // Set current folder to most sensible default - const Raul::Atom& document = _graph->get_property(uris.ingen_document); - const Raul::Atom& dir = _app->world()->conf().option("graph-directory"); + const Atom& document = _graph->get_property(uris.ingen_document); + const Atom& dir = _app->world()->conf().option("graph-directory"); if (document.type() == uris.forge.URI) dialog.set_uri(document.ptr<char>()); else if (dir.is_valid()) diff --git a/src/gui/GraphBox.hpp b/src/gui/GraphBox.hpp index 0b44ba99..530e03ff 100644 --- a/src/gui/GraphBox.hpp +++ b/src/gui/GraphBox.hpp @@ -84,7 +84,7 @@ public: SPtr<GraphView> view() const { return _view; } void show_port_status(const Client::PortModel* model, - const Raul::Atom& value); + const Atom& value); void set_graph_from_path(const Raul::Path& path, SPtr<GraphView> view); diff --git a/src/gui/GraphPortModule.cpp b/src/gui/GraphPortModule.cpp index bdd4abd8..77d8a6fe 100644 --- a/src/gui/GraphPortModule.cpp +++ b/src/gui/GraphPortModule.cpp @@ -98,8 +98,8 @@ GraphPortModule::store_location(double ax, double ay) { const URIs& uris = app().uris(); - const Raul::Atom x(app().forge().make(static_cast<float>(ax))); - const Raul::Atom y(app().forge().make(static_cast<float>(ay))); + const Atom x(app().forge().make(static_cast<float>(ax))); + const Atom y(app().forge().make(static_cast<float>(ay))); if (x != _model->get_property(uris.ingen_canvasX) || y != _model->get_property(uris.ingen_canvasY)) @@ -121,8 +121,8 @@ GraphPortModule::store_location(double ax, double ay) void GraphPortModule::show_human_names(bool b) { - const URIs& uris = app().uris(); - const Raul::Atom& name = _model->get_property(uris.lv2_name); + const URIs& uris = app().uris(); + const Atom& name = _model->get_property(uris.lv2_name); if (b && name.type() == uris.forge.String) { set_name(name.ptr<char>()); } else { @@ -137,7 +137,7 @@ GraphPortModule::set_name(const std::string& n) } void -GraphPortModule::property_changed(const Raul::URI& key, const Raul::Atom& value) +GraphPortModule::property_changed(const Raul::URI& key, const Atom& value) { const URIs& uris = app().uris(); if (value.type() == uris.forge.Float) { diff --git a/src/gui/GraphPortModule.hpp b/src/gui/GraphPortModule.hpp index 0bf0d68c..f9292363 100644 --- a/src/gui/GraphPortModule.hpp +++ b/src/gui/GraphPortModule.hpp @@ -69,7 +69,7 @@ protected: void set_port(Port* port) { _port = port; } - void property_changed(const Raul::URI& predicate, const Raul::Atom& value); + void property_changed(const Raul::URI& predicate, const Atom& value); SPtr<const Client::PortModel> _model; Port* _port; diff --git a/src/gui/GraphTreeWindow.cpp b/src/gui/GraphTreeWindow.cpp index 9b9cf71c..249e3e73 100644 --- a/src/gui/GraphTreeWindow.cpp +++ b/src/gui/GraphTreeWindow.cpp @@ -192,9 +192,9 @@ GraphTreeWindow::event_graph_enabled_toggled(const Glib::ustring& path_str) } void -GraphTreeWindow::graph_property_changed(const Raul::URI& key, - const Raul::Atom& value, - SPtr<GraphModel> graph) +GraphTreeWindow::graph_property_changed(const Raul::URI& key, + const Atom& value, + SPtr<GraphModel> graph) { const URIs& uris = _app->uris(); _enable_signal = false; diff --git a/src/gui/GraphTreeWindow.hpp b/src/gui/GraphTreeWindow.hpp index eec8b0d8..3a4f465d 100644 --- a/src/gui/GraphTreeWindow.hpp +++ b/src/gui/GraphTreeWindow.hpp @@ -50,7 +50,7 @@ public: void new_object(SPtr<Client::ObjectModel> object); void graph_property_changed(const Raul::URI& key, - const Raul::Atom& value, + const Atom& value, SPtr<Client::GraphModel> gm); void graph_moved(SPtr<Client::GraphModel> graph); diff --git a/src/gui/GraphView.cpp b/src/gui/GraphView.cpp index a74a11bf..737b0a3a 100644 --- a/src/gui/GraphView.cpp +++ b/src/gui/GraphView.cpp @@ -150,7 +150,7 @@ GraphView::refresh_clicked() } void -GraphView::property_changed(const Raul::URI& predicate, const Raul::Atom& value) +GraphView::property_changed(const Raul::URI& predicate, const Atom& value) { _enable_signal = false; if (predicate == _app->uris().ingen_enabled) { diff --git a/src/gui/GraphView.hpp b/src/gui/GraphView.hpp index d571b3b3..dbf81eed 100644 --- a/src/gui/GraphView.hpp +++ b/src/gui/GraphView.hpp @@ -76,7 +76,7 @@ private: void clear_clicked(); void refresh_clicked(); - void property_changed(const Raul::URI& predicate, const Raul::Atom& value); + void property_changed(const Raul::URI& predicate, const Atom& value); void zoom_full(); diff --git a/src/gui/GraphWindow.hpp b/src/gui/GraphWindow.hpp index bbb25a27..46126589 100644 --- a/src/gui/GraphWindow.hpp +++ b/src/gui/GraphWindow.hpp @@ -58,7 +58,7 @@ public: } void show_port_status(const Client::PortModel* model, - const Raul::Atom& value) { + const Atom& value) { _box->show_port_status(model, value); } diff --git a/src/gui/LoadGraphWindow.cpp b/src/gui/LoadGraphWindow.cpp index 40b04aa0..babfb632 100644 --- a/src/gui/LoadGraphWindow.cpp +++ b/src/gui/LoadGraphWindow.cpp @@ -126,7 +126,7 @@ LoadGraphWindow::set_graph(SPtr<const GraphModel> graph) void LoadGraphWindow::on_show() { - const Raul::Atom& dir = _app->world()->conf().option("graph-directory"); + const Atom& dir = _app->world()->conf().option("graph-directory"); if (dir.is_valid()) { set_current_folder(dir.ptr<char>()); } @@ -179,9 +179,9 @@ LoadGraphWindow::ok_clicked() std::list<Glib::ustring> uri_list = get_filenames(); for (auto u : uri_list) { // Cascade - Raul::Atom& x = _initial_data.find(uris.ingen_canvasX)->second; + Atom& x = _initial_data.find(uris.ingen_canvasX)->second; x = _app->forge().make(x.get<float>() + 20.0f); - Raul::Atom& y = _initial_data.find(uris.ingen_canvasY)->second; + Atom& y = _initial_data.find(uris.ingen_canvasY)->second; y = _app->forge().make(y.get<float>() + 20.0f); Raul::Symbol symbol(symbol_from_filename(u)); diff --git a/src/gui/LoadPluginWindow.cpp b/src/gui/LoadPluginWindow.cpp index c13b1882..018856fe 100644 --- a/src/gui/LoadPluginWindow.cpp +++ b/src/gui/LoadPluginWindow.cpp @@ -268,11 +268,11 @@ get_author_name(SPtr<const PluginModel> plugin) } void -LoadPluginWindow::set_row(Gtk::TreeModel::Row& row, +LoadPluginWindow::set_row(Gtk::TreeModel::Row& row, SPtr<const PluginModel> plugin) { const URIs& uris = _app->uris(); - const Raul::Atom& name = plugin->get_property(uris.doap_name); + const Atom& name = plugin->get_property(uris.doap_name); if (name.is_valid() && name.type() == uris.forge.String) row[_plugins_columns._col_name] = name.ptr<char>(); @@ -412,9 +412,9 @@ LoadPluginWindow::load_plugin(const Gtk::TreeModel::iterator& iter) } // Cascade next block - Raul::Atom& x = _initial_data.find(uris.ingen_canvasX)->second; + Atom& x = _initial_data.find(uris.ingen_canvasX)->second; x = _app->forge().make(x.get<float>() + 20.0f); - Raul::Atom& y = _initial_data.find(uris.ingen_canvasY)->second; + Atom& y = _initial_data.find(uris.ingen_canvasY)->second; y = _app->forge().make(y.get<float>() + 20.0f); } } @@ -447,7 +447,7 @@ LoadPluginWindow::filter_changed() for (const auto& p : *_app->store()->plugins().get()) { const SPtr<PluginModel> plugin = p.second; - const Raul::Atom& name = plugin->get_property(uris.doap_name); + const Atom& name = plugin->get_property(uris.doap_name); switch (criteria) { case CriteriaColumns::Criteria::NAME: @@ -496,9 +496,9 @@ LoadPluginWindow::on_key_press_event(GdkEventKey* event) } void -LoadPluginWindow::plugin_property_changed(const Raul::URI& plugin, - const Raul::URI& predicate, - const Raul::Atom& value) +LoadPluginWindow::plugin_property_changed(const Raul::URI& plugin, + const Raul::URI& predicate, + const Atom& value) { const URIs& uris = _app->uris(); if (predicate == uris.doap_name) { diff --git a/src/gui/LoadPluginWindow.hpp b/src/gui/LoadPluginWindow.hpp index 5c8fad19..fff10be1 100644 --- a/src/gui/LoadPluginWindow.hpp +++ b/src/gui/LoadPluginWindow.hpp @@ -116,9 +116,9 @@ private: void new_plugin(SPtr<const Client::PluginModel> plugin); - void plugin_property_changed(const Raul::URI& plugin, - const Raul::URI& predicate, - const Raul::Atom& value); + void plugin_property_changed(const Raul::URI& plugin, + const Raul::URI& predicate, + const Atom& value); void plugin_activated(const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn* col); void plugin_selection_changed(); diff --git a/src/gui/NodeMenu.cpp b/src/gui/NodeMenu.cpp index e55cf131..43cf266f 100644 --- a/src/gui/NodeMenu.cpp +++ b/src/gui/NodeMenu.cpp @@ -66,7 +66,7 @@ NodeMenu::init(App& app, SPtr<const Client::BlockModel> block) if (plugin && plugin->type() == PluginModel::LV2 && plugin->has_ui()) { _popup_gui_menuitem->show(); _embed_gui_menuitem->show(); - const Raul::Atom& ui_embedded = block->get_property( + const Atom& ui_embedded = block->get_property( _app->uris().ingen_uiEmbedded); _embed_gui_menuitem->set_active( ui_embedded.is_valid() && ui_embedded.get<int32_t>()); diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp index 068642b1..54b30227 100644 --- a/src/gui/NodeModule.cpp +++ b/src/gui/NodeModule.cpp @@ -21,6 +21,7 @@ #include "lv2/lv2plug.in/ns/ext/atom/util.h" +#include "ingen/Atom.hpp" #include "ingen/Configuration.hpp" #include "ingen/Interface.hpp" #include "ingen/Log.hpp" @@ -28,7 +29,6 @@ #include "ingen/client/GraphModel.hpp" #include "ingen/client/PluginModel.hpp" #include "ingen/client/PluginUI.hpp" -#include "raul/Atom.hpp" #include "App.hpp" #include "GraphCanvas.hpp" @@ -148,7 +148,7 @@ NodeModule::show_human_names(bool b) Ingen::GUI::Port* const port = dynamic_cast<Ingen::GUI::Port*>(*i); Glib::ustring label(port->model()->symbol().c_str()); if (b) { - const Raul::Atom& name_property = port->model()->get_property(uris.lv2_name); + const Atom& name_property = port->model()->get_property(uris.lv2_name); if (name_property.type() == uris.forge.String) { label = name_property.ptr<char>(); } else { @@ -163,7 +163,7 @@ NodeModule::show_human_names(bool b) } void -NodeModule::port_activity(uint32_t index, const Raul::Atom& value) +NodeModule::port_activity(uint32_t index, const Atom& value) { const URIs& uris = app().uris(); if (!_plugin_ui) { @@ -383,8 +383,8 @@ NodeModule::store_location(double ax, double ay) { const URIs& uris = app().uris(); - const Raul::Atom x(app().forge().make(static_cast<float>(ax))); - const Raul::Atom y(app().forge().make(static_cast<float>(ay))); + const Atom x(app().forge().make(static_cast<float>(ax))); + const Atom y(app().forge().make(static_cast<float>(ay))); if (x != _block->get_property(uris.ingen_canvasX) || y != _block->get_property(uris.ingen_canvasY)) @@ -402,7 +402,7 @@ NodeModule::store_location(double ax, double ay) } void -NodeModule::property_changed(const Raul::URI& key, const Raul::Atom& value) +NodeModule::property_changed(const Raul::URI& key, const Atom& value) { const URIs& uris = app().uris(); if (value.type() == uris.forge.Float) { diff --git a/src/gui/NodeModule.hpp b/src/gui/NodeModule.hpp index 6edad27b..1092cdf3 100644 --- a/src/gui/NodeModule.hpp +++ b/src/gui/NodeModule.hpp @@ -78,11 +78,11 @@ protected: bool on_selected(gboolean selected); void rename(); - void property_changed(const Raul::URI& predicate, const Raul::Atom& value); + void property_changed(const Raul::URI& predicate, const Atom& value); void new_port_view(SPtr<const Client::PortModel> port); - void port_activity(uint32_t index, const Raul::Atom& value); + void port_activity(uint32_t index, const Atom& value); void plugin_changed(); void set_control_values(); diff --git a/src/gui/ObjectMenu.cpp b/src/gui/ObjectMenu.cpp index 7ff25b2d..3bd0be38 100644 --- a/src/gui/ObjectMenu.cpp +++ b/src/gui/ObjectMenu.cpp @@ -117,7 +117,7 @@ ObjectMenu::on_menu_polyphonic() } void -ObjectMenu::property_changed(const Raul::URI& predicate, const Raul::Atom& value) +ObjectMenu::property_changed(const Raul::URI& predicate, const Atom& value) { const URIs& uris = _app->uris(); _enable_signal = false; diff --git a/src/gui/ObjectMenu.hpp b/src/gui/ObjectMenu.hpp index 63ca666d..fc63c7a8 100644 --- a/src/gui/ObjectMenu.hpp +++ b/src/gui/ObjectMenu.hpp @@ -52,7 +52,7 @@ protected: void on_menu_destroy(); void on_menu_properties(); - void property_changed(const Raul::URI& predicate, const Raul::Atom& value); + void property_changed(const Raul::URI& predicate, const Atom& value); App* _app; SPtr<const Client::ObjectModel> _object; diff --git a/src/gui/Port.cpp b/src/gui/Port.cpp index 0ab079c5..253a395b 100644 --- a/src/gui/Port.cpp +++ b/src/gui/Port.cpp @@ -49,7 +49,7 @@ Port::create(App& app, Glib::ustring label; if (app.world()->conf().option("port-labels").get<int32_t>()) { if (human_name) { - const Raul::Atom& name = pm->get_property(app.uris().lv2_name); + const Atom& name = pm->get_property(app.uris().lv2_name); if (name.type() == app.forge().String) { label = name.ptr<char>(); } else { @@ -154,7 +154,7 @@ Port::moved() void Port::on_value_changed(double value) { - const Raul::Atom atom = _app.forge().make(float(value)); + const Atom atom = _app.forge().make(float(value)); if (atom != model()->value()) { Ingen::World* const world = _app.world(); _app.interface()->set_property(model()->uri(), @@ -171,7 +171,7 @@ Port::on_value_changed(double value) } void -Port::value_changed(const Raul::Atom& value) +Port::value_changed(const Atom& value) { if (!_pressed && value.type() == _app.forge().Float) { Ganv::Port::set_control_value(value.get<float>()); @@ -224,7 +224,7 @@ Port::build_uri_menu() Gtk::Menu* menu = Gtk::manage(new Gtk::Menu()); // Get the port designation, which should be a rdf:Property - const Raul::Atom& designation_atom = model()->get_property( + const Atom& designation_atom = model()->get_property( _app.uris().lv2_designation); if (!designation_atom.is_valid()) { return NULL; @@ -359,7 +359,7 @@ peak_color(float peak) /* End peak colour stuff */ void -Port::activity(const Raul::Atom& value) +Port::activity(const Atom& value) { if (model()->is_a(_app.uris().lv2_AudioPort)) { set_fill_color(peak_color(value.get<float>())); @@ -403,7 +403,7 @@ Port::port_properties_changed() } void -Port::property_changed(const Raul::URI& key, const Raul::Atom& value) +Port::property_changed(const Raul::URI& key, const Atom& value) { const URIs& uris = _app.uris(); if (value.type() == uris.forge.Float) { diff --git a/src/gui/Port.hpp b/src/gui/Port.hpp index 7d95009a..16fc5cde 100644 --- a/src/gui/Port.hpp +++ b/src/gui/Port.hpp @@ -60,8 +60,8 @@ public: bool show_menu(GdkEventButton* ev); void update_metadata(); - void value_changed(const Raul::Atom& value); - void activity(const Raul::Atom& value); + void value_changed(const Atom& value); + void activity(const Atom& value); void disconnected_from(SPtr<Client::PortModel> port); void set_selected(gboolean b); @@ -77,7 +77,7 @@ private: Gtk::Menu* build_uri_menu(); GraphBox* get_graph_box() const; - void property_changed(const Raul::URI& key, const Raul::Atom& value); + void property_changed(const Raul::URI& key, const Atom& value); void moved(); void on_value_changed(double value); diff --git a/src/gui/PortMenu.cpp b/src/gui/PortMenu.cpp index 204ffcbc..babc37a1 100644 --- a/src/gui/PortMenu.cpp +++ b/src/gui/PortMenu.cpp @@ -103,7 +103,7 @@ PortMenu::on_menu_set_min() { const URIs& uris = _app->uris(); SPtr<const PortModel> model = dynamic_ptr_cast<const PortModel>(_object); - const Raul::Atom& value = model->get_property(uris.ingen_value); + const Atom& value = model->get_property(uris.ingen_value); if (value.is_valid()) _app->interface()->set_property(_object->uri(), uris.lv2_minimum, value); } @@ -113,7 +113,7 @@ PortMenu::on_menu_set_max() { const URIs& uris = _app->uris(); SPtr<const PortModel> model = dynamic_ptr_cast<const PortModel>(_object); - const Raul::Atom& value = model->get_property(uris.ingen_value); + const Atom& value = model->get_property(uris.ingen_value); if (value.is_valid()) _app->interface()->set_property(_object->uri(), uris.lv2_maximum, value); } diff --git a/src/gui/PortPropertiesWindow.cpp b/src/gui/PortPropertiesWindow.cpp index 10400a00..e4aec41d 100644 --- a/src/gui/PortPropertiesWindow.cpp +++ b/src/gui/PortPropertiesWindow.cpp @@ -92,8 +92,8 @@ PortPropertiesWindow::present(SPtr<const PortModel> pm) } void -PortPropertiesWindow::property_changed(const Raul::URI& key, - const Raul::Atom& value) +PortPropertiesWindow::property_changed(const Raul::URI& key, + const Atom& value) { const URIs& uris = _app->uris(); if (value.type() == uris.forge.Float) { diff --git a/src/gui/PortPropertiesWindow.hpp b/src/gui/PortPropertiesWindow.hpp index 1cf86aa8..684a2dfb 100644 --- a/src/gui/PortPropertiesWindow.hpp +++ b/src/gui/PortPropertiesWindow.hpp @@ -45,7 +45,7 @@ public: void present(SPtr<const Client::PortModel> port_model); private: - void property_changed(const Raul::URI& key, const Raul::Atom& value); + void property_changed(const Raul::URI& key, const Atom& value); void min_changed(); void max_changed(); diff --git a/src/gui/PropertiesWindow.cpp b/src/gui/PropertiesWindow.cpp index 30e9649f..2e3ef35d 100644 --- a/src/gui/PropertiesWindow.cpp +++ b/src/gui/PropertiesWindow.cpp @@ -104,7 +104,7 @@ PropertiesWindow::present(SPtr<const ObjectModel> model) } void -PropertiesWindow::add_property(const Raul::URI& uri, const Raul::Atom& value) +PropertiesWindow::add_property(const Raul::URI& uri, const Atom& value) { World* world = _app->world(); @@ -211,7 +211,7 @@ PropertiesWindow::set_object(SPtr<const ObjectModel> model) } Gtk::Widget* -PropertiesWindow::create_value_widget(const Raul::URI& uri, const Raul::Atom& value) +PropertiesWindow::create_value_widget(const Raul::URI& uri, const Atom& value) { Ingen::Forge& forge = _app->forge(); if (value.type() == forge.Int) { @@ -301,8 +301,8 @@ PropertiesWindow::on_show() } void -PropertiesWindow::property_changed(const Raul::URI& predicate, - const Raul::Atom& value) +PropertiesWindow::property_changed(const Raul::URI& predicate, + const Atom& value) { Records::iterator r = _records.find(predicate); if (r == _records.end()) { @@ -332,9 +332,9 @@ PropertiesWindow::value_edited(const Raul::URI& predicate) return; } - Forge& forge = _app->forge(); - Record& record = r->second; - Raul::Atom::TypeID type = record.value.type(); + Forge& forge = _app->forge(); + Record& record = r->second; + LV2_URID type = record.value.type(); if (type == forge.Int) { Gtk::SpinButton* widget = dynamic_cast<Gtk::SpinButton*>(record.value_widget->get_child()); if (!widget) goto bad_type; @@ -428,7 +428,7 @@ PropertiesWindow::add_clicked() Glib::ustring key_uri = krow[_combo_columns.uri_col]; Glib::ustring value_uri = vrow[_combo_columns.uri_col]; - Raul::Atom value = _app->forge().alloc_uri(value_uri); + Atom value = _app->forge().alloc_uri(value_uri); Resource::Properties properties; properties.insert(make_pair(Raul::URI(key_uri.c_str()), diff --git a/src/gui/PropertiesWindow.hpp b/src/gui/PropertiesWindow.hpp index ad4d3d90..7725706b 100644 --- a/src/gui/PropertiesWindow.hpp +++ b/src/gui/PropertiesWindow.hpp @@ -57,10 +57,10 @@ public: private: /** Record of a property (row in the table) */ struct Record { - Record(const Raul::Atom& v, Gtk::Alignment* vw, int r) + Record(const Atom& v, Gtk::Alignment* vw, int r) : value(v), value_widget(vw), row(r) {} - Raul::Atom value; + Atom value; Gtk::Alignment* value_widget; int row; }; @@ -75,16 +75,16 @@ private: }; void add_property(const Raul::URI& uri, - const Raul::Atom& value); + const Atom& value); Gtk::Widget* create_value_widget(const Raul::URI& uri, - const Raul::Atom& value); + const Atom& value); void init(); void reset(); void on_show(); - void property_changed(const Raul::URI& predicate, const Raul::Atom& value); + void property_changed(const Raul::URI& predicate, const Atom& value); void value_edited(const Raul::URI& predicate); void key_changed(); void add_clicked(); diff --git a/src/gui/RenameWindow.cpp b/src/gui/RenameWindow.cpp index 86ca0172..e4d6fe05 100644 --- a/src/gui/RenameWindow.cpp +++ b/src/gui/RenameWindow.cpp @@ -63,7 +63,7 @@ RenameWindow::set_object(SPtr<const ObjectModel> object) { _object = object; _symbol_entry->set_text(object->path().symbol()); - const Raul::Atom& name_atom = object->get_property(_app->uris().lv2_name); + const Atom& name_atom = object->get_property(_app->uris().lv2_name); _label_entry->set_text( (name_atom.type() == _app->forge().String) ? name_atom.ptr<char>() : ""); } @@ -110,11 +110,11 @@ RenameWindow::cancel_clicked() void RenameWindow::ok_clicked() { - const URIs& uris = _app->uris(); - const string& symbol_str = _symbol_entry->get_text(); - const string& label = _label_entry->get_text(); - Raul::Path path = _object->path(); - const Raul::Atom& name_atom = _object->get_property(uris.lv2_name); + const URIs& uris = _app->uris(); + const string& symbol_str = _symbol_entry->get_text(); + const string& label = _label_entry->get_text(); + Raul::Path path = _object->path(); + const Atom& name_atom = _object->get_property(uris.lv2_name); if (Raul::Symbol::is_valid(symbol_str)) { const Raul::Symbol symbol(symbol_str); diff --git a/src/gui/SubgraphModule.cpp b/src/gui/SubgraphModule.cpp index f4e9dc23..63c70278 100644 --- a/src/gui/SubgraphModule.cpp +++ b/src/gui/SubgraphModule.cpp @@ -64,8 +64,8 @@ SubgraphModule::store_location(double ax, double ay) { const URIs& uris = app().uris(); - const Raul::Atom x(app().forge().make(static_cast<float>(ax))); - const Raul::Atom y(app().forge().make(static_cast<float>(ay))); + const Atom x(app().forge().make(static_cast<float>(ax))); + const Atom y(app().forge().make(static_cast<float>(ay))); if (x != _block->get_property(uris.ingen_canvasX) || y != _block->get_property(uris.ingen_canvasY)) diff --git a/src/ingen/main.cpp b/src/ingen/main.cpp index fb866d0f..fc779488 100644 --- a/src/ingen/main.cpp +++ b/src/ingen/main.cpp @@ -155,7 +155,7 @@ main(int argc, char** argv) boost::optional<Raul::Path> parent; boost::optional<Raul::Symbol> symbol; - const Raul::Atom& path_option = conf.option("path"); + const Atom& path_option = conf.option("path"); if (path_option.is_valid()) { if (Raul::Path::is_valid(path_option.ptr<char>())) { const Raul::Path p(path_option.ptr<char>()); diff --git a/src/serialisation/Parser.cpp b/src/serialisation/Parser.cpp index 427b0f02..adc3f208 100644 --- a/src/serialisation/Parser.cpp +++ b/src/serialisation/Parser.cpp @@ -24,6 +24,7 @@ #include <glibmm/miscutils.h> #include <glibmm/ustring.h> +#include "ingen/Atom.hpp" #include "ingen/Interface.hpp" #include "ingen/Log.hpp" #include "ingen/URIMap.hpp" @@ -31,7 +32,6 @@ #include "ingen/World.hpp" #include "ingen/serialisation/Parser.hpp" #include "lv2/lv2plug.in/ns/ext/atom/atom.h" -#include "raul/Atom.hpp" #include "serd/serd.h" #include "sord/sordmm.hpp" #include "sratom/sratom.h" @@ -113,7 +113,7 @@ get_properties(Ingen::World* world, sratom_read(sratom, &forge, world->rdf_world()->c_obj(), model.c_obj(), i.get_object().c_obj()); const LV2_Atom* atom = (const LV2_Atom*)out.buf; - Raul::Atom atomm; + Atom atomm; // FIXME: Don't bloat out all URIs if (atom->type == forge.URID) { atomm = world->forge().alloc_uri( diff --git a/src/serialisation/Serialiser.cpp b/src/serialisation/Serialiser.cpp index d0052b81..db4d8430 100644 --- a/src/serialisation/Serialiser.cpp +++ b/src/serialisation/Serialiser.cpp @@ -472,7 +472,7 @@ Serialiser::Impl::serialise_port(const Node* port, port->has_property(uris.rdf_type, uris.lv2_ControlPort) && port->has_property(uris.rdf_type, uris.lv2_InputPort)) { - const Raul::Atom& val = port->get_property(uris.ingen_value); + const Atom& val = port->get_property(uris.ingen_value); if (val.is_valid()) { props.insert(make_pair(uris.lv2_default, val)); } else { diff --git a/src/server/Broadcaster.hpp b/src/server/Broadcaster.hpp index 3a7eaf44..b77773fe 100644 --- a/src/server/Broadcaster.hpp +++ b/src/server/Broadcaster.hpp @@ -127,9 +127,9 @@ public: BROADCAST(disconnect_all, graph, path); } - void set_property(const Raul::URI& subject, - const Raul::URI& predicate, - const Raul::Atom& value) { + void set_property(const Raul::URI& subject, + const Raul::URI& predicate, + const Atom& value) { BROADCAST(set_property, subject, predicate, value); } diff --git a/src/server/BufferFactory.hpp b/src/server/BufferFactory.hpp index 3bbc542e..b3740bd0 100644 --- a/src/server/BufferFactory.hpp +++ b/src/server/BufferFactory.hpp @@ -21,10 +21,10 @@ #include <map> #include <mutex> +#include "ingen/Atom.hpp" #include "ingen/Forge.hpp" #include "ingen/URIs.hpp" #include "ingen/types.hpp" -#include "raul/Atom.hpp" #include "raul/RingBuffer.hpp" #include "BufferRef.hpp" diff --git a/src/server/Context.cpp b/src/server/Context.cpp index 2ac2ddc2..90e3e184 100644 --- a/src/server/Context.cpp +++ b/src/server/Context.cpp @@ -29,19 +29,19 @@ namespace Server { struct Notification { - inline Notification(PortImpl* p = 0, - FrameTime f = 0, - LV2_URID k = 0, - uint32_t s = 0, - Raul::Atom::TypeID t = 0) + inline Notification(PortImpl* p = 0, + FrameTime f = 0, + LV2_URID k = 0, + uint32_t s = 0, + LV2_URID t = 0) : port(p), time(f), key(k), size(s), type(t) {} - PortImpl* port; - FrameTime time; - LV2_URID key; - uint32_t size; - Raul::Atom::TypeID type; + PortImpl* port; + FrameTime time; + LV2_URID key; + uint32_t size; + LV2_URID type; }; Context::Context(Engine& engine, ID id) @@ -61,12 +61,12 @@ Context::must_notify(const PortImpl* port) const } bool -Context::notify(LV2_URID key, - FrameTime time, - PortImpl* port, - uint32_t size, - Raul::Atom::TypeID type, - const void* body) +Context::notify(LV2_URID key, + FrameTime time, + PortImpl* port, + uint32_t size, + LV2_URID type, + const void* body) { const Notification n(port, time, key, size, type); if (_event_sink.write_space() < sizeof(n) + size) { @@ -94,7 +94,7 @@ Context::emit_notifications(FrameTime end) return; } if (_event_sink.read(sizeof(note), ¬e) == sizeof(note)) { - Raul::Atom value = _engine.world()->forge().alloc( + Atom value = _engine.world()->forge().alloc( note.size, note.type, NULL); if (_event_sink.read(note.size, value.get_body()) == note.size) { i += note.size; diff --git a/src/server/Context.hpp b/src/server/Context.hpp index ea3593b8..076622eb 100644 --- a/src/server/Context.hpp +++ b/src/server/Context.hpp @@ -17,8 +17,8 @@ #ifndef INGEN_ENGINE_CONTEXT_HPP #define INGEN_ENGINE_CONTEXT_HPP +#include "ingen/Atom.hpp" #include "ingen/World.hpp" -#include "raul/Atom.hpp" #include "raul/RingBuffer.hpp" #include "types.hpp" @@ -64,12 +64,12 @@ public: /** Send a notification from this run context. * @return false on failure (ring is full) */ - bool notify(LV2_URID key = 0, - FrameTime time = 0, - PortImpl* port = 0, - uint32_t size = 0, - Raul::Atom::TypeID type = 0, - const void* body = NULL); + bool notify(LV2_URID key = 0, + FrameTime time = 0, + PortImpl* port = 0, + uint32_t size = 0, + LV2_URID type = 0, + const void* body = NULL); /** Emit pending notifications in some other non-realtime thread. */ void emit_notifications(FrameTime end); diff --git a/src/server/ControlBindings.cpp b/src/server/ControlBindings.cpp index 12a895f7..60e5c4e0 100644 --- a/src/server/ControlBindings.cpp +++ b/src/server/ControlBindings.cpp @@ -58,12 +58,12 @@ ControlBindings::port_binding(PortImpl* port) const { ThreadManager::assert_thread(THREAD_PRE_PROCESS); const Ingen::URIs& uris = _engine.world()->uris(); - const Raul::Atom& binding = port->get_property(uris.ingen_controlBinding); + const Atom& binding = port->get_property(uris.ingen_controlBinding); return binding_key(binding); } ControlBindings::Key -ControlBindings::binding_key(const Raul::Atom& binding) const +ControlBindings::binding_key(const Atom& binding) const { const Ingen::URIs& uris = _engine.world()->uris(); Key key; @@ -124,9 +124,9 @@ ControlBindings::midi_event_key(uint16_t size, const uint8_t* buf, uint16_t& val } void -ControlBindings::port_binding_changed(ProcessContext& context, - PortImpl* port, - const Raul::Atom& binding) +ControlBindings::port_binding_changed(ProcessContext& context, + PortImpl* port, + const Atom& binding) { const Key key = binding_key(binding); if (key) { @@ -135,10 +135,10 @@ ControlBindings::port_binding_changed(ProcessContext& context, } void -ControlBindings::port_value_changed(ProcessContext& context, - PortImpl* port, - Key key, - const Raul::Atom& value_atom) +ControlBindings::port_value_changed(ProcessContext& context, + PortImpl* port, + Key key, + const Atom& value_atom) { Ingen::World* world = context.engine().world(); const Ingen::URIs& uris = world->uris(); @@ -202,7 +202,7 @@ get_range(ProcessContext& context, const PortImpl* port, float* min, float* max) } } -Raul::Atom +Atom ControlBindings::control_to_port_value(ProcessContext& context, const PortImpl* port, Type type, @@ -235,10 +235,10 @@ ControlBindings::control_to_port_value(ProcessContext& context, } int16_t -ControlBindings::port_value_to_control(ProcessContext& context, - PortImpl* port, - Type type, - const Raul::Atom& value_atom) const +ControlBindings::port_value_to_control(ProcessContext& context, + PortImpl* port, + Type type, + const Atom& value_atom) const { if (value_atom.type() != port->bufs().forge().Float) return 0; @@ -314,7 +314,7 @@ ControlBindings::set_port_value(ProcessContext& context, float min, max; get_range(context, port, &min, &max); - const Raul::Atom port_value(control_to_port_value(context, port, type, value)); + const Atom port_value(control_to_port_value(context, port, type, value)); assert(port_value.type() == port->bufs().forge().Float); port->set_value(port_value); // FIXME: not thread safe diff --git a/src/server/ControlBindings.hpp b/src/server/ControlBindings.hpp index 26e9dd93..57a361c2 100644 --- a/src/server/ControlBindings.hpp +++ b/src/server/ControlBindings.hpp @@ -20,9 +20,9 @@ #include <map> #include <stdint.h> +#include "ingen/Atom.hpp" #include "ingen/types.hpp" #include "lv2/lv2plug.in/ns/ext/atom/forge.h" -#include "raul/Atom.hpp" #include "raul/Path.hpp" #include "BufferFactory.hpp" @@ -62,18 +62,18 @@ public: ~ControlBindings(); Key port_binding(PortImpl* port) const; - Key binding_key(const Raul::Atom& binding) const; + Key binding_key(const Atom& binding) const; void learn(PortImpl* port); void port_binding_changed(ProcessContext& context, PortImpl* port, - const Raul::Atom& binding); + const Atom& binding); void port_value_changed(ProcessContext& context, PortImpl* port, Key key, - const Raul::Atom& value); + const Atom& value); void pre_process(ProcessContext& context, Buffer* control_in); void post_process(ProcessContext& context, Buffer* control_out); @@ -93,18 +93,22 @@ public: private: Key midi_event_key(uint16_t size, const uint8_t* buf, uint16_t& value); - void set_port_value(ProcessContext& context, PortImpl* port, Type type, int16_t value); + void set_port_value(ProcessContext& context, + PortImpl* port, + Type type, + int16_t value); + bool bind(ProcessContext& context, Key key); - Raul::Atom control_to_port_value(ProcessContext& context, - const PortImpl* port, - Type type, - int16_t value) const; + Atom control_to_port_value(ProcessContext& context, + const PortImpl* port, + Type type, + int16_t value) const; - int16_t port_value_to_control(ProcessContext& context, - PortImpl* port, - Type type, - const Raul::Atom& value) const; + int16_t port_value_to_control(ProcessContext& context, + PortImpl* port, + Type type, + const Atom& value) const; Engine& _engine; PortImpl* _learn_port; diff --git a/src/server/DuplexPort.cpp b/src/server/DuplexPort.cpp index 65152d02..6049e001 100644 --- a/src/server/DuplexPort.cpp +++ b/src/server/DuplexPort.cpp @@ -34,7 +34,7 @@ DuplexPort::DuplexPort(BufferFactory& bufs, uint32_t poly, PortType type, LV2_URID buffer_type, - const Raul::Atom& value, + const Atom& value, size_t buffer_size, bool is_output) : PortImpl(bufs, parent, symbol, index, poly, type, buffer_type, value, buffer_size) diff --git a/src/server/DuplexPort.hpp b/src/server/DuplexPort.hpp index 55ba8fa0..a7ad58bd 100644 --- a/src/server/DuplexPort.hpp +++ b/src/server/DuplexPort.hpp @@ -50,7 +50,7 @@ public: uint32_t poly, PortType type, LV2_URID buffer_type, - const Raul::Atom& value, + const Atom& value, size_t buffer_size, bool is_output); diff --git a/src/server/EventWriter.cpp b/src/server/EventWriter.cpp index 0c27bc5f..27435511 100644 --- a/src/server/EventWriter.cpp +++ b/src/server/EventWriter.cpp @@ -112,9 +112,9 @@ EventWriter::disconnect_all(const Raul::Path& graph, } void -EventWriter::set_property(const Raul::URI& uri, - const Raul::URI& predicate, - const Raul::Atom& value) +EventWriter::set_property(const Raul::URI& uri, + const Raul::URI& predicate, + const Atom& value) { Resource::Properties remove; remove.insert( diff --git a/src/server/EventWriter.hpp b/src/server/EventWriter.hpp index 6d0fd2d2..89493051 100644 --- a/src/server/EventWriter.hpp +++ b/src/server/EventWriter.hpp @@ -74,8 +74,8 @@ public: const Raul::Path& head); virtual void set_property(const Raul::URI& subject_path, - const Raul::URI& predicate, - const Raul::Atom& value); + const Raul::URI& predicate, + const Atom& value); virtual void del(const Raul::URI& uri); diff --git a/src/server/GraphImpl.cpp b/src/server/GraphImpl.cpp index f31994b9..8621106f 100644 --- a/src/server/GraphImpl.cpp +++ b/src/server/GraphImpl.cpp @@ -245,7 +245,7 @@ GraphImpl::create_port(BufferFactory& bufs, return NULL; } - Raul::Atom value; + Atom value; if (type == PortType::CONTROL || type == PortType::CV) value = bufs.forge().make(0.0f); diff --git a/src/server/InputPort.cpp b/src/server/InputPort.cpp index 0d1a2d0e..34c71116 100644 --- a/src/server/InputPort.cpp +++ b/src/server/InputPort.cpp @@ -43,7 +43,7 @@ InputPort::InputPort(BufferFactory& bufs, uint32_t poly, PortType type, LV2_URID buffer_type, - const Raul::Atom& value, + const Atom& value, size_t buffer_size) : PortImpl(bufs, parent, symbol, index, poly, type, buffer_type, value, buffer_size) , _num_arcs(0) diff --git a/src/server/InputPort.hpp b/src/server/InputPort.hpp index 1f82425e..d1082b71 100644 --- a/src/server/InputPort.hpp +++ b/src/server/InputPort.hpp @@ -57,8 +57,8 @@ public: uint32_t poly, PortType type, LV2_URID buffer_type, - const Raul::Atom& value, - size_t buffer_size=0); + const Atom& value, + size_t buffer_size = 0); virtual ~InputPort() {} diff --git a/src/server/LV2Block.cpp b/src/server/LV2Block.cpp index fba06b19..66ac0d70 100644 --- a/src/server/LV2Block.cpp +++ b/src/server/LV2Block.cpp @@ -230,11 +230,11 @@ LV2Block::instantiate(BufferFactory& bufs) lilv_node_as_string(lilv_port_get_symbol(plug, id))); // Get port type - Raul::Atom val; - PortType port_type = PortType::UNKNOWN; - LV2_URID buffer_type = 0; - bool is_morph = false; - bool is_auto_morph = false; + Atom val; + PortType port_type = PortType::UNKNOWN; + LV2_URID buffer_type = 0; + bool is_morph = false; + bool is_auto_morph = false; if (lilv_port_is_a(plug, id, info->lv2_ControlPort)) { if (lilv_port_is_a(plug, id, info->morph_MorphPort)) { is_morph = true; diff --git a/src/server/NodeImpl.cpp b/src/server/NodeImpl.cpp index 3fe7a2a4..4d7a42b6 100644 --- a/src/server/NodeImpl.cpp +++ b/src/server/NodeImpl.cpp @@ -33,11 +33,11 @@ NodeImpl::NodeImpl(Ingen::URIs& uris, { } -const Raul::Atom& +const Atom& NodeImpl::get_property(const Raul::URI& key) const { ThreadManager::assert_not_thread(THREAD_PROCESS); - static const Raul::Atom null_atom; + static const Atom null_atom; Resource::Properties::const_iterator i = properties().find(key); return (i != properties().end()) ? i->second : null_atom; } diff --git a/src/server/NodeImpl.hpp b/src/server/NodeImpl.hpp index 60aa2d3d..a51d6fe5 100644 --- a/src/server/NodeImpl.hpp +++ b/src/server/NodeImpl.hpp @@ -67,7 +67,7 @@ public: set_uri(Node::path_to_uri(new_path)); } - const Raul::Atom& get_property(const Raul::URI& key) const; + const Atom& get_property(const Raul::URI& key) const; /** The Graph this object is a child of. */ virtual GraphImpl* parent_graph() const; diff --git a/src/server/OutputPort.cpp b/src/server/OutputPort.cpp index 492e5419..881c6782 100644 --- a/src/server/OutputPort.cpp +++ b/src/server/OutputPort.cpp @@ -34,7 +34,7 @@ OutputPort::OutputPort(BufferFactory& bufs, uint32_t poly, PortType type, LV2_URID buffer_type, - const Raul::Atom& value, + const Atom& value, size_t buffer_size) : PortImpl(bufs, parent, symbol, index, poly, type, buffer_type, value, buffer_size) { diff --git a/src/server/OutputPort.hpp b/src/server/OutputPort.hpp index b117847f..1fe8c957 100644 --- a/src/server/OutputPort.hpp +++ b/src/server/OutputPort.hpp @@ -45,8 +45,8 @@ public: uint32_t poly, PortType type, LV2_URID buffer_type, - const Raul::Atom& value, - size_t buffer_size=0); + const Atom& value, + size_t buffer_size = 0); virtual ~OutputPort() {} diff --git a/src/server/PortImpl.cpp b/src/server/PortImpl.cpp index f1dacd68..b3590d1f 100644 --- a/src/server/PortImpl.cpp +++ b/src/server/PortImpl.cpp @@ -50,7 +50,7 @@ PortImpl::PortImpl(BufferFactory& bufs, uint32_t poly, PortType type, LV2_URID buffer_type, - const Raul::Atom& value, + const Atom& value, size_t buffer_size) : NodeImpl(bufs.uris(), block, name) , _bufs(bufs) diff --git a/src/server/PortImpl.hpp b/src/server/PortImpl.hpp index f4c80aaf..c980a134 100644 --- a/src/server/PortImpl.hpp +++ b/src/server/PortImpl.hpp @@ -19,8 +19,8 @@ #include <cstdlib> +#include "ingen/Atom.hpp" #include "raul/Array.hpp" -#include "raul/Atom.hpp" #include "BufferRef.hpp" #include "NodeImpl.hpp" @@ -72,18 +72,18 @@ public: virtual bool apply_poly( ProcessContext& context, Raul::Maid& maid, uint32_t poly); - const Raul::Atom& value() const { return _value; } - void set_value(const Raul::Atom& v) { _value = v; } + const Atom& value() const { return _value; } + void set_value(const Atom& v) { _value = v; } - const Raul::Atom& minimum() const { return _min; } - const Raul::Atom& maximum() const { return _max; } + const Atom& minimum() const { return _min; } + const Atom& maximum() const { return _max; } /* The following two methods store the range in variables so it can be accessed in the process thread, which is required for applying control bindings from incoming MIDI data. */ - void set_minimum(const Raul::Atom& min) { _min = min; } - void set_maximum(const Raul::Atom& max) { _max = max; } + void set_minimum(const Atom& min) { _min = min; } + void set_maximum(const Atom& max) { _max = max; } inline BufferRef buffer(uint32_t voice) const { return _buffers->at((_poly == 1) ? 0 : voice); @@ -189,7 +189,7 @@ protected: uint32_t poly, PortType type, LV2_URID buffer_type, - const Raul::Atom& value, + const Atom& value, size_t buffer_size); struct SetState { @@ -211,9 +211,9 @@ protected: float _peak; PortType _type; LV2_URID _buffer_type; - Raul::Atom _value; - Raul::Atom _min; - Raul::Atom _max; + Atom _value; + Atom _min; + Atom _max; Raul::Array<SetState>* _set_states; Raul::Array<SetState>* _prepared_set_states; Raul::Array<BufferRef>* _buffers; diff --git a/src/server/events/CreatePort.cpp b/src/server/events/CreatePort.cpp index 4687e44e..a5fea0da 100644 --- a/src/server/events/CreatePort.cpp +++ b/src/server/events/CreatePort.cpp @@ -16,11 +16,11 @@ #include <utility> +#include "ingen/Atom.hpp" #include "ingen/Store.hpp" #include "ingen/URIMap.hpp" #include "ingen/URIs.hpp" #include "raul/Array.hpp" -#include "raul/Atom.hpp" #include "raul/Path.hpp" #include "Broadcaster.hpp" @@ -62,7 +62,7 @@ CreatePort::CreatePort(Engine& engine, const Range types = properties.equal_range(uris.rdf_type); for (Iterator i = types.first; i != types.second; ++i) { - const Raul::Atom& type = i->second; + const Atom& type = i->second; if (type == uris.lv2_AudioPort) { _port_type = PortType::AUDIO; } else if (type == uris.lv2_ControlPort) { diff --git a/src/server/events/Delta.cpp b/src/server/events/Delta.cpp index 28eccc71..f8a5b23c 100644 --- a/src/server/events/Delta.cpp +++ b/src/server/events/Delta.cpp @@ -150,7 +150,7 @@ Delta::pre_process() for (const auto& r : _remove) { const Raul::URI& key = r.first; - const Raul::Atom& value = r.second; + const Atom& value = r.second; if (key == uris.ingen_controlBinding && value == uris.wildcard) { PortImpl* port = dynamic_cast<PortImpl*>(_object); if (port) @@ -289,7 +289,7 @@ Delta::execute(ProcessContext& context) std::vector<SpecialType>::const_iterator t = _types.begin(); for (const auto& p : _properties) { const Raul::URI& key = p.first; - const Raul::Atom& value = p.second; + const Atom& value = p.second; switch (*t) { case SpecialType::ENABLE_BROADCAST: if (port) { diff --git a/src/server/events/SetPortValue.cpp b/src/server/events/SetPortValue.cpp index 0d68b1af..6b149ee2 100644 --- a/src/server/events/SetPortValue.cpp +++ b/src/server/events/SetPortValue.cpp @@ -34,12 +34,12 @@ namespace Server { namespace Events { /** Internal */ -SetPortValue::SetPortValue(Engine& engine, - SPtr<Interface> client, - int32_t id, - SampleCount timestamp, - PortImpl* port, - const Raul::Atom& value) +SetPortValue::SetPortValue(Engine& engine, + SPtr<Interface> client, + int32_t id, + SampleCount timestamp, + PortImpl* port, + const Atom& value) : Event(engine, client, id, timestamp) , _port(port) , _value(value) diff --git a/src/server/events/SetPortValue.hpp b/src/server/events/SetPortValue.hpp index 32e8f768..0c4e8b11 100644 --- a/src/server/events/SetPortValue.hpp +++ b/src/server/events/SetPortValue.hpp @@ -17,7 +17,7 @@ #ifndef INGEN_EVENTS_SETPORTVALUE_HPP #define INGEN_EVENTS_SETPORTVALUE_HPP -#include "raul/Atom.hpp" +#include "ingen/Atom.hpp" #include "ControlBindings.hpp" #include "Event.hpp" @@ -37,12 +37,12 @@ namespace Events { class SetPortValue : public Event { public: - SetPortValue(Engine& engine, - SPtr<Interface> client, - int32_t id, - SampleCount timestamp, - PortImpl* port, - const Raul::Atom& value); + SetPortValue(Engine& engine, + SPtr<Interface> client, + int32_t id, + SampleCount timestamp, + PortImpl* port, + const Atom& value); ~SetPortValue(); @@ -54,7 +54,7 @@ private: void apply(Context& context); PortImpl* _port; - const Raul::Atom _value; + const Atom _value; ControlBindings::Key _binding; }; diff --git a/src/server/ingen_jack.cpp b/src/server/ingen_jack.cpp index 07b80876..474dca73 100644 --- a/src/server/ingen_jack.cpp +++ b/src/server/ingen_jack.cpp @@ -16,12 +16,12 @@ #include <string> +#include "ingen/Atom.hpp" #include "ingen/Configuration.hpp" #include "ingen/Configuration.hpp" #include "ingen/Log.hpp" #include "ingen/Module.hpp" #include "ingen/World.hpp" -#include "raul/Atom.hpp" #include "JackDriver.hpp" #include "Engine.hpp" @@ -38,7 +38,7 @@ struct IngenJackModule : public Ingen::Module { Server::JackDriver* driver = new Server::JackDriver( *(Server::Engine*)world->engine().get()); - const Raul::Atom& s = world->conf().option("jack-server"); + const Atom& s = world->conf().option("jack-server"); const std::string server_name = s.is_valid() ? s.ptr<char>() : ""; driver->attach(server_name, world->conf().option("jack-name").ptr<char>(), diff --git a/src/server/internals/Controller.cpp b/src/server/internals/Controller.cpp index 5c3bf6f6..dd693eb3 100644 --- a/src/server/internals/Controller.cpp +++ b/src/server/internals/Controller.cpp @@ -54,7 +54,7 @@ ControllerNode::ControllerNode(InternalPlugin* plugin, _ports = new Raul::Array<PortImpl*>(6); _midi_in_port = new InputPort(bufs, this, Raul::Symbol("input"), 0, 1, - PortType::ATOM, uris.atom_Sequence, Raul::Atom()); + PortType::ATOM, uris.atom_Sequence, Atom()); _midi_in_port->set_property(uris.lv2_name, bufs.forge().alloc("Input")); _ports->at(0) = _midi_in_port; diff --git a/src/server/internals/Note.cpp b/src/server/internals/Note.cpp index 37cebd7e..f7d0e16c 100644 --- a/src/server/internals/Note.cpp +++ b/src/server/internals/Note.cpp @@ -61,7 +61,7 @@ NoteNode::NoteNode(InternalPlugin* plugin, _ports = new Raul::Array<PortImpl*>(6); _midi_in_port = new InputPort(bufs, this, Raul::Symbol("input"), 0, 1, - PortType::ATOM, uris.atom_Sequence, Raul::Atom()); + PortType::ATOM, uris.atom_Sequence, Atom()); _midi_in_port->set_property(uris.lv2_name, bufs.forge().alloc("Input")); _ports->at(0) = _midi_in_port; diff --git a/src/server/internals/Time.cpp b/src/server/internals/Time.cpp index 7fcbccbb..22e714b0 100644 --- a/src/server/internals/Time.cpp +++ b/src/server/internals/Time.cpp @@ -49,7 +49,7 @@ TimeNode::TimeNode(InternalPlugin* plugin, _notify_port = new OutputPort( bufs, this, Raul::Symbol("notify"), 0, 1, - PortType::ATOM, uris.atom_Sequence, Raul::Atom(), 1024); + PortType::ATOM, uris.atom_Sequence, Atom(), 1024); _notify_port->set_property(uris.lv2_name, bufs.forge().alloc("Notify")); _notify_port->set_property(uris.atom_supports, bufs.forge().make_urid(uris.time_Position)); diff --git a/src/server/internals/Trigger.cpp b/src/server/internals/Trigger.cpp index 6563e276..78f87b34 100644 --- a/src/server/internals/Trigger.cpp +++ b/src/server/internals/Trigger.cpp @@ -54,7 +54,7 @@ TriggerNode::TriggerNode(InternalPlugin* plugin, _ports = new Raul::Array<PortImpl*>(5); _midi_in_port = new InputPort(bufs, this, Raul::Symbol("input"), 0, 1, - PortType::ATOM, uris.atom_Sequence, Raul::Atom()); + PortType::ATOM, uris.atom_Sequence, Atom()); _midi_in_port->set_property(uris.lv2_name, bufs.forge().alloc("Input")); _ports->at(0) = _midi_in_port; diff --git a/tests/ingen_test.cpp b/tests/ingen_test.cpp index f0300728..27508a7a 100644 --- a/tests/ingen_test.cpp +++ b/tests/ingen_test.cpp @@ -96,9 +96,9 @@ public: void disconnect_all(const Raul::Path& parent_patch_path, const Raul::Path& path) {} - void set_property(const Raul::URI& subject, - const Raul::URI& predicate, - const Raul::Atom& value) {} + void set_property(const Raul::URI& subject, + const Raul::URI& predicate, + const Atom& value) {} void set_response_id(int32_t id) {} |