diff options
100 files changed, 431 insertions, 348 deletions
diff --git a/src/client/HTTPClientReceiver.cpp b/src/client/HTTPClientReceiver.cpp index 78e0ef7c..bafcae9f 100644 --- a/src/client/HTTPClientReceiver.cpp +++ b/src/client/HTTPClientReceiver.cpp @@ -30,6 +30,7 @@ using namespace std; using namespace Raul; namespace Ingen { +using namespace Serialisation; namespace Client { diff --git a/src/client/HTTPClientReceiver.hpp b/src/client/HTTPClientReceiver.hpp index 60b458ac..c0f979f4 100644 --- a/src/client/HTTPClientReceiver.hpp +++ b/src/client/HTTPClientReceiver.hpp @@ -68,10 +68,10 @@ private: Glib::Mutex _mutex; SharedPtr<Shared::ClientInterface> _target; - Shared::World* _world; - const std::string _url; - SoupSession* _session; - SharedPtr<Parser> _parser; + Shared::World* _world; + const std::string _url; + SoupSession* _session; + SharedPtr<Serialisation::Parser> _parser; }; diff --git a/src/client/PortModel.hpp b/src/client/PortModel.hpp index 23fce480..90b11ae0 100644 --- a/src/client/PortModel.hpp +++ b/src/client/PortModel.hpp @@ -42,7 +42,7 @@ public: enum Direction { INPUT, OUTPUT }; inline uint32_t index() const { return _index; } - inline DataType type() const { return _type; } + inline Shared::DataType type() const { return _type; } inline const Raul::Atom& value() const { return _current_val; } inline bool connected() const { return (_connections > 0); } inline bool is_input() const { return (_direction == INPUT); } @@ -78,7 +78,7 @@ public: private: friend class ClientStore; - PortModel(const Raul::Path& path, uint32_t index, DataType type, Direction dir) + PortModel(const Raul::Path& path, uint32_t index, Shared::DataType type, Direction dir) : ObjectModel(path) , _index(index) , _type(type) @@ -86,7 +86,7 @@ private: , _current_val(0.0f) , _connections(0) { - if (_type == DataType::UNKNOWN) + if (_type == Shared::DataType::UNKNOWN) std::cerr << "[PortModel] Warning: Unknown port type" << std::endl; } @@ -98,11 +98,11 @@ private: void set(SharedPtr<ObjectModel> model); - uint32_t _index; - DataType _type; - Direction _direction; - Raul::Atom _current_val; - size_t _connections; + uint32_t _index; + Shared::DataType _type; + Direction _direction; + Raul::Atom _current_val; + size_t _connections; }; diff --git a/src/common/interface/DataType.hpp b/src/common/interface/DataType.hpp index c2ef6674..80d3e5e9 100644 --- a/src/common/interface/DataType.hpp +++ b/src/common/interface/DataType.hpp @@ -89,6 +89,4 @@ private: } // namespace Shared } // namespace Ingen -using Ingen::Shared::DataType; - #endif // DATATYPE_H diff --git a/src/common/interface/EventType.hpp b/src/common/interface/EventType.hpp index d74835e6..6d662b7e 100644 --- a/src/common/interface/EventType.hpp +++ b/src/common/interface/EventType.hpp @@ -74,6 +74,4 @@ private: } // namespace Shared } // namespace Ingen -using Ingen::Shared::EventType; - #endif // EVENTTYPE_H diff --git a/src/common/interface/Port.hpp b/src/common/interface/Port.hpp index f4d7ea67..09a886f1 100644 --- a/src/common/interface/Port.hpp +++ b/src/common/interface/Port.hpp @@ -38,7 +38,7 @@ class Port : public virtual GraphObject public: virtual uint32_t index() const = 0; virtual bool is_input() const = 0; - virtual DataType type() const = 0; + virtual Shared::DataType type() const = 0; virtual const Raul::Atom& value() const = 0; }; diff --git a/src/engine/AudioBuffer.cpp b/src/engine/AudioBuffer.cpp index 5e649f3b..c621c18c 100644 --- a/src/engine/AudioBuffer.cpp +++ b/src/engine/AudioBuffer.cpp @@ -28,6 +28,8 @@ using namespace std; namespace Ingen { +using namespace Shared; + AudioBuffer::AudioBuffer(size_t size) : Buffer((size == 1) ? DataType::CONTROL : DataType::AUDIO, size) diff --git a/src/engine/AudioDriver.hpp b/src/engine/AudioDriver.hpp index fb3b5320..265bb3ec 100644 --- a/src/engine/AudioDriver.hpp +++ b/src/engine/AudioDriver.hpp @@ -40,7 +40,7 @@ class ProcessContext; class AudioDriver : public Driver { public: - AudioDriver() : Driver(DataType::AUDIO) {} + AudioDriver() : Driver(Shared::DataType::AUDIO) {} virtual void set_root_patch(PatchImpl* patch) = 0; virtual PatchImpl* root_patch() = 0; diff --git a/src/engine/Buffer.cpp b/src/engine/Buffer.cpp index d019146c..49ce1136 100644 --- a/src/engine/Buffer.cpp +++ b/src/engine/Buffer.cpp @@ -20,6 +20,7 @@ namespace Ingen { +using namespace Shared; Buffer* Buffer::create(DataType type, size_t size) diff --git a/src/engine/ClientBroadcaster.cpp b/src/engine/ClientBroadcaster.cpp index b81a4f8a..9238ecdb 100644 --- a/src/engine/ClientBroadcaster.cpp +++ b/src/engine/ClientBroadcaster.cpp @@ -27,6 +27,7 @@ #include "util.hpp" using namespace std; +using namespace Raul; using Ingen::Shared::ClientInterface; namespace Ingen { diff --git a/src/engine/ClientBroadcaster.hpp b/src/engine/ClientBroadcaster.hpp index 72d1dd90..33269192 100644 --- a/src/engine/ClientBroadcaster.hpp +++ b/src/engine/ClientBroadcaster.hpp @@ -26,9 +26,6 @@ #include "interface/ClientInterface.hpp" #include "NodeFactory.hpp" -using Raul::URI; -using Raul::Path; - namespace Ingen { class GraphObjectImpl; @@ -37,7 +34,6 @@ class PortImpl; class PluginImpl; class PatchImpl; class ConnectionImpl; -using Shared::ClientInterface; /** Broadcaster for all clients. @@ -53,10 +49,10 @@ using Shared::ClientInterface; class ClientBroadcaster { public: - void register_client(const URI& uri, ClientInterface* client); - bool unregister_client(const URI& uri); + void register_client(const Raul::URI& uri, Shared::ClientInterface* client); + bool unregister_client(const Raul::URI& uri); - ClientInterface* client(const URI& uri); + Shared::ClientInterface* client(const Raul::URI& uri); //void send_client_registration(const string& url, int client_id); @@ -68,22 +64,22 @@ public: void send_plugins(const NodeFactory::Plugins& plugin_list); void send_object(const GraphObjectImpl* p, bool recursive); - void send_destroyed(const Path& path); - void send_clear_patch(const Path& patch_path); + void send_destroyed(const Raul::Path& path); + void send_clear_patch(const Raul::Path& patch_path); void send_connection(const SharedPtr<const ConnectionImpl> connection); - void send_disconnection(const Path& src_port_path, const Path& dst_port_path); - void send_rename(const Path& old_path, const Path& new_path); - void send_variable_change(const Path& node_path, const URI& key, const Raul::Atom& value); - void send_property_change(const Path& node_path, const URI& key, const Raul::Atom& value); - void send_port_value(const Path& port_path, const Raul::Atom& value); - void send_activity(const Path& path); - void send_program_add(const Path& node_path, int bank, int program, const std::string& name); - void send_program_remove(const Path& node_path, int bank, int program); + void send_disconnection(const Raul::Path& src_port_path, const Raul::Path& dst_port_path); + void send_rename(const Raul::Path& old_path, const Raul::Path& new_path); + void send_variable_change(const Raul::Path& node_path, const Raul::URI& key, const Raul::Atom& value); + void send_property_change(const Raul::Path& node_path, const Raul::URI& key, const Raul::Atom& value); + void send_port_value(const Raul::Path& port_path, const Raul::Atom& value); + void send_activity(const Raul::Path& path); + void send_program_add(const Raul::Path& node_path, int bank, int program, const std::string& name); + void send_program_remove(const Raul::Path& node_path, int bank, int program); - void send_plugins_to(ClientInterface*, const NodeFactory::Plugins& plugin_list); + void send_plugins_to(Shared::ClientInterface*, const NodeFactory::Plugins& plugin_list); private: - typedef std::map<URI, ClientInterface*> Clients; + typedef std::map<Raul::URI, Shared::ClientInterface*> Clients; Clients _clients; }; diff --git a/src/engine/CompiledPatch.hpp b/src/engine/CompiledPatch.hpp index c412cbb8..4c62f494 100644 --- a/src/engine/CompiledPatch.hpp +++ b/src/engine/CompiledPatch.hpp @@ -24,35 +24,31 @@ #include "raul/Deletable.hpp" #include <boost/utility.hpp> -using Raul::List; - -using namespace std; - namespace Ingen { /** All information required about a node to execute it in an audio thread. */ struct CompiledNode { - CompiledNode(NodeImpl* n, size_t np, List<NodeImpl*>* d) + CompiledNode(NodeImpl* n, size_t np, Raul::List<NodeImpl*>* d) : _node(n), _n_providers(np) { // Copy to a vector for maximum iteration speed and cache optimization // (Need to take a copy anyway) _dependants.reserve(d->size()); - for (List<NodeImpl*>::iterator i = d->begin(); i != d->end(); ++i) + for (Raul::List<NodeImpl*>::iterator i = d->begin(); i != d->end(); ++i) _dependants.push_back(*i); } - NodeImpl* node() const { return _node; } - size_t n_providers() const { return _n_providers; } - const vector<NodeImpl*>& dependants() const { return _dependants; } + NodeImpl* node() const { return _node; } + size_t n_providers() const { return _n_providers; } + const std::vector<NodeImpl*>& dependants() const { return _dependants; } private: - NodeImpl* _node; - size_t _n_providers; ///< Number of input ready signals to trigger run - vector<NodeImpl*> _dependants; ///< Nodes this one's output ports are connected to + NodeImpl* _node; + size_t _n_providers; ///< Number of input ready signals to trigger run + std::vector<NodeImpl*> _dependants; ///< Nodes this one's output ports are connected to }; diff --git a/src/engine/ConnectionImpl.cpp b/src/engine/ConnectionImpl.cpp index 79361295..3ec1a3f8 100644 --- a/src/engine/ConnectionImpl.cpp +++ b/src/engine/ConnectionImpl.cpp @@ -25,6 +25,7 @@ namespace Ingen { +using namespace Shared; /** Constructor for a connection from a node's output port. * diff --git a/src/engine/ConnectionImpl.hpp b/src/engine/ConnectionImpl.hpp index 3b357906..48bc72df 100644 --- a/src/engine/ConnectionImpl.hpp +++ b/src/engine/ConnectionImpl.hpp @@ -75,7 +75,7 @@ public: inline bool need_buffer() const { return must_mix(); } inline bool can_direct() const { return _mode == DIRECT; } - DataType type() const { return _src_port->type(); } + Shared::DataType type() const { return _src_port->type(); } protected: enum { DIRECT, MIX, COPY, EXTEND } _mode; diff --git a/src/engine/Driver.hpp b/src/engine/Driver.hpp index e03c316d..5493fdb8 100644 --- a/src/engine/Driver.hpp +++ b/src/engine/Driver.hpp @@ -71,7 +71,7 @@ protected: class Driver : boost::noncopyable { public: - Driver(DataType type) + Driver(Shared::DataType type) : _type(type) {} @@ -95,7 +95,7 @@ public: virtual Raul::List<DriverPort*>::Node* remove_port(const Raul::Path& path) = 0; protected: - DataType _type; + Shared::DataType _type; }; diff --git a/src/engine/DuplexPort.cpp b/src/engine/DuplexPort.cpp index 9c1f4be6..5912174b 100644 --- a/src/engine/DuplexPort.cpp +++ b/src/engine/DuplexPort.cpp @@ -30,6 +30,8 @@ using namespace std; namespace Ingen { +using namespace Shared; + DuplexPort::DuplexPort( NodeImpl* parent, diff --git a/src/engine/DuplexPort.hpp b/src/engine/DuplexPort.hpp index 31a64ded..f76843a4 100644 --- a/src/engine/DuplexPort.hpp +++ b/src/engine/DuplexPort.hpp @@ -43,7 +43,7 @@ public: const std::string& name, uint32_t index, uint32_t poly, - DataType type, + Shared::DataType type, const Raul::Atom& value, size_t buffer_size, bool is_output); diff --git a/src/engine/Engine.cpp b/src/engine/Engine.cpp index 691f789a..9bbc74f3 100644 --- a/src/engine/Engine.cpp +++ b/src/engine/Engine.cpp @@ -43,10 +43,13 @@ #include "ThreadManager.hpp" #include "shared/Store.hpp" #include "tuning.hpp" + using namespace std; namespace Ingen { +using namespace Shared; + Engine::Engine(Ingen::Shared::World* world) : _world(world) @@ -63,7 +66,7 @@ Engine::Engine(Ingen::Shared::World* world) if (world->store) { assert(PtrCast<EngineStore>(world->store)); } else { - world->store = SharedPtr<Store>(new EngineStore()); + world->store = SharedPtr<Shared::Store>(new EngineStore()); } } @@ -128,7 +131,7 @@ Engine::set_driver(DataType type, SharedPtr<Driver> driver) int Engine::main() { - Thread::get().set_context(THREAD_POST_PROCESS); + Raul::Thread::get().set_context(THREAD_POST_PROCESS); // Loop until quit flag is set (by OSCReceiver) while ( ! _quit_flag) { diff --git a/src/engine/Engine.hpp b/src/engine/Engine.hpp index 68755d85..5d17d304 100644 --- a/src/engine/Engine.hpp +++ b/src/engine/Engine.hpp @@ -92,10 +92,10 @@ public: SharedPtr<EngineStore> engine_store() const; /** Return the active driver for the given type */ - Driver* driver(DataType type, EventType event_type); + Driver* driver(Shared::DataType type, Shared::EventType event_type); /** Set the driver for the given data type (replacing the old) */ - virtual void set_driver(DataType type, SharedPtr<Driver> driver); + virtual void set_driver(Shared::DataType type, SharedPtr<Driver> driver); virtual void set_midi_driver(MidiDriver* driver); virtual void add_event_source(SharedPtr<EventSource> source); diff --git a/src/engine/EngineStore.cpp b/src/engine/EngineStore.cpp index 2d0dba40..420c6b49 100644 --- a/src/engine/EngineStore.cpp +++ b/src/engine/EngineStore.cpp @@ -75,7 +75,7 @@ EngineStore::find_object(const Path& path) /** Add an object to the store. Not realtime safe. */ void -EngineStore::add(GraphObject* obj) +EngineStore::add(Shared::GraphObject* obj) { assert(ThreadManager::current_thread_id() == THREAD_PRE_PROCESS); Store::add(obj); diff --git a/src/engine/EngineStore.hpp b/src/engine/EngineStore.hpp index 7786f596..a6782501 100644 --- a/src/engine/EngineStore.hpp +++ b/src/engine/EngineStore.hpp @@ -22,9 +22,6 @@ #include "raul/SharedPtr.hpp" #include "shared/Store.hpp" -using std::string; -using namespace Raul; - namespace Ingen { namespace Shared { class GraphObject; } @@ -47,17 +44,17 @@ class GraphObjectImpl; class EngineStore : public Shared::Store { public: - PatchImpl* find_patch(const Path& path); - NodeImpl* find_node(const Path& path); - PortImpl* find_port(const Path& path); - GraphObjectImpl* find_object(const Path& path); + PatchImpl* find_patch(const Raul::Path& path); + NodeImpl* find_node(const Raul::Path& path); + PortImpl* find_port(const Raul::Path& path); + GraphObjectImpl* find_object(const Raul::Path& path); void add(Shared::GraphObject* o); void add(const Objects& family); - SharedPtr<Objects> remove(const Path& path); + SharedPtr<Objects> remove(const Raul::Path& path); SharedPtr<Objects> remove(Objects::iterator i); - SharedPtr<Objects> remove_children(const Path& path); + SharedPtr<Objects> remove_children(const Raul::Path& path); SharedPtr<Objects> remove_children(Objects::iterator i); }; diff --git a/src/engine/EventBuffer.cpp b/src/engine/EventBuffer.cpp index 29291f81..c96a7d8c 100644 --- a/src/engine/EventBuffer.cpp +++ b/src/engine/EventBuffer.cpp @@ -27,6 +27,7 @@ using namespace std; namespace Ingen { +using namespace Shared; /** Allocate a new event buffer. * \a capacity is in bytes (not number of events). diff --git a/src/engine/GraphObjectImpl.cpp b/src/engine/GraphObjectImpl.cpp index 929eed2a..b5d04106 100644 --- a/src/engine/GraphObjectImpl.cpp +++ b/src/engine/GraphObjectImpl.cpp @@ -20,8 +20,13 @@ #include "PatchImpl.hpp" #include "EngineStore.hpp" +using namespace std; +using namespace Raul; + namespace Ingen { +using namespace Shared; + void GraphObjectImpl::set_variable(const Raul::URI& key, const Atom& value) { diff --git a/src/engine/GraphObjectImpl.hpp b/src/engine/GraphObjectImpl.hpp index ccb5c7f9..d5156088 100644 --- a/src/engine/GraphObjectImpl.hpp +++ b/src/engine/GraphObjectImpl.hpp @@ -27,9 +27,6 @@ #include "interface/GraphObject.hpp" #include "shared/ResourceImpl.hpp" -using Raul::Path; -using Raul::Symbol; - namespace Raul { class Maid; } namespace Ingen { @@ -60,12 +57,12 @@ public: const Raul::URI uri() const { return path(); } inline GraphObjectImpl* parent() const { return _parent; } - const Symbol symbol() const { return _name; } + const Raul::Symbol symbol() const { return _name; } virtual void process(ProcessContext& context) = 0; /** Rename */ - virtual void set_path(const Path& new_path) { + virtual void set_path(const Raul::Path& new_path) { assert(new_path.parent() == path().parent()); _name = new_path.name(); assert(_name.find("/") == std::string::npos); @@ -80,21 +77,21 @@ public: /** The Patch this object is a child of. */ virtual PatchImpl* parent_patch() const; - /** Path is dynamically generated from parent to ease renaming */ - const Path path() const { + /** Raul::Path is dynamically generated from parent to ease renaming */ + const Raul::Path path() const { if (_parent == NULL) - return Path(std::string("/").append(_name)); + return Raul::Path(std::string("/").append(_name)); else if (_parent->path().is_root()) - return Path(std::string("/").append(_name)); + return Raul::Path(std::string("/").append(_name)); else - return Path(_parent->path().child(_name)); + return Raul::Path(_parent->path().child(_name)); } SharedPtr<GraphObject> find_child(const std::string& name) const; protected: GraphObjectImpl(GraphObjectImpl* parent, const std::string& name, bool polyphonic=false) - : ResourceImpl((parent ? parent->path().base() : Path::root_uri) + name) + : ResourceImpl((parent ? parent->path().base() : Raul::Path::root_uri) + name) , _parent(parent) , _name(name) , _polyphonic(polyphonic) diff --git a/src/engine/HTTPEngineReceiver.cpp b/src/engine/HTTPEngineReceiver.cpp index 1d8d63a6..46e5e0af 100644 --- a/src/engine/HTTPEngineReceiver.cpp +++ b/src/engine/HTTPEngineReceiver.cpp @@ -36,10 +36,13 @@ #include "ThreadManager.hpp" using namespace std; -using namespace Ingen::Shared; +using namespace Raul; namespace Ingen { +using namespace Shared; +using namespace Serialisation; + HTTPEngineReceiver::HTTPEngineReceiver(Engine& engine, uint16_t port) : QueuedEngineInterface(engine, 64) // FIXME diff --git a/src/engine/InputPort.cpp b/src/engine/InputPort.cpp index cb2d9e02..9ff348a7 100644 --- a/src/engine/InputPort.cpp +++ b/src/engine/InputPort.cpp @@ -31,6 +31,7 @@ using namespace std; namespace Ingen { +using namespace Shared; InputPort::InputPort(NodeImpl* parent, const string& name, diff --git a/src/engine/InputPort.hpp b/src/engine/InputPort.hpp index 4471bb8c..65912881 100644 --- a/src/engine/InputPort.hpp +++ b/src/engine/InputPort.hpp @@ -24,7 +24,6 @@ #include "raul/List.hpp" #include "raul/SharedPtr.hpp" #include "PortImpl.hpp" -using std::string; namespace Ingen { @@ -47,13 +46,13 @@ class NodeImpl; class InputPort : virtual public PortImpl { public: - InputPort(NodeImpl* parent, - const string& name, - uint32_t index, - uint32_t poly, - DataType type, - const Raul::Atom& value, - size_t buffer_size); + InputPort(NodeImpl* parent, + const std::string& name, + uint32_t index, + uint32_t poly, + Shared::DataType type, + const Raul::Atom& value, + size_t buffer_size); virtual ~InputPort() {} diff --git a/src/engine/InternalController.cpp b/src/engine/InternalController.cpp index 7b1d6bc3..fad17225 100644 --- a/src/engine/InternalController.cpp +++ b/src/engine/InternalController.cpp @@ -29,8 +29,12 @@ #include "EventBuffer.hpp" #include "util.hpp" +using namespace std; + namespace Ingen { +using namespace Shared; + static InternalPlugin controller_plugin(NS_INTERNALS "Controller", "controller"); ControllerNode::ControllerNode(const string& path, diff --git a/src/engine/InternalNote.cpp b/src/engine/InternalNote.cpp index 0e5807a0..3120ca96 100644 --- a/src/engine/InternalNote.cpp +++ b/src/engine/InternalNote.cpp @@ -35,6 +35,8 @@ using namespace std; namespace Ingen { +using namespace Shared; + static InternalPlugin note_plugin(NS_INTERNALS "Note", "note"); NoteNode::NoteNode(const string& path, bool polyphonic, PatchImpl* parent, SampleRate srate, size_t buffer_size) diff --git a/src/engine/InternalPlugin.cpp b/src/engine/InternalPlugin.cpp index 465c6b3f..e78519e8 100644 --- a/src/engine/InternalPlugin.cpp +++ b/src/engine/InternalPlugin.cpp @@ -24,6 +24,8 @@ #include "Engine.hpp" #include "AudioDriver.hpp" +using namespace std; + namespace Ingen { diff --git a/src/engine/InternalPlugin.hpp b/src/engine/InternalPlugin.hpp index 5ae908db..a58c827b 100644 --- a/src/engine/InternalPlugin.hpp +++ b/src/engine/InternalPlugin.hpp @@ -56,10 +56,10 @@ public: Ingen::PatchImpl* parent, Engine& engine); - const string symbol() const { return _symbol; } + const std::string symbol() const { return _symbol; } private: - const string _symbol; + const std::string _symbol; }; diff --git a/src/engine/InternalTransport.cpp b/src/engine/InternalTransport.cpp index 9ef94ee8..35eaa53a 100644 --- a/src/engine/InternalTransport.cpp +++ b/src/engine/InternalTransport.cpp @@ -24,6 +24,8 @@ #include "util.hpp" //#include "Engine.hpp" +using namespace std; + namespace Ingen { static InternalPlugin transport_plugin(NS_INTERNALS "Transport", "transport"); diff --git a/src/engine/InternalTrigger.cpp b/src/engine/InternalTrigger.cpp index abd205d1..c6bf6d62 100644 --- a/src/engine/InternalTrigger.cpp +++ b/src/engine/InternalTrigger.cpp @@ -30,6 +30,8 @@ using namespace std; namespace Ingen { +using namespace Shared; + static InternalPlugin trigger_plugin(NS_INTERNALS "Trigger", "trigger"); TriggerNode::TriggerNode(const string& path, bool polyphonic, PatchImpl* parent, SampleRate srate, size_t buffer_size) diff --git a/src/engine/JackAudioDriver.cpp b/src/engine/JackAudioDriver.cpp index f1f814c9..127dd1a9 100644 --- a/src/engine/JackAudioDriver.cpp +++ b/src/engine/JackAudioDriver.cpp @@ -38,6 +38,7 @@ #include "JackMidiDriver.hpp" using namespace std; +using namespace Raul; namespace Ingen { diff --git a/src/engine/JackMidiDriver.cpp b/src/engine/JackMidiDriver.cpp index ec94f962..c0b55a6b 100644 --- a/src/engine/JackMidiDriver.cpp +++ b/src/engine/JackMidiDriver.cpp @@ -32,7 +32,9 @@ #include "ProcessContext.hpp" #include "Engine.hpp" #include "jack_compat.h" + using namespace std; +using namespace Raul; namespace Ingen { diff --git a/src/engine/LADSPANode.cpp b/src/engine/LADSPANode.cpp index c6d22896..f8fc9e8d 100644 --- a/src/engine/LADSPANode.cpp +++ b/src/engine/LADSPANode.cpp @@ -30,9 +30,12 @@ #include "ProcessContext.hpp" using namespace std; +using namespace Raul; namespace Ingen { +using namespace Shared; + /** Partially construct a LADSPANode. * diff --git a/src/engine/LADSPANode.hpp b/src/engine/LADSPANode.hpp index 53d7ad9e..1ca84208 100644 --- a/src/engine/LADSPANode.hpp +++ b/src/engine/LADSPANode.hpp @@ -36,7 +36,7 @@ class LADSPANode : public NodeBase { public: LADSPANode(PluginImpl* plugin, - const string& name, + const std::string& name, bool polyphonic, PatchImpl* parent, const LADSPA_Descriptor* descriptor, diff --git a/src/engine/LADSPAPlugin.hpp b/src/engine/LADSPAPlugin.hpp index 1bc25b7a..1c01e107 100644 --- a/src/engine/LADSPAPlugin.hpp +++ b/src/engine/LADSPAPlugin.hpp @@ -40,8 +40,8 @@ public: LADSPAPlugin(const std::string& library_path, const std::string& uri, unsigned long id, - const string& label, - const string& name) + const std::string& label, + const std::string& name) : PluginImpl(Plugin::LADSPA, uri, library_path) , _id(id) , _label(label) @@ -55,10 +55,10 @@ public: const std::string& label() const { return _label; } unsigned long id() const { return _id; } - const string symbol() const { return Raul::Path::nameify(_label); } - const string name() const { return _name; } + const std::string symbol() const { return Raul::Path::nameify(_label); } + const std::string name() const { return _name; } - const string library_name() const { + const std::string library_name() const { return _library_path.substr(_library_path.find_last_of("/")+1); } diff --git a/src/engine/LV2Node.cpp b/src/engine/LV2Node.cpp index 27591499..e8029642 100644 --- a/src/engine/LV2Node.cpp +++ b/src/engine/LV2Node.cpp @@ -30,9 +30,12 @@ #include "ProcessContext.hpp" using namespace std; +using namespace Raul; namespace Ingen { +using namespace Shared; + /** Partially construct a LV2Node. * diff --git a/src/engine/LV2Node.hpp b/src/engine/LV2Node.hpp index 0dfdafb5..595ed8e9 100644 --- a/src/engine/LV2Node.hpp +++ b/src/engine/LV2Node.hpp @@ -36,12 +36,12 @@ class LV2Plugin; class LV2Node : public NodeBase { public: - LV2Node(LV2Plugin* plugin, - const string& name, - bool polyphonic, - PatchImpl* parent, - SampleRate srate, - size_t buffer_size); + LV2Node(LV2Plugin* plugin, + const std::string& name, + bool polyphonic, + PatchImpl* parent, + SampleRate srate, + size_t buffer_size); ~LV2Node(); diff --git a/src/engine/LV2Plugin.cpp b/src/engine/LV2Plugin.cpp index 9006a1ab..fa5eb415 100644 --- a/src/engine/LV2Plugin.cpp +++ b/src/engine/LV2Plugin.cpp @@ -24,6 +24,9 @@ #include "Engine.hpp" #include "AudioDriver.hpp" +using namespace std; +using namespace Raul; + namespace Ingen { diff --git a/src/engine/LV2Plugin.hpp b/src/engine/LV2Plugin.hpp index 0d67834e..a05853a8 100644 --- a/src/engine/LV2Plugin.hpp +++ b/src/engine/LV2Plugin.hpp @@ -35,10 +35,6 @@ #include "PluginImpl.hpp" #include "LV2Info.hpp" -using std::string; -using Ingen::Shared::Plugin; - - namespace Ingen { class PatchImpl; @@ -50,18 +46,18 @@ class NodeImpl; class LV2Plugin : public PluginImpl { public: - LV2Plugin(SharedPtr<LV2Info> lv2_info, const string& uri) + LV2Plugin(SharedPtr<LV2Info> lv2_info, const std::string& uri) : PluginImpl(Plugin::LV2, uri) , _slv2_plugin(NULL) , _lv2_info(lv2_info) {} - NodeImpl* instantiate(const string& name, - bool polyphonic, - Ingen::PatchImpl* parent, - Engine& engine); + NodeImpl* instantiate(const std::string& name, + bool polyphonic, + Ingen::PatchImpl* parent, + Engine& engine); - const string symbol() const; + const std::string symbol() const; SharedPtr<LV2Info> lv2_info() const { return _lv2_info; } diff --git a/src/engine/MidiDriver.hpp b/src/engine/MidiDriver.hpp index da465293..31ef686d 100644 --- a/src/engine/MidiDriver.hpp +++ b/src/engine/MidiDriver.hpp @@ -36,7 +36,7 @@ class AudioDriver; class MidiDriver : public Driver { public: - MidiDriver() : Driver(DataType::EVENT) {} + MidiDriver() : Driver(Shared::DataType::EVENT) {} virtual void attach(AudioDriver& master) {} diff --git a/src/engine/NodeBase.cpp b/src/engine/NodeBase.cpp index f860631f..2fd93162 100644 --- a/src/engine/NodeBase.cpp +++ b/src/engine/NodeBase.cpp @@ -65,14 +65,14 @@ NodeBase::~NodeBase() } -Port* +Shared::Port* NodeBase::port(uint32_t index) const { return (*_ports)[index]; } -const Plugin* +const Shared::Plugin* NodeBase::plugin() const { return _plugin; diff --git a/src/engine/NodeBase.hpp b/src/engine/NodeBase.hpp index 3efe8ebc..7c0293f9 100644 --- a/src/engine/NodeBase.hpp +++ b/src/engine/NodeBase.hpp @@ -28,17 +28,13 @@ #include "interface/Port.hpp" #include "NodeImpl.hpp" -using std::string; - namespace Ingen { class PluginImpl; class PatchImpl; class EngineStore; -namespace Shared { - class ClientInterface; -} using Shared::ClientInterface; +namespace Shared { class ClientInterface; } /** Common implementation stuff for Node. @@ -50,12 +46,12 @@ namespace Shared { class NodeBase : public NodeImpl { public: - NodeBase(PluginImpl* plugin, - const string& name, - bool poly, - PatchImpl* parent, - SampleRate rate, - size_t buffer_size); + NodeBase(PluginImpl* plugin, + const std::string& name, + bool poly, + PatchImpl* parent, + SampleRate rate, + size_t buffer_size); virtual ~NodeBase(); @@ -91,8 +87,8 @@ public: bool traversed() const { return _traversed; } void traversed(bool b) { _traversed = b; } - virtual Port* port(uint32_t index) const; - virtual PortImpl* port_impl(uint32_t index) const { return (*_ports)[index]; } + virtual Shared::Port* port(uint32_t index) const; + virtual PortImpl* port_impl(uint32_t index) const { return (*_ports)[index]; } /* These are NOT to be used in the audio thread! * The providers and dependants in CompiledNode are for that @@ -104,9 +100,9 @@ public: Raul::List<NodeImpl*>* dependants() { return _dependants; } void dependants(Raul::List<NodeImpl*>* l) { _dependants = l; } - virtual const Plugin* plugin() const; - virtual PluginImpl* plugin_impl() const { return _plugin; } - virtual void plugin(PluginImpl* pi) { _plugin = pi; } + virtual const Shared::Plugin* plugin() const; + virtual PluginImpl* plugin_impl() const { return _plugin; } + virtual void plugin(PluginImpl* pi) { _plugin = pi; } /** A node's parent is always a patch, so static cast should be safe */ inline PatchImpl* parent_patch() const { return (PatchImpl*)_parent; } diff --git a/src/engine/NodeFactory.cpp b/src/engine/NodeFactory.cpp index 43043ea7..fa9ec94e 100644 --- a/src/engine/NodeFactory.cpp +++ b/src/engine/NodeFactory.cpp @@ -60,7 +60,7 @@ NodeFactory::NodeFactory(Ingen::Shared::World* world) NodeFactory::~NodeFactory() { for (Plugins::iterator i = _plugins.begin(); i != _plugins.end(); ++i) - if (i->second->type() != Plugin::Internal) + if (i->second->type() != Shared::Plugin::Internal) delete i->second; _plugins.clear(); diff --git a/src/engine/NodeImpl.hpp b/src/engine/NodeImpl.hpp index e120db0e..2a751f6b 100644 --- a/src/engine/NodeImpl.hpp +++ b/src/engine/NodeImpl.hpp @@ -28,8 +28,6 @@ namespace Ingen { namespace Shared { class Plugin; class Node; class Port; } -using namespace Shared; - class Buffer; class PluginImpl; class PatchImpl; @@ -127,8 +125,8 @@ public: virtual uint32_t num_ports() const = 0; - virtual Port* port(uint32_t index) const = 0; - virtual PortImpl* port_impl(uint32_t index) const = 0; + virtual Shared::Port* port(uint32_t index) const = 0; + virtual PortImpl* port_impl(uint32_t index) const = 0; /** Used by the process order finding algorithm (ie during connections) */ virtual bool traversed() const = 0; diff --git a/src/engine/OSCClientSender.cpp b/src/engine/OSCClientSender.cpp index 47bf589e..3f54d9ea 100644 --- a/src/engine/OSCClientSender.cpp +++ b/src/engine/OSCClientSender.cpp @@ -29,6 +29,7 @@ #include "util.hpp" using namespace std; +using namespace Raul; namespace Ingen { @@ -128,8 +129,8 @@ OSCClientSender::error(const std::string& msg) * this one (/ingen/new_node), followed by a series of /ingen/new_port commands, * followed by /ingen/new_node_end. </p> \n \n */ -void OSCClientSender::new_node(const Raul::Path& node_path, - const Raul::URI& plugin_uri) +void OSCClientSender::new_node(const Path& node_path, + const URI& plugin_uri) { send("/ingen/new_node", "ss", node_path.c_str(), plugin_uri.c_str(), LO_ARGS_END); } @@ -152,8 +153,8 @@ void OSCClientSender::new_node(const Raul::Path& node_path, * as variable.</p> \n \n */ void -OSCClientSender::new_port(const Raul::Path& path, - const Raul::URI& type, +OSCClientSender::new_port(const Path& path, + const URI& type, uint32_t index, bool is_output) { @@ -166,7 +167,7 @@ OSCClientSender::new_port(const Raul::Path& path, * \arg \b path (string) - Path of object (which no longer exists) </p> \n \n */ void -OSCClientSender::destroy(const Raul::Path& path) +OSCClientSender::destroy(const Path& path) { send("/ingen/destroyed", "s", path.c_str(), LO_ARGS_END); } @@ -177,7 +178,7 @@ OSCClientSender::destroy(const Raul::Path& path) * \arg \b path (string) - Path of patch (which is now empty)</p> \n \n */ void -OSCClientSender::clear_patch(const Raul::Path& patch_path) +OSCClientSender::clear_patch(const Path& patch_path) { send("/ingen/clear_patch", "s", patch_path.c_str(), LO_ARGS_END); } @@ -189,7 +190,7 @@ OSCClientSender::clear_patch(const Raul::Path& patch_path) * \arg \b dst-path (string) - Path of the destination port</p> \n \n */ void -OSCClientSender::connect(const Raul::Path& src_port_path, const Raul::Path& dst_port_path) +OSCClientSender::connect(const Path& src_port_path, const Path& dst_port_path) { send("/ingen/new_connection", "ss", src_port_path.c_str(), dst_port_path.c_str(), LO_ARGS_END); } @@ -201,7 +202,7 @@ OSCClientSender::connect(const Raul::Path& src_port_path, const Raul::Path& dst_ * \arg \b dst-path (string) - Path of the destination port</p> \n \n */ void -OSCClientSender::disconnect(const Raul::Path& src_port_path, const Raul::Path& dst_port_path) +OSCClientSender::disconnect(const Path& src_port_path, const Path& dst_port_path) { send("/ingen/disconnection", "ss", src_port_path.c_str(), dst_port_path.c_str(), LO_ARGS_END); } @@ -214,12 +215,12 @@ OSCClientSender::disconnect(const Raul::Path& src_port_path, const Raul::Path& d * \arg \b value (string)</p> \n \n */ void -OSCClientSender::set_variable(const Raul::Path& path, const Raul::URI& key, const Atom& value) +OSCClientSender::set_variable(const Path& path, const URI& key, const Atom& value) { lo_message m = lo_message_new(); lo_message_add_string(m, path.c_str()); lo_message_add_string(m, key.c_str()); - Raul::AtomLiblo::lo_message_add_atom(m, value); + AtomLiblo::lo_message_add_atom(m, value); send_message("/ingen/set_variable", m); } @@ -231,12 +232,12 @@ OSCClientSender::set_variable(const Raul::Path& path, const Raul::URI& key, cons * \arg \b value (string)</p> \n \n */ void -OSCClientSender::set_property(const Raul::Path& path, const Raul::URI& key, const Atom& value) +OSCClientSender::set_property(const Path& path, const URI& key, const Atom& value) { lo_message m = lo_message_new(); lo_message_add_string(m, path.c_str()); lo_message_add_string(m, key.c_str()); - Raul::AtomLiblo::lo_message_add_atom(m, value); + AtomLiblo::lo_message_add_atom(m, value); send_message("/ingen/set_property", m); } @@ -247,11 +248,11 @@ OSCClientSender::set_property(const Raul::Path& path, const Raul::URI& key, cons * \arg \b value (any) - New value of port </p> \n \n */ void -OSCClientSender::set_port_value(const Raul::Path& port_path, const Raul::Atom& value) +OSCClientSender::set_port_value(const Path& port_path, const Atom& value) { lo_message m = lo_message_new(); lo_message_add_string(m, port_path.c_str()); - Raul::AtomLiblo::lo_message_add_atom(m, value); + AtomLiblo::lo_message_add_atom(m, value); send_message("/ingen/set_port_value", m); } @@ -263,11 +264,11 @@ OSCClientSender::set_port_value(const Raul::Path& port_path, const Raul::Atom& v * \arg \b value (any) - New value of port </p> \n \n */ void -OSCClientSender::set_voice_value(const Raul::Path& port_path, uint32_t voice, const Raul::Atom& value) +OSCClientSender::set_voice_value(const Path& port_path, uint32_t voice, const Atom& value) { lo_message m = lo_message_new(); lo_message_add_string(m, port_path.c_str()); - Raul::AtomLiblo::lo_message_add_atom(m, value); + AtomLiblo::lo_message_add_atom(m, value); send_message("/ingen/set_port_value", m); } @@ -277,7 +278,7 @@ OSCClientSender::set_voice_value(const Raul::Path& port_path, uint32_t voice, co * \arg \b path (string) - Path of object </p> \n \n */ void -OSCClientSender::activity(const Raul::Path& path) +OSCClientSender::activity(const Path& path) { if (!_enabled) return; @@ -294,9 +295,9 @@ OSCClientSender::activity(const Raul::Path& path) * \arg \b name (string) - Descriptive human-readable name of plugin (e.g. "ADSR Envelope") */ void -OSCClientSender::new_plugin(const Raul::URI& uri, - const Raul::URI& type_uri, - const Raul::Symbol& symbol) +OSCClientSender::new_plugin(const URI& uri, + const URI& type_uri, + const Symbol& symbol) { lo_message m = lo_message_new(); lo_message_add_string(m, uri.c_str()); @@ -341,7 +342,7 @@ OSCClientSender::new_object(const Shared::GraphObject* object) * \arg \b poly (int) - Polyphony of new patch (\em not a boolean like new_node) </p> \n \n */ void -OSCClientSender::new_patch(const Raul::Path& path, uint32_t poly) +OSCClientSender::new_patch(const Path& path, uint32_t poly) { send("/ingen/new_patch", "si", path.c_str(), poly, LO_ARGS_END); } @@ -353,7 +354,7 @@ OSCClientSender::new_patch(const Raul::Path& path, uint32_t poly) * \arg \b new-path (string) - New path of object </p> \n \n */ void -OSCClientSender::rename(const Raul::Path& old_path, const Raul::Path& new_path) +OSCClientSender::rename(const Path& old_path, const Path& new_path) { send("/ingen/rename", "ss", old_path.c_str(), new_path.c_str(), LO_ARGS_END); } @@ -362,7 +363,7 @@ OSCClientSender::rename(const Raul::Path& old_path, const Raul::Path& new_path) /** Sends information about a program associated with a node. */ void -OSCClientSender::program_add(const Raul::Path& node_path, uint32_t bank, uint32_t program, const std::string& name) +OSCClientSender::program_add(const Path& node_path, uint32_t bank, uint32_t program, const std::string& name) { send("/ingen/program_add", "siis", node_path.c_str(), bank, program, name.c_str(), LO_ARGS_END); @@ -370,7 +371,7 @@ OSCClientSender::program_add(const Raul::Path& node_path, uint32_t bank, uint32_ void -OSCClientSender::program_remove(const Raul::Path& node_path, uint32_t bank, uint32_t program) +OSCClientSender::program_remove(const Path& node_path, uint32_t bank, uint32_t program) { send("/ingen/program_remove", "sii", node_path.c_str(), bank, program, LO_ARGS_END); diff --git a/src/engine/OSCDriver.hpp b/src/engine/OSCDriver.hpp index a7c84d37..fe295df5 100644 --- a/src/engine/OSCDriver.hpp +++ b/src/engine/OSCDriver.hpp @@ -32,7 +32,7 @@ namespace Ingen { class OSCDriver : public Driver { public: - OSCDriver() : Driver(DataType::EVENT) {} + OSCDriver() : Driver(Shared::DataType::EVENT) {} /** Prepare events (however neccessary) for the specified block (realtime safe) */ virtual void prepare_block(const SampleCount block_start, const SampleCount block_end) = 0; diff --git a/src/engine/OSCEngineReceiver.cpp b/src/engine/OSCEngineReceiver.cpp index cb859ad8..759d59a5 100644 --- a/src/engine/OSCEngineReceiver.cpp +++ b/src/engine/OSCEngineReceiver.cpp @@ -220,7 +220,7 @@ OSCEngineReceiver::set_response_address_cb(const char* path, const char* types, /* Different address than last time, have to do a lookup */ if (!r || !r->client() || strcmp(url, r->client()->uri().c_str())) { - ClientInterface* client = me->_engine.broadcaster()->client(url); + Shared::ClientInterface* client = me->_engine.broadcaster()->client(url); if (client) me->_responder = SharedPtr<Responder>(new Responder(client, id)); else @@ -303,7 +303,7 @@ OSCEngineReceiver::_register_client_cb(const char* path, const char* types, lo_a lo_address addr = lo_message_get_source(msg); char* const url = lo_address_get_url(addr); - ClientInterface* client = new OSCClientSender((const char*)url); + Shared::ClientInterface* client = new OSCClientSender((const char*)url); register_client(client); free(url); diff --git a/src/engine/OSCEngineReceiver.hpp b/src/engine/OSCEngineReceiver.hpp index b3ccc6a5..b684d2c0 100644 --- a/src/engine/OSCEngineReceiver.hpp +++ b/src/engine/OSCEngineReceiver.hpp @@ -18,12 +18,10 @@ #ifndef OSCENGINERECEIVER_H #define OSCENGINERECEIVER_H -#include <string> #include <stdint.h> #include <lo/lo.h> #include "QueuedEngineInterface.hpp" #include "Responder.hpp" -using std::string; namespace Ingen { diff --git a/src/engine/ObjectSender.cpp b/src/engine/ObjectSender.cpp index a0202db0..0f8f10b6 100644 --- a/src/engine/ObjectSender.cpp +++ b/src/engine/ObjectSender.cpp @@ -26,8 +26,11 @@ #include "interface/DataType.hpp" #include "AudioBuffer.hpp" +using namespace std; + namespace Ingen { +using namespace Shared; void ObjectSender::send_object(ClientInterface* client, const GraphObjectImpl* object, bool recursive) @@ -74,7 +77,7 @@ ObjectSender::send_patch(ClientInterface* client, const PatchImpl* patch, bool r if (recursive) { // Send nodes - for (List<NodeImpl*>::const_iterator j = patch->nodes().begin(); + for (Raul::List<NodeImpl*>::const_iterator j = patch->nodes().begin(); j != patch->nodes().end(); ++j) { const NodeImpl* const node = (*j); send_node(client, node, true, false); diff --git a/src/engine/ObjectSender.hpp b/src/engine/ObjectSender.hpp index 19cb79c0..db10e8fc 100644 --- a/src/engine/ObjectSender.hpp +++ b/src/engine/ObjectSender.hpp @@ -22,9 +22,7 @@ namespace Ingen { -namespace Shared { - class ClientInterface; -} using Shared::ClientInterface; +namespace Shared { class ClientInterface; } class GraphObjectImpl; class PatchImpl; @@ -44,12 +42,16 @@ class PluginImpl; */ class ObjectSender { public: - static void send_object(ClientInterface* client, const GraphObjectImpl* object, bool recursive); + static void send_object(Shared::ClientInterface* client, + const GraphObjectImpl* object, bool recursive); private: - static void send_patch(ClientInterface* client, const PatchImpl* patch, bool recursive, bool bundle=true); - static void send_node(ClientInterface* client, const NodeImpl* node, bool recursive, bool bundle=true); - static void send_port(ClientInterface* client, const PortImpl* port, bool bundle=true); + static void send_patch(Shared::ClientInterface* client, + const PatchImpl* patch, bool recursive, bool bundle=true); + static void send_node(Shared::ClientInterface* client, + const NodeImpl* node, bool recursive, bool bundle=true); + static void send_port(Shared::ClientInterface* client, + const PortImpl* port, bool bundle=true); }; } // namespace Ingen diff --git a/src/engine/OutputPort.cpp b/src/engine/OutputPort.cpp index e86d5a98..b0af3f6e 100644 --- a/src/engine/OutputPort.cpp +++ b/src/engine/OutputPort.cpp @@ -24,7 +24,8 @@ using namespace std; namespace Ingen { - +using namespace Shared; + OutputPort::OutputPort(NodeImpl* parent, const string& name, uint32_t index, diff --git a/src/engine/OutputPort.hpp b/src/engine/OutputPort.hpp index cd5e201a..6e36d021 100644 --- a/src/engine/OutputPort.hpp +++ b/src/engine/OutputPort.hpp @@ -43,7 +43,7 @@ public: const std::string& name, uint32_t index, uint32_t poly, - DataType type, + Shared::DataType type, const Raul::Atom& value, size_t buffer_size); diff --git a/src/engine/PatchImpl.cpp b/src/engine/PatchImpl.cpp index cbf5c194..ac053f31 100644 --- a/src/engine/PatchImpl.cpp +++ b/src/engine/PatchImpl.cpp @@ -29,9 +29,12 @@ #include "ProcessSlave.hpp" using namespace std; +using namespace Raul; namespace Ingen { +using namespace Shared; + PatchImpl::PatchImpl(Engine& engine, const string& path, uint32_t poly, PatchImpl* parent, SampleRate srate, size_t buffer_size, uint32_t internal_poly) : NodeBase(new PatchPlugin("http://example.org/FIXME", "patch", "Ingen Patch"), diff --git a/src/engine/PatchImpl.hpp b/src/engine/PatchImpl.hpp index bbd13b76..17600c4c 100644 --- a/src/engine/PatchImpl.hpp +++ b/src/engine/PatchImpl.hpp @@ -27,11 +27,6 @@ #include "PluginImpl.hpp" #include "CompiledPatch.hpp" -using std::string; - -template <typename T> class Array; -using Raul::List; - namespace Ingen { namespace Shared { class Connection; } @@ -52,13 +47,13 @@ class CompiledPatch; class PatchImpl : public NodeBase, public Ingen::Shared::Patch { public: - PatchImpl(Engine& engine, - const string& name, - uint32_t poly, - PatchImpl* parent, - SampleRate srate, - size_t buffer_size, - uint32_t local_poly); + PatchImpl(Engine& engine, + const std::string& name, + uint32_t poly, + PatchImpl* parent, + SampleRate srate, + size_t buffer_size, + uint32_t local_poly); virtual ~PatchImpl(); @@ -87,10 +82,10 @@ public: // Patch specific stuff not inherited from Node - typedef List<NodeImpl*> Nodes; + typedef Raul::List<NodeImpl*> Nodes; void add_node(Nodes::Node* tn); - Nodes::Node* remove_node(const string& name); + Nodes::Node* remove_node(const std::string& name); Nodes& nodes() { return _nodes; } Connections& connections() { return _connections; } @@ -100,10 +95,10 @@ public: uint32_t num_ports() const; - PortImpl* create_port(const string& name, DataType type, size_t buffer_size, bool is_output); - void add_input(List<PortImpl*>::Node* port) { _input_ports.push_back(port); } ///< Preprocesser thread - void add_output(List<PortImpl*>::Node* port) { _output_ports.push_back(port); } ///< Preprocessor thread - List<PortImpl*>::Node* remove_port(const string& name); + PortImpl* create_port(const std::string& name, Shared::DataType type, size_t buffer_size, bool is_output); + void add_input(Raul::List<PortImpl*>::Node* port) { _input_ports.push_back(port); } ///< Preprocesser thread + void add_output(Raul::List<PortImpl*>::Node* port) { _output_ports.push_back(port); } ///< Preprocessor thread + Raul::List<PortImpl*>::Node* remove_port(const std::string& name); void clear_ports(); void add_connection(Connections::Node* c) { _connections.push_back(c); } @@ -132,14 +127,14 @@ private: void process_parallel(ProcessContext& context); void process_single(ProcessContext& context); - Engine& _engine; - uint32_t _internal_poly; - CompiledPatch* _compiled_patch; ///< Accessed in audio thread only - Connections _connections; ///< Accessed in preprocessing thread only - List<PortImpl*> _input_ports; ///< Accessed in preprocessing thread only - List<PortImpl*> _output_ports; ///< Accessed in preprocessing thread only - Nodes _nodes; ///< Accessed in preprocessing thread only - bool _process; + Engine& _engine; + uint32_t _internal_poly; + CompiledPatch* _compiled_patch; ///< Accessed in audio thread only + Connections _connections; ///< Accessed in preprocessing thread only + Raul::List<PortImpl*> _input_ports; ///< Accessed in preprocessing thread only + Raul::List<PortImpl*> _output_ports; ///< Accessed in preprocessing thread only + Nodes _nodes; ///< Accessed in preprocessing thread only + bool _process; }; @@ -154,7 +149,7 @@ PatchImpl::compile_recursive(NodeImpl* n, CompiledPatch* output) const n->traversed(true); assert(output != NULL); - for (List<NodeImpl*>::iterator i = n->providers()->begin(); i != n->providers()->end(); ++i) + for (Raul::List<NodeImpl*>::iterator i = n->providers()->begin(); i != n->providers()->end(); ++i) if ( ! (*i)->traversed() ) compile_recursive((*i), output); diff --git a/src/engine/PatchPlugin.hpp b/src/engine/PatchPlugin.hpp index a406deca..068329d0 100644 --- a/src/engine/PatchPlugin.hpp +++ b/src/engine/PatchPlugin.hpp @@ -49,12 +49,12 @@ public: return NULL; } - const string symbol() const { return "patch"; } - const string name() const { return "Ingen Patch"; } + const std::string symbol() const { return "patch"; } + const std::string name() const { return "Ingen Patch"; } private: - const string _symbol; - const string _name; + const std::string _symbol; + const std::string _name; }; diff --git a/src/engine/PluginImpl.hpp b/src/engine/PluginImpl.hpp index e900d34c..40f9c91f 100644 --- a/src/engine/PluginImpl.hpp +++ b/src/engine/PluginImpl.hpp @@ -27,9 +27,6 @@ #include "interface/Plugin.hpp" #include "shared/ResourceImpl.hpp" -using std::string; -using Ingen::Shared::Plugin; - namespace Ingen { class PatchImpl; @@ -46,7 +43,7 @@ class PluginImpl : public Ingen::Shared::Plugin , public boost::noncopyable { public: - PluginImpl(Type type, const string& uri, const string library_path="") + PluginImpl(Type type, const std::string& uri, const std::string library_path="") : ResourceImpl(uri) , _type(type) , _library_path(library_path) @@ -58,7 +55,7 @@ public: Ingen::PatchImpl* parent, Engine& engine) = 0; - virtual const string symbol() const = 0; + virtual const std::string symbol() const = 0; virtual const std::string& library_path() const { return _library_path; } @@ -71,9 +68,9 @@ public: void module(Glib::Module* module) { _module = module; } protected: - Plugin::Type _type; - mutable string _library_path; - Glib::Module* _module; + Plugin::Type _type; + mutable std::string _library_path; + Glib::Module* _module; }; diff --git a/src/engine/PortImpl.cpp b/src/engine/PortImpl.cpp index 26fe07d0..9c819e23 100644 --- a/src/engine/PortImpl.cpp +++ b/src/engine/PortImpl.cpp @@ -31,6 +31,8 @@ using namespace std; namespace Ingen { +using namespace Shared; + PortImpl::PortImpl(NodeImpl* const node, const string& name, diff --git a/src/engine/PortImpl.hpp b/src/engine/PortImpl.hpp index afac4974..d3aad1c3 100644 --- a/src/engine/PortImpl.hpp +++ b/src/engine/PortImpl.hpp @@ -97,10 +97,12 @@ public: virtual bool is_input() const = 0; virtual bool is_output() const = 0; - uint32_t index() const { return _index; } - uint32_t poly() const { return _poly; } - DataType type() const { return _type; } - size_t buffer_size() const { return (_type == DataType::CONTROL) ? 1 : _buffer_size; } + uint32_t index() const { return _index; } + uint32_t poly() const { return _poly; } + Shared::DataType type() const { return _type; } + size_t buffer_size() const { + return (_type == Shared::DataType::CONTROL) ? 1 : _buffer_size; + } virtual void set_buffer_size(size_t size); @@ -122,7 +124,7 @@ protected: const std::string& name, uint32_t index, uint32_t poly, - DataType type, + Shared::DataType type, const Raul::Atom& value, size_t buffer_size); @@ -130,15 +132,15 @@ protected: virtual void connect_buffers(); virtual void broadcast(ProcessContext& context); - uint32_t _index; - uint32_t _poly; - uint32_t _buffer_size; - DataType _type; - Raul::Atom _value; - bool _fixed_buffers; - bool _broadcast; - bool _set_by_user; - Sample _last_broadcasted_value; + uint32_t _index; + uint32_t _poly; + uint32_t _buffer_size; + Shared::DataType _type; + Raul::Atom _value; + bool _fixed_buffers; + bool _broadcast; + bool _set_by_user; + Sample _last_broadcasted_value; Context::ID _context; Raul::Array<Buffer*>* _buffers; diff --git a/src/engine/QueuedEngineInterface.cpp b/src/engine/QueuedEngineInterface.cpp index 3dcd2ddb..e475f1a6 100644 --- a/src/engine/QueuedEngineInterface.cpp +++ b/src/engine/QueuedEngineInterface.cpp @@ -23,8 +23,12 @@ #include "Engine.hpp" #include "AudioDriver.hpp" +using namespace Raul; + namespace Ingen { +using namespace Shared; + QueuedEngineInterface::QueuedEngineInterface(Engine& engine, size_t queue_size) : QueuedEventSource(queue_size) , _responder(new Responder(NULL, 0)) diff --git a/src/engine/QueuedEngineInterface.hpp b/src/engine/QueuedEngineInterface.hpp index 7e2dd4d0..1482cf2e 100644 --- a/src/engine/QueuedEngineInterface.hpp +++ b/src/engine/QueuedEngineInterface.hpp @@ -28,12 +28,9 @@ #include "interface/ClientInterface.hpp" #include "Responder.hpp" #include "QueuedEventSource.hpp" -using std::string; namespace Ingen { -using Shared::ClientInterface; -using Shared::EngineInterface; class Engine; @@ -47,7 +44,7 @@ class Engine; * If you do not register a responder, you have no way of knowing if your calls * are successful. */ -class QueuedEngineInterface : public QueuedEventSource, public EngineInterface +class QueuedEngineInterface : public QueuedEventSource, public Shared::EngineInterface { public: QueuedEngineInterface(Engine& engine, size_t queue_size); @@ -58,7 +55,7 @@ public: void set_next_response_id(int32_t id); // Client registration - virtual void register_client(ClientInterface* client); + virtual void register_client(Shared::ClientInterface* client); virtual void unregister_client(const Raul::URI& uri); // Engine commands diff --git a/src/engine/ThreadManager.hpp b/src/engine/ThreadManager.hpp index 7e1e04ab..199f80bb 100644 --- a/src/engine/ThreadManager.hpp +++ b/src/engine/ThreadManager.hpp @@ -20,8 +20,6 @@ #include "raul/Thread.hpp" -using Raul::Thread; - namespace Ingen { @@ -34,7 +32,9 @@ enum ThreadID { class ThreadManager { public: - inline static ThreadID current_thread_id() { return (ThreadID)Thread::get().context(); } + inline static ThreadID current_thread_id() { + return (ThreadID)Raul::Thread::get().context(); + } }; diff --git a/src/engine/events/AllNotesOffEvent.cpp b/src/engine/events/AllNotesOffEvent.cpp index 8e009760..0057c456 100644 --- a/src/engine/events/AllNotesOffEvent.cpp +++ b/src/engine/events/AllNotesOffEvent.cpp @@ -22,6 +22,8 @@ #include "module/World.hpp" #include "shared/Store.hpp" +using namespace Raul; + namespace Ingen { diff --git a/src/engine/events/ClearPatchEvent.cpp b/src/engine/events/ClearPatchEvent.cpp index e3632e08..e68ee271 100644 --- a/src/engine/events/ClearPatchEvent.cpp +++ b/src/engine/events/ClearPatchEvent.cpp @@ -30,8 +30,13 @@ #include "AudioDriver.hpp" #include "MidiDriver.hpp" +using namespace std; +using namespace Raul; + namespace Ingen { +using namespace Shared; + ClearPatchEvent::ClearPatchEvent(Engine& engine, SharedPtr<Responder> responder, FrameTime time, QueuedEventSource* source, const Path& patch_path) : QueuedEvent(engine, responder, time, true, source) diff --git a/src/engine/events/ClearPatchEvent.hpp b/src/engine/events/ClearPatchEvent.hpp index b5fcf716..42b06658 100644 --- a/src/engine/events/ClearPatchEvent.hpp +++ b/src/engine/events/ClearPatchEvent.hpp @@ -54,7 +54,7 @@ private: typedef Raul::Array<Raul::List<DriverPort*>::Node*> DriverPorts; DriverPorts* _driver_ports; - SharedPtr< Table<Path, SharedPtr<Shared::GraphObject> > > _removed_table; + SharedPtr< Raul::Table<Raul::Path, SharedPtr<Shared::GraphObject> > > _removed_table; }; diff --git a/src/engine/events/ConnectionEvent.cpp b/src/engine/events/ConnectionEvent.cpp index 13e160c9..6a55f35b 100644 --- a/src/engine/events/ConnectionEvent.cpp +++ b/src/engine/events/ConnectionEvent.cpp @@ -31,9 +31,13 @@ #include "Responder.hpp" #include "types.hpp" -using std::string; +using namespace std; +using namespace Raul; + namespace Ingen { +using namespace Shared; + ConnectionEvent::ConnectionEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const Path& src_port_path, const Path& dst_port_path) : QueuedEvent(engine, responder, timestamp) diff --git a/src/engine/events/CreateNodeEvent.cpp b/src/engine/events/CreateNodeEvent.cpp index f34f75c3..e4663799 100644 --- a/src/engine/events/CreateNodeEvent.cpp +++ b/src/engine/events/CreateNodeEvent.cpp @@ -33,6 +33,9 @@ #include "PortImpl.hpp" #include "AudioDriver.hpp" +using namespace std; +using namespace Raul; + namespace Ingen { diff --git a/src/engine/events/CreatePatchEvent.cpp b/src/engine/events/CreatePatchEvent.cpp index 392a1cc2..0b85dd89 100644 --- a/src/engine/events/CreatePatchEvent.cpp +++ b/src/engine/events/CreatePatchEvent.cpp @@ -27,6 +27,9 @@ #include "AudioDriver.hpp" #include "EngineStore.hpp" +using namespace std; +using namespace Raul; + namespace Ingen { diff --git a/src/engine/events/CreatePortEvent.cpp b/src/engine/events/CreatePortEvent.cpp index 870a190c..8e2230eb 100644 --- a/src/engine/events/CreatePortEvent.cpp +++ b/src/engine/events/CreatePortEvent.cpp @@ -34,8 +34,12 @@ #include "OSCDriver.hpp" #include "DuplexPort.hpp" +using namespace std; + namespace Ingen { +using namespace Shared; + CreatePortEvent::CreatePortEvent(Engine& engine, SharedPtr<Responder> responder, diff --git a/src/engine/events/CreatePortEvent.hpp b/src/engine/events/CreatePortEvent.hpp index 2587f2f0..1fe9b962 100644 --- a/src/engine/events/CreatePortEvent.hpp +++ b/src/engine/events/CreatePortEvent.hpp @@ -57,7 +57,7 @@ private: Raul::Path _path; Raul::URI _type; bool _is_output; - DataType _data_type; + Shared::DataType _data_type; PatchImpl* _patch; PortImpl* _patch_port; Raul::Array<PortImpl*>* _ports_array; ///< New (external) ports array for Patch diff --git a/src/engine/events/DestroyEvent.cpp b/src/engine/events/DestroyEvent.cpp index 469d73f1..d5611f03 100644 --- a/src/engine/events/DestroyEvent.cpp +++ b/src/engine/events/DestroyEvent.cpp @@ -31,8 +31,12 @@ #include "QueuedEventSource.hpp" #include "PortImpl.hpp" +using namespace std; + namespace Ingen { +using namespace Shared; + DestroyEvent::DestroyEvent(Engine& engine, SharedPtr<Responder> responder, FrameTime time, QueuedEventSource* source, const Raul::Path& path) : QueuedEvent(engine, responder, time, true, source) diff --git a/src/engine/events/DestroyEvent.hpp b/src/engine/events/DestroyEvent.hpp index a3ed4bee..791a74ae 100644 --- a/src/engine/events/DestroyEvent.hpp +++ b/src/engine/events/DestroyEvent.hpp @@ -63,7 +63,7 @@ private: CompiledPatch* _compiled_patch; ///< Patch's new process order DisconnectAllEvent* _disconnect_event; - SharedPtr< Table<Path, SharedPtr<Shared::GraphObject> > > _removed_table; + SharedPtr< Raul::Table<Raul::Path, SharedPtr<Shared::GraphObject> > > _removed_table; }; diff --git a/src/engine/events/DisconnectAllEvent.cpp b/src/engine/events/DisconnectAllEvent.cpp index 2a8a2b4f..190ed878 100644 --- a/src/engine/events/DisconnectAllEvent.cpp +++ b/src/engine/events/DisconnectAllEvent.cpp @@ -34,6 +34,9 @@ #include "Responder.hpp" #include "util.hpp" +using namespace std; +using namespace Raul; + namespace Ingen { diff --git a/src/engine/events/DisconnectionEvent.cpp b/src/engine/events/DisconnectionEvent.cpp index 3e7d41a0..ec90480f 100644 --- a/src/engine/events/DisconnectionEvent.cpp +++ b/src/engine/events/DisconnectionEvent.cpp @@ -28,6 +28,8 @@ #include "PortImpl.hpp" #include "EngineStore.hpp" +using namespace std; + namespace Ingen { diff --git a/src/engine/events/MidiLearnEvent.cpp b/src/engine/events/MidiLearnEvent.cpp index d098c59c..337acca3 100644 --- a/src/engine/events/MidiLearnEvent.cpp +++ b/src/engine/events/MidiLearnEvent.cpp @@ -24,6 +24,8 @@ #include "ClientBroadcaster.hpp" #include "PluginImpl.hpp" +using namespace std; + namespace Ingen { @@ -51,7 +53,7 @@ MidiLearnEvent::execute(ProcessContext& context) QueuedEvent::execute(context); if (_node != NULL) { - if (_node->plugin_impl()->type() == Plugin::Internal) { + if (_node->plugin_impl()->type() == Shared::Plugin::Internal) { ((NodeBase*)_node)->learn(); } else { _error = INVALID_NODE_TYPE; diff --git a/src/engine/events/NoteEvent.cpp b/src/engine/events/NoteEvent.cpp index 589e8462..62fdff13 100644 --- a/src/engine/events/NoteEvent.cpp +++ b/src/engine/events/NoteEvent.cpp @@ -26,6 +26,8 @@ #include "InternalPlugin.hpp" #include "ProcessContext.hpp" +using namespace Raul; + namespace Ingen { @@ -70,7 +72,7 @@ NoteEvent::execute(ProcessContext& context) // FIXME: barf - if (_node != NULL && _node->plugin()->type() == Plugin::Internal) { + if (_node != NULL && _node->plugin()->type() == Shared::Plugin::Internal) { if (_on) { if (_node->plugin_impl()->uri().str() == NS_INTERNALS "Note") ((NoteNode*)_node)->note_on(context, _note_num, _velocity, _time); diff --git a/src/engine/events/RegisterClientEvent.cpp b/src/engine/events/RegisterClientEvent.cpp index 80281dc3..e78d0577 100644 --- a/src/engine/events/RegisterClientEvent.cpp +++ b/src/engine/events/RegisterClientEvent.cpp @@ -20,14 +20,16 @@ #include "Engine.hpp" #include "ClientBroadcaster.hpp" +using namespace Raul; + namespace Ingen { -RegisterClientEvent::RegisterClientEvent(Engine& engine, - SharedPtr<Responder> responder, - SampleCount timestamp, - const URI& uri, - ClientInterface* client) +RegisterClientEvent::RegisterClientEvent(Engine& engine, + SharedPtr<Responder> responder, + SampleCount timestamp, + const URI& uri, + Shared::ClientInterface* client) : QueuedEvent(engine, responder, timestamp) , _uri(uri) , _client(client) diff --git a/src/engine/events/RenameEvent.cpp b/src/engine/events/RenameEvent.cpp index b2116cc4..3ff5d254 100644 --- a/src/engine/events/RenameEvent.cpp +++ b/src/engine/events/RenameEvent.cpp @@ -27,9 +27,12 @@ #include "MidiDriver.hpp" using namespace std; +using namespace Raul; namespace Ingen { +using namespace Shared; + RenameEvent::RenameEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const Path& path, const Path& new_path) : QueuedEvent(engine, responder, timestamp) diff --git a/src/engine/events/RequestMetadataEvent.cpp b/src/engine/events/RequestMetadataEvent.cpp index 75ff2a65..685108f4 100644 --- a/src/engine/events/RequestMetadataEvent.cpp +++ b/src/engine/events/RequestMetadataEvent.cpp @@ -23,6 +23,9 @@ #include "EngineStore.hpp" #include "ClientBroadcaster.hpp" +using namespace std; +using namespace Raul; + namespace Ingen { diff --git a/src/engine/events/RequestObjectEvent.cpp b/src/engine/events/RequestObjectEvent.cpp index 6ee97388..7cce6588 100644 --- a/src/engine/events/RequestObjectEvent.cpp +++ b/src/engine/events/RequestObjectEvent.cpp @@ -27,6 +27,8 @@ #include "ObjectSender.hpp" #include "ProcessContext.hpp" +using namespace Raul; + namespace Ingen { diff --git a/src/engine/events/RequestPluginEvent.cpp b/src/engine/events/RequestPluginEvent.cpp index 98e70f2f..89371a8b 100644 --- a/src/engine/events/RequestPluginEvent.cpp +++ b/src/engine/events/RequestPluginEvent.cpp @@ -26,6 +26,8 @@ #include "PluginImpl.hpp" #include "ProcessContext.hpp" +using namespace Raul; + namespace Ingen { diff --git a/src/engine/events/RequestPortValueEvent.cpp b/src/engine/events/RequestPortValueEvent.cpp index b4502ae2..5f3a33a7 100644 --- a/src/engine/events/RequestPortValueEvent.cpp +++ b/src/engine/events/RequestPortValueEvent.cpp @@ -25,8 +25,13 @@ #include "AudioBuffer.hpp" #include "ProcessContext.hpp" +using namespace std; +using namespace Raul; + namespace Ingen { +using namespace Shared; + RequestPortValueEvent::RequestPortValueEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const Path& port_path) : QueuedEvent(engine, responder, timestamp) diff --git a/src/engine/events/SetMetadataEvent.cpp b/src/engine/events/SetMetadataEvent.cpp index 679433a9..a41b866e 100644 --- a/src/engine/events/SetMetadataEvent.cpp +++ b/src/engine/events/SetMetadataEvent.cpp @@ -26,7 +26,8 @@ #include "PatchImpl.hpp" #include "EngineStore.hpp" -using std::string; +using namespace std; +using namespace Raul; namespace Ingen { diff --git a/src/engine/events/SetPortValueEvent.cpp b/src/engine/events/SetPortValueEvent.cpp index b6318d48..1c07af95 100644 --- a/src/engine/events/SetPortValueEvent.cpp +++ b/src/engine/events/SetPortValueEvent.cpp @@ -33,9 +33,12 @@ #include "MessageContext.hpp" using namespace std; +using namespace Raul; namespace Ingen { +using namespace Shared; + /** Omni (all voices) control setting */ SetPortValueEvent::SetPortValueEvent(Engine& engine, diff --git a/src/engine/events/UnregisterClientEvent.cpp b/src/engine/events/UnregisterClientEvent.cpp index 02296ec9..3a79adc1 100644 --- a/src/engine/events/UnregisterClientEvent.cpp +++ b/src/engine/events/UnregisterClientEvent.cpp @@ -21,6 +21,8 @@ #include "Engine.hpp" #include "ClientBroadcaster.hpp" +using namespace Raul; + namespace Ingen { diff --git a/src/gui/LoadPatchWindow.cpp b/src/gui/LoadPatchWindow.cpp index 7ae755ad..d693704f 100644 --- a/src/gui/LoadPatchWindow.cpp +++ b/src/gui/LoadPatchWindow.cpp @@ -29,6 +29,8 @@ using namespace Ingen::Serialisation; using boost::optional; using namespace std; +using namespace std; +using namespace Raul; namespace Ingen { namespace GUI { diff --git a/src/gui/LoadSubpatchWindow.cpp b/src/gui/LoadSubpatchWindow.cpp index 3b935f68..302b5387 100644 --- a/src/gui/LoadSubpatchWindow.cpp +++ b/src/gui/LoadSubpatchWindow.cpp @@ -28,8 +28,10 @@ #include "PatchView.hpp" #include "Configuration.hpp" #include "ThreadedLoader.hpp" + using boost::optional; using namespace std; +using namespace Raul; namespace Ingen { namespace GUI { @@ -146,7 +148,7 @@ LoadSubpatchWindow::ok_clicked() assert(_patch); // If unset load_patch will load values - optional<Symbol> symbol; + optional<Raul::Symbol> symbol; string name_str = ""; if (_name_from_user_radio->get_active()) { diff --git a/src/gui/PatchCanvas.cpp b/src/gui/PatchCanvas.cpp index 57df4a61..99ed8446 100644 --- a/src/gui/PatchCanvas.cpp +++ b/src/gui/PatchCanvas.cpp @@ -46,10 +46,12 @@ #include "GladeFactory.hpp" #include "WindowFactory.hpp" #include "ThreadedLoader.hpp" + using Ingen::Client::ClientStore; using Ingen::Serialisation::Serialiser; using Ingen::Client::PluginModel; using namespace std; +using namespace Raul; namespace Ingen { namespace GUI { diff --git a/src/gui/PatchWindow.cpp b/src/gui/PatchWindow.cpp index d1248920..cc882f8d 100644 --- a/src/gui/PatchWindow.cpp +++ b/src/gui/PatchWindow.cpp @@ -41,6 +41,8 @@ #include "WindowFactory.hpp" #include "PatchView.hpp" +using namespace Raul; + namespace Ingen { namespace GUI { diff --git a/src/gui/Port.cpp b/src/gui/Port.cpp index 922dea77..e7daac0a 100644 --- a/src/gui/Port.cpp +++ b/src/gui/Port.cpp @@ -32,6 +32,7 @@ using namespace std; using namespace Raul; namespace Ingen { +using namespace Shared; namespace GUI { diff --git a/src/gui/ThreadedLoader.cpp b/src/gui/ThreadedLoader.cpp index 2b185257..3a33d5ac 100644 --- a/src/gui/ThreadedLoader.cpp +++ b/src/gui/ThreadedLoader.cpp @@ -25,6 +25,7 @@ #include "client/PatchModel.hpp" using namespace std; +using namespace Raul; namespace Ingen { namespace GUI { diff --git a/src/gui/ThreadedLoader.hpp b/src/gui/ThreadedLoader.hpp index ffe7a482..cdf331a4 100644 --- a/src/gui/ThreadedLoader.hpp +++ b/src/gui/ThreadedLoader.hpp @@ -33,10 +33,11 @@ using std::string; using std::list; using boost::optional; -using namespace Ingen::Client; -using namespace Ingen::Serialisation; - namespace Ingen { +using namespace Shared; +using namespace Client; +using namespace Serialisation; + namespace GUI { @@ -56,11 +57,11 @@ class ThreadedLoader : public Raul::Slave public: ThreadedLoader(SharedPtr<EngineInterface> engine); - void load_patch(bool merge, - const Glib::ustring& document_uri, - optional<Path> data_path, - optional<Path> engine_parent, - optional<Symbol> engine_symbol, + void load_patch(bool merge, + const Glib::ustring& document_uri, + optional<Raul::Path> data_path, + optional<Raul::Path> engine_parent, + optional<Raul::Symbol> engine_symbol, optional<GraphObject::Properties> engine_data); void save_patch(SharedPtr<PatchModel> model, const string& filename); diff --git a/src/ingen/main.cpp b/src/ingen/main.cpp index 8fcda46f..c23a728a 100644 --- a/src/ingen/main.cpp +++ b/src/ingen/main.cpp @@ -50,10 +50,10 @@ #include "bindings/ingen_bindings.hpp" #endif - using namespace std; using namespace Ingen; - +using namespace Ingen::Shared; +using namespace Raul; SharedPtr<Engine> engine; diff --git a/src/module/World.hpp b/src/module/World.hpp index af128106..94a99775 100644 --- a/src/module/World.hpp +++ b/src/module/World.hpp @@ -35,8 +35,6 @@ namespace Ingen { class Engine; namespace Serialisation { class Serialiser; class Parser; } -using Serialisation::Serialiser; -using Serialisation::Parser; namespace Shared { class EngineInterface; @@ -61,11 +59,11 @@ struct World { Redland::World* rdf_world; - SharedPtr<EngineInterface> engine; - SharedPtr<Engine> local_engine; - SharedPtr<Serialiser> serialiser; - SharedPtr<Parser> parser; - SharedPtr<Store> store; + SharedPtr<EngineInterface> engine; + SharedPtr<Engine> local_engine; + SharedPtr<Serialisation::Serialiser> serialiser; + SharedPtr<Serialisation::Parser> parser; + SharedPtr<Store> store; SharedPtr<Glib::Module> serialisation_module; }; diff --git a/src/serialisation/Parser.hpp b/src/serialisation/Parser.hpp index 6fbb8be6..eea5ca9b 100644 --- a/src/serialisation/Parser.hpp +++ b/src/serialisation/Parser.hpp @@ -28,9 +28,6 @@ namespace Raul { class Path; } namespace Redland { class World; class Model; class Node; } namespace Ingen { namespace Shared { class CommonInterface; } } - -using namespace Ingen::Shared; - namespace Ingen { namespace Serialisation { @@ -38,86 +35,88 @@ namespace Serialisation { class Parser { public: virtual ~Parser() {} + + typedef Shared::GraphObject::Properties Properties; virtual bool parse_document( - Ingen::Shared::World* world, - Shared::CommonInterface* target, - Glib::ustring document_uri, - boost::optional<Raul::Path> data_path=boost::optional<Raul::Path>(), - boost::optional<Raul::Path> parent=boost::optional<Raul::Path>(), - boost::optional<Raul::Symbol> symbol=boost::optional<Raul::Symbol>(), - boost::optional<GraphObject::Properties> data=boost::optional<GraphObject::Properties>()); + Ingen::Shared::World* world, + Shared::CommonInterface* target, + Glib::ustring document_uri, + boost::optional<Raul::Path> data_path=boost::optional<Raul::Path>(), + boost::optional<Raul::Path> parent=boost::optional<Raul::Path>(), + boost::optional<Raul::Symbol> symbol=boost::optional<Raul::Symbol>(), + boost::optional<Properties> data=boost::optional<Properties>()); virtual bool parse_string( - Ingen::Shared::World* world, - Shared::CommonInterface* target, - const Glib::ustring& str, - const Glib::ustring& base_uri, - boost::optional<Raul::Path> data_path=boost::optional<Raul::Path>(), - boost::optional<Raul::Path> parent=boost::optional<Raul::Path>(), - boost::optional<Raul::Symbol> symbol=boost::optional<Raul::Symbol>(), - boost::optional<GraphObject::Properties> data=boost::optional<GraphObject::Properties>()); + Ingen::Shared::World* world, + Shared::CommonInterface* target, + const Glib::ustring& str, + const Glib::ustring& base_uri, + boost::optional<Raul::Path> data_path=boost::optional<Raul::Path>(), + boost::optional<Raul::Path> parent=boost::optional<Raul::Path>(), + boost::optional<Raul::Symbol> symbol=boost::optional<Raul::Symbol>(), + boost::optional<Properties> data=boost::optional<Properties>()); virtual bool parse_update( - Ingen::Shared::World* world, - Shared::CommonInterface* target, - const Glib::ustring& str, - const Glib::ustring& base_uri, - boost::optional<Raul::Path> data_path=boost::optional<Raul::Path>(), - boost::optional<Raul::Path> parent=boost::optional<Raul::Path>(), - boost::optional<Raul::Symbol> symbol=boost::optional<Raul::Symbol>(), - boost::optional<GraphObject::Properties> data=boost::optional<GraphObject::Properties>()); + Ingen::Shared::World* world, + Shared::CommonInterface* target, + const Glib::ustring& str, + const Glib::ustring& base_uri, + boost::optional<Raul::Path> data_path=boost::optional<Raul::Path>(), + boost::optional<Raul::Path> parent=boost::optional<Raul::Path>(), + boost::optional<Raul::Symbol> symbol=boost::optional<Raul::Symbol>(), + boost::optional<Properties> data=boost::optional<Properties>()); private: boost::optional<Raul::Path> parse( - Ingen::Shared::World* world, - Shared::CommonInterface* target, - Redland::Model& model, - Glib::ustring document_uri, - boost::optional<Raul::Path> data_path=boost::optional<Raul::Path>(), - boost::optional<Raul::Path> parent=boost::optional<Raul::Path>(), - boost::optional<Raul::Symbol> symbol=boost::optional<Raul::Symbol>(), - boost::optional<GraphObject::Properties> data=boost::optional<GraphObject::Properties>()); + Ingen::Shared::World* world, + Shared::CommonInterface* target, + Redland::Model& model, + Glib::ustring document_uri, + boost::optional<Raul::Path> data_path=boost::optional<Raul::Path>(), + boost::optional<Raul::Path> parent=boost::optional<Raul::Path>(), + boost::optional<Raul::Symbol> symbol=boost::optional<Raul::Symbol>(), + boost::optional<Properties> data=boost::optional<Properties>()); boost::optional<Raul::Path> parse_patch( - Ingen::Shared::World* world, - Ingen::Shared::CommonInterface* target, - Redland::Model& model, - const Redland::Node& subject, - boost::optional<Raul::Path> parent=boost::optional<Raul::Path>(), - boost::optional<Raul::Symbol> symbol=boost::optional<Raul::Symbol>(), - boost::optional<GraphObject::Properties> data=boost::optional<GraphObject::Properties>()); + Ingen::Shared::World* world, + Ingen::Shared::CommonInterface* target, + Redland::Model& model, + const Redland::Node& subject, + boost::optional<Raul::Path> parent=boost::optional<Raul::Path>(), + boost::optional<Raul::Symbol> symbol=boost::optional<Raul::Symbol>(), + boost::optional<Properties> data=boost::optional<Properties>()); boost::optional<Raul::Path> parse_node( - Ingen::Shared::World* world, - Ingen::Shared::CommonInterface* target, - Redland::Model& model, - const Redland::Node& subject, - const Raul::Path& path, - boost::optional<GraphObject::Properties> data=boost::optional<GraphObject::Properties>()); + Ingen::Shared::World* world, + Ingen::Shared::CommonInterface* target, + Redland::Model& model, + const Redland::Node& subject, + const Raul::Path& path, + boost::optional<Properties> data=boost::optional<Properties>()); boost::optional<Raul::Path> parse_port( - Ingen::Shared::World* world, - Ingen::Shared::CommonInterface* target, - Redland::Model& model, - const Redland::Node& subject, - const Raul::Path& path, - boost::optional<GraphObject::Properties> data=boost::optional<GraphObject::Properties>()); + Ingen::Shared::World* world, + Ingen::Shared::CommonInterface* target, + Redland::Model& model, + const Redland::Node& subject, + const Raul::Path& path, + boost::optional<Properties> data=boost::optional<Properties>()); bool parse_variables( - Ingen::Shared::World* world, - Ingen::Shared::CommonInterface* target, - Redland::Model& model, - const Redland::Node& subject, - const Raul::Path& path, - boost::optional<GraphObject::Properties> data=boost::optional<GraphObject::Properties>()); + Ingen::Shared::World* world, + Ingen::Shared::CommonInterface* target, + Redland::Model& model, + const Redland::Node& subject, + const Raul::Path& path, + boost::optional<Properties> data=boost::optional<Properties>()); bool parse_connections( - Ingen::Shared::World* world, - Ingen::Shared::CommonInterface* target, - Redland::Model& model, - const Glib::ustring& subject, - const Raul::Path& patch); + Ingen::Shared::World* world, + Ingen::Shared::CommonInterface* target, + Redland::Model& model, + const Glib::ustring& subject, + const Raul::Path& patch); }; diff --git a/src/serialisation/Serialiser.hpp b/src/serialisation/Serialiser.hpp index a2863871..95425bad 100644 --- a/src/serialisation/Serialiser.hpp +++ b/src/serialisation/Serialiser.hpp @@ -30,9 +30,6 @@ #include "interface/GraphObject.hpp" #include "shared/Store.hpp" -using namespace Raul; -using namespace Ingen::Shared; - namespace Ingen { namespace Shared { @@ -56,14 +53,16 @@ class Serialiser { public: Serialiser(Shared::World& world, SharedPtr<Shared::Store> store); + + typedef Shared::GraphObject::Properties Properties; struct Record { - Record(SharedPtr<GraphObject> o, const std::string& u) + Record(SharedPtr<Shared::GraphObject> o, const std::string& u) : object(o), uri(u) {} - const SharedPtr<GraphObject> object; - const std::string uri; + const SharedPtr<Shared::GraphObject> object; + const std::string uri; }; typedef std::list<Record> Records; @@ -75,15 +74,15 @@ public: void write_manifest(const std::string& bundle_uri, const Records& records); - std::string to_string(SharedPtr<GraphObject> object, - const std::string& base_uri, - const GraphObject::Properties& extra_rdf); + std::string to_string(SharedPtr<Shared::GraphObject> object, + const std::string& base_uri, + const Properties& extra_rdf); void start_to_string(const Raul::Path& root, const std::string& base_uri); - void serialise(SharedPtr<GraphObject> object) throw (std::logic_error); + void serialise(SharedPtr<Shared::GraphObject> object) throw (std::logic_error); void serialise_plugin(const Shared::Plugin& p); - void serialise_connection(SharedPtr<GraphObject> parent, - SharedPtr<Shared::Connection> c) throw (std::logic_error); + void serialise_connection(SharedPtr<Shared::GraphObject> parent, + SharedPtr<Shared::Connection> c) throw (std::logic_error); std::string finish(); @@ -100,11 +99,11 @@ private: void serialise_port(const Shared::Port* p, const Redland::Node& id); void serialise_port_class(const Shared::Port* p, const Redland::Node& id); - void serialise_properties(Redland::Node subject, const GraphObject::Properties& properties); - void serialise_variables(Redland::Node subject, const GraphObject::Properties& variables); + void serialise_properties(Redland::Node subject, const Properties& properties); + void serialise_variables(Redland::Node subject, const Properties& variables); - Redland::Node instance_rdf_node(const Path& path); - Redland::Node class_rdf_node(const Path& path); + Redland::Node instance_rdf_node(const Raul::Path& path); + Redland::Node class_rdf_node(const Raul::Path& path); Raul::Path _root_path; SharedPtr<Shared::Store> _store; diff --git a/src/serialisation/serialisation.cpp b/src/serialisation/serialisation.cpp index 3615d8c9..172db2a1 100644 --- a/src/serialisation/serialisation.cpp +++ b/src/serialisation/serialisation.cpp @@ -33,7 +33,7 @@ new_parser() Ingen::Serialisation::Serialiser* -new_serialiser(Ingen::Shared::World* world, SharedPtr<Store> store) +new_serialiser(Ingen::Shared::World* world, SharedPtr<Shared::Store> store) { assert(world->rdf_world); return new Serialiser(*world, store); diff --git a/src/shared/Store.hpp b/src/shared/Store.hpp index 809ebabc..1f52e1e9 100644 --- a/src/shared/Store.hpp +++ b/src/shared/Store.hpp @@ -23,8 +23,6 @@ #include "raul/PathTable.hpp" #include "interface/GraphObject.hpp" -using Raul::PathTable; - namespace Ingen { namespace Shared { |