diff options
author | David Robillard <d@drobilla.net> | 2017-02-15 23:18:59 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2017-02-15 23:26:03 +0100 |
commit | fa6bb9afe8fcf2b0b8348495b9c4e1d6425136f0 (patch) | |
tree | e69cd957486b3fe8a82c0b56f26aec0a23b8235c /src/server | |
parent | 2ba09e4b41b01cbd8f8756eb0e3b7e33136e06b3 (diff) | |
download | ingen-fa6bb9afe8fcf2b0b8348495b9c4e1d6425136f0.tar.gz ingen-fa6bb9afe8fcf2b0b8348495b9c4e1d6425136f0.tar.bz2 ingen-fa6bb9afe8fcf2b0b8348495b9c4e1d6425136f0.zip |
Move Properties out of Resource
Diffstat (limited to 'src/server')
-rw-r--r-- | src/server/Broadcaster.hpp | 12 | ||||
-rw-r--r-- | src/server/ClientUpdate.cpp | 10 | ||||
-rw-r--r-- | src/server/ClientUpdate.hpp | 12 | ||||
-rw-r--r-- | src/server/DuplexPort.cpp | 8 | ||||
-rw-r--r-- | src/server/DuplexPort.hpp | 6 | ||||
-rw-r--r-- | src/server/Engine.cpp | 8 | ||||
-rw-r--r-- | src/server/EventWriter.cpp | 12 | ||||
-rw-r--r-- | src/server/EventWriter.hpp | 12 | ||||
-rw-r--r-- | src/server/NodeImpl.cpp | 2 | ||||
-rw-r--r-- | src/server/PortImpl.hpp | 6 | ||||
-rw-r--r-- | src/server/events/Connect.hpp | 8 | ||||
-rw-r--r-- | src/server/events/CreateBlock.cpp | 16 | ||||
-rw-r--r-- | src/server/events/CreateBlock.hpp | 24 | ||||
-rw-r--r-- | src/server/events/CreateGraph.cpp | 24 | ||||
-rw-r--r-- | src/server/events/CreateGraph.hpp | 26 | ||||
-rw-r--r-- | src/server/events/CreatePort.cpp | 18 | ||||
-rw-r--r-- | src/server/events/CreatePort.hpp | 32 | ||||
-rw-r--r-- | src/server/events/Delta.cpp | 8 | ||||
-rw-r--r-- | src/server/events/Delta.hpp | 26 |
19 files changed, 134 insertions, 136 deletions
diff --git a/src/server/Broadcaster.hpp b/src/server/Broadcaster.hpp index 9efb9c30..2d184559 100644 --- a/src/server/Broadcaster.hpp +++ b/src/server/Broadcaster.hpp @@ -99,15 +99,15 @@ public: void bundle_begin() { BROADCAST(bundle_begin); } void bundle_end() { BROADCAST(bundle_end); } - void put(const Raul::URI& uri, - const Resource::Properties& properties, - Resource::Graph ctx=Resource::Graph::DEFAULT) { + void put(const Raul::URI& uri, + const Properties& properties, + Resource::Graph ctx = Resource::Graph::DEFAULT) { BROADCAST(put, uri, properties); } - void delta(const Raul::URI& uri, - const Resource::Properties& remove, - const Resource::Properties& add) { + void delta(const Raul::URI& uri, + const Properties& remove, + const Properties& add) { BROADCAST(delta, uri, remove, add); } diff --git a/src/server/ClientUpdate.cpp b/src/server/ClientUpdate.cpp index 217d3a32..e4d9c08f 100644 --- a/src/server/ClientUpdate.cpp +++ b/src/server/ClientUpdate.cpp @@ -27,9 +27,9 @@ namespace Ingen { namespace Server { void -ClientUpdate::put(const Raul::URI& uri, - const Resource::Properties& props, - Resource::Graph ctx) +ClientUpdate::put(const Raul::URI& uri, + const Properties& props, + Resource::Graph ctx) { const ClientUpdate::Put put = { uri, props, ctx }; puts.push_back(put); @@ -40,7 +40,7 @@ ClientUpdate::put_port(const PortImpl* port) { const URIs& uris = port->bufs().uris(); if (port->is_a(PortType::CONTROL) || port->is_a(PortType::CV)) { - Resource::Properties props = port->properties(); + Properties props = port->properties(); props.erase(uris.ingen_value); props.insert(std::make_pair(uris.ingen_value, port->value())); put(port->uri(), props); @@ -110,7 +110,7 @@ ClientUpdate::put_preset(const URIs& uris, const Raul::URI& preset, const std::string& label) { - Resource::Properties props{ + const Properties props{ { uris.rdf_type, uris.pset_Preset.urid }, { uris.rdfs_label, uris.forge.alloc(label) }, { uris.lv2_appliesTo, uris.forge.make_urid(plugin) }}; diff --git a/src/server/ClientUpdate.hpp b/src/server/ClientUpdate.hpp index dcdcc132..ea11c2b8 100644 --- a/src/server/ClientUpdate.hpp +++ b/src/server/ClientUpdate.hpp @@ -42,9 +42,9 @@ class PluginImpl; * post_process() to avoid the need to lock. */ struct ClientUpdate { - void put(const Raul::URI& uri, - const Resource::Properties& props, - Resource::Graph ctx=Resource::Graph::DEFAULT); + void put(const Raul::URI& uri, + const Properties& props, + Resource::Graph ctx = Resource::Graph::DEFAULT); void put_port(const PortImpl* port); void put_block(const BlockImpl* block); @@ -60,9 +60,9 @@ struct ClientUpdate { void send(Interface* dest); struct Put { - Raul::URI uri; - Resource::Properties properties; - Resource::Graph ctx; + Raul::URI uri; + Properties properties; + Resource::Graph ctx; }; struct Connect { diff --git a/src/server/DuplexPort.cpp b/src/server/DuplexPort.cpp index 0fa11a72..e1ef6b26 100644 --- a/src/server/DuplexPort.cpp +++ b/src/server/DuplexPort.cpp @@ -93,9 +93,9 @@ DuplexPort::duplicate(Engine& engine, } void -DuplexPort::inherit_neighbour(const PortImpl* port, - Resource::Properties& remove, - Resource::Properties& add) +DuplexPort::inherit_neighbour(const PortImpl* port, + Properties& remove, + Properties& add) { const URIs& uris = _bufs.uris(); @@ -113,7 +113,7 @@ DuplexPort::inherit_neighbour(const PortImpl* port, add.insert(std::make_pair(uris.lv2_maximum, port->maximum())); } } else if (_type == PortType::ATOM) { - for (Resource::Properties::const_iterator i = port->properties().find( + for (Properties::const_iterator i = port->properties().find( uris.atom_supports); i != port->properties().end() && i->first == uris.atom_supports; ++i) { diff --git a/src/server/DuplexPort.hpp b/src/server/DuplexPort.hpp index 47c24b9e..adec2bef 100644 --- a/src/server/DuplexPort.hpp +++ b/src/server/DuplexPort.hpp @@ -57,9 +57,9 @@ public: const Raul::Symbol& symbol, GraphImpl* parent); - void inherit_neighbour(const PortImpl* port, - Resource::Properties& remove, - Resource::Properties& add); + void inherit_neighbour(const PortImpl* port, + Properties& remove, + Properties& add); void on_property(const Raul::URI& uri, const Atom& value); diff --git a/src/server/Engine.cpp b/src/server/Engine.cpp index d12f474c..794088bc 100644 --- a/src/server/Engine.cpp +++ b/src/server/Engine.cpp @@ -374,14 +374,14 @@ Engine::activate() if (!_root_graph) { // Create root graph - Resource::Properties graph_properties; + Properties graph_properties; graph_properties.insert( make_pair(uris.rdf_type, - Resource::Property(uris.ingen_Graph))); + Property(uris.ingen_Graph))); graph_properties.insert( make_pair(uris.ingen_polyphony, - Resource::Property(_world->forge().make(1), - Resource::Graph::INTERNAL))); + Property(_world->forge().make(1), + Resource::Graph::INTERNAL))); Events::CreateGraph ev( *this, SPtr<Interface>(), -1, 0, Raul::Path("/"), graph_properties); diff --git a/src/server/EventWriter.cpp b/src/server/EventWriter.cpp index 5aecf2db..1cd573b2 100644 --- a/src/server/EventWriter.cpp +++ b/src/server/EventWriter.cpp @@ -67,9 +67,9 @@ EventWriter::bundle_end() } void -EventWriter::put(const Raul::URI& uri, - const Resource::Properties& properties, - const Resource::Graph ctx) +EventWriter::put(const Raul::URI& uri, + const Properties& properties, + const Resource::Graph ctx) { _engine.enqueue_event( new Events::Delta(_engine, _respondee, _request_id, now(), @@ -78,9 +78,9 @@ EventWriter::put(const Raul::URI& uri, } void -EventWriter::delta(const Raul::URI& uri, - const Resource::Properties& remove, - const Resource::Properties& add) +EventWriter::delta(const Raul::URI& uri, + const Properties& remove, + const Properties& add) { _engine.enqueue_event( new Events::Delta(_engine, _respondee, _request_id, now(), diff --git a/src/server/EventWriter.hpp b/src/server/EventWriter.hpp index 5e05af0c..32e3b249 100644 --- a/src/server/EventWriter.hpp +++ b/src/server/EventWriter.hpp @@ -57,13 +57,13 @@ public: virtual void bundle_end(); - virtual void put(const Raul::URI& path, - const Resource::Properties& properties, - const Resource::Graph g=Resource::Graph::DEFAULT); + virtual void put(const Raul::URI& path, + const Properties& properties, + const Resource::Graph g = Resource::Graph::DEFAULT); - virtual void delta(const Raul::URI& path, - const Resource::Properties& remove, - const Resource::Properties& add); + virtual void delta(const Raul::URI& path, + const Properties& remove, + const Properties& add); virtual void copy(const Raul::URI& old_uri, const Raul::URI& new_uri); diff --git a/src/server/NodeImpl.cpp b/src/server/NodeImpl.cpp index c95f3c5e..4a027558 100644 --- a/src/server/NodeImpl.cpp +++ b/src/server/NodeImpl.cpp @@ -38,7 +38,7 @@ NodeImpl::get_property(const Raul::URI& key) const { ThreadManager::assert_not_thread(THREAD_PROCESS); static const Atom null_atom; - Resource::Properties::const_iterator i = properties().find(key); + Properties::const_iterator i = properties().find(key); return (i != properties().end()) ? i->second : null_atom; } diff --git a/src/server/PortImpl.hpp b/src/server/PortImpl.hpp index e195de9d..27b3db2f 100644 --- a/src/server/PortImpl.hpp +++ b/src/server/PortImpl.hpp @@ -186,9 +186,9 @@ public: This is used for Graph ports, so e.g. a control input has the range of all the ports it is connected to. */ - virtual void inherit_neighbour(const PortImpl* port, - Resource::Properties& remove, - Resource::Properties& add) {} + virtual void inherit_neighbour(const PortImpl* port, + Properties& remove, + Properties& add) {} virtual void connect_buffers(SampleCount offset=0); virtual void recycle_buffers(); diff --git a/src/server/events/Connect.hpp b/src/server/events/Connect.hpp index 8e7a5030..78c0befa 100644 --- a/src/server/events/Connect.hpp +++ b/src/server/events/Connect.hpp @@ -64,10 +64,10 @@ private: MPtr<CompiledGraph> _compiled_graph; SPtr<ArcImpl> _arc; MPtr<PortImpl::Voices> _voices; - Resource::Properties _tail_remove; - Resource::Properties _tail_add; - Resource::Properties _head_remove; - Resource::Properties _head_add; + Properties _tail_remove; + Properties _tail_add; + Properties _head_remove; + Properties _head_add; }; } // namespace Events diff --git a/src/server/events/CreateBlock.cpp b/src/server/events/CreateBlock.cpp index db561e1c..0b4cbae3 100644 --- a/src/server/events/CreateBlock.cpp +++ b/src/server/events/CreateBlock.cpp @@ -35,12 +35,12 @@ namespace Ingen { namespace Server { namespace Events { -CreateBlock::CreateBlock(Engine& engine, - SPtr<Interface> client, - int32_t id, - SampleCount timestamp, - const Raul::Path& path, - Resource::Properties& properties) +CreateBlock::CreateBlock(Engine& engine, + SPtr<Interface> client, + int32_t id, + SampleCount timestamp, + const Raul::Path& path, + Properties& properties) : Event(engine, client, id, timestamp) , _path(path) , _properties(properties) @@ -55,7 +55,7 @@ CreateBlock::~CreateBlock() bool CreateBlock::pre_process(PreProcessContext& ctx) { - typedef Resource::Properties::const_iterator iterator; + typedef Properties::const_iterator iterator; const Ingen::URIs& uris = _engine.world()->uris(); const SPtr<Store> store = _engine.store(); @@ -121,7 +121,7 @@ CreateBlock::pre_process(PreProcessContext& ctx) // Load state from directory if given in properties LilvState* state = NULL; - Resource::Properties::iterator s = _properties.find(uris.state_state); + Properties::iterator s = _properties.find(uris.state_state); if (s != _properties.end() && s->second.type() == uris.forge.Path) { state = LV2Block::load_state(_engine.world(), s->second.ptr<char>()); } diff --git a/src/server/events/CreateBlock.hpp b/src/server/events/CreateBlock.hpp index 047c01f3..7ffd9931 100644 --- a/src/server/events/CreateBlock.hpp +++ b/src/server/events/CreateBlock.hpp @@ -38,12 +38,12 @@ namespace Events { class CreateBlock : public Event { public: - CreateBlock(Engine& engine, - SPtr<Interface> client, - int32_t id, - SampleCount timestamp, - const Raul::Path& block_path, - Resource::Properties& properties); + CreateBlock(Engine& engine, + SPtr<Interface> client, + int32_t id, + SampleCount timestamp, + const Raul::Path& block_path, + Properties& properties); ~CreateBlock(); @@ -53,12 +53,12 @@ public: void undo(Interface& target); private: - Raul::Path _path; - Resource::Properties& _properties; - ClientUpdate _update; - GraphImpl* _graph; - BlockImpl* _block; - MPtr<CompiledGraph> _compiled_graph; + Raul::Path _path; + Properties& _properties; + ClientUpdate _update; + GraphImpl* _graph; + BlockImpl* _block; + MPtr<CompiledGraph> _compiled_graph; }; } // namespace Events diff --git a/src/server/events/CreateGraph.cpp b/src/server/events/CreateGraph.cpp index 1fff9f95..891ca33c 100644 --- a/src/server/events/CreateGraph.cpp +++ b/src/server/events/CreateGraph.cpp @@ -31,12 +31,12 @@ namespace Ingen { namespace Server { namespace Events { -CreateGraph::CreateGraph(Engine& engine, - SPtr<Interface> client, - int32_t id, - SampleCount timestamp, - const Raul::Path& path, - const Resource::Properties& properties) +CreateGraph::CreateGraph(Engine& engine, + SPtr<Interface> client, + int32_t id, + SampleCount timestamp, + const Raul::Path& path, + const Properties& properties) : Event(engine, client, id, timestamp) , _path(path) , _properties(properties) @@ -57,7 +57,7 @@ CreateGraph::build_child_events() const Ingen::URIs& uris = _engine.world()->uris(); // Properties common to both ports - Resource::Properties control_properties; + Properties control_properties; control_properties.put(uris.atom_bufferType, uris.atom_Sequence); control_properties.put(uris.atom_supports, uris.patch_Message); control_properties.put(uris.lv2_designation, uris.lv2_control); @@ -66,7 +66,7 @@ CreateGraph::build_child_events() control_properties.put(uris.rsz_minimumSize, uris.forge.make(4096)); // Add control port (message receive) - Resource::Properties in_properties(control_properties); + Properties in_properties(control_properties); in_properties.put(uris.lv2_index, uris.forge.make(0)); in_properties.put(uris.lv2_name, uris.forge.alloc("Control")); in_properties.put(uris.rdf_type, uris.lv2_InputPort); @@ -82,7 +82,7 @@ CreateGraph::build_child_events() in_properties)); // Add notify port (message respond) - Resource::Properties out_properties(control_properties); + Properties out_properties(control_properties); out_properties.put(uris.lv2_index, uris.forge.make(1)); out_properties.put(uris.lv2_name, uris.forge.alloc("Notify")); out_properties.put(uris.rdf_type, uris.lv2_OutputPort); @@ -113,7 +113,7 @@ CreateGraph::pre_process(PreProcessContext& ctx) const Ingen::URIs& uris = _engine.world()->uris(); - typedef Resource::Properties::const_iterator iterator; + typedef Properties::const_iterator iterator; uint32_t ext_poly = 1; uint32_t int_poly = 1; @@ -158,8 +158,8 @@ CreateGraph::pre_process(PreProcessContext& ctx) _engine.driver()->sample_rate(), int_poly); _graph->add_property(uris.rdf_type, uris.ingen_Graph.urid); _graph->add_property(uris.rdf_type, - Resource::Property(uris.ingen_Block, - Resource::Graph::EXTERNAL)); + Property(uris.ingen_Block, + Resource::Graph::EXTERNAL)); } _graph->set_properties(_properties); diff --git a/src/server/events/CreateGraph.hpp b/src/server/events/CreateGraph.hpp index 896a18f9..9b4124e4 100644 --- a/src/server/events/CreateGraph.hpp +++ b/src/server/events/CreateGraph.hpp @@ -37,12 +37,12 @@ namespace Events { class CreateGraph : public Event { public: - CreateGraph(Engine& engine, - SPtr<Interface> client, - int32_t id, - SampleCount timestamp, - const Raul::Path& path, - const Resource::Properties& properties); + CreateGraph(Engine& engine, + SPtr<Interface> client, + int32_t id, + SampleCount timestamp, + const Raul::Path& path, + const Properties& properties); ~CreateGraph(); @@ -56,13 +56,13 @@ public: private: void build_child_events(); - const Raul::Path _path; - Resource::Properties _properties; - ClientUpdate _update; - GraphImpl* _graph; - GraphImpl* _parent; - MPtr<CompiledGraph> _compiled_graph; - std::list<Event*> _child_events; + const Raul::Path _path; + Properties _properties; + ClientUpdate _update; + GraphImpl* _graph; + GraphImpl* _parent; + MPtr<CompiledGraph> _compiled_graph; + std::list<Event*> _child_events; }; } // namespace Events diff --git a/src/server/events/CreatePort.cpp b/src/server/events/CreatePort.cpp index 63301efd..4e34762a 100644 --- a/src/server/events/CreatePort.cpp +++ b/src/server/events/CreatePort.cpp @@ -36,12 +36,12 @@ namespace Ingen { namespace Server { namespace Events { -CreatePort::CreatePort(Engine& engine, - SPtr<Interface> client, - int32_t id, - SampleCount timestamp, - const Raul::Path& path, - const Resource::Properties& properties) +CreatePort::CreatePort(Engine& engine, + SPtr<Interface> client, + int32_t id, + SampleCount timestamp, + const Raul::Path& path, + const Properties& properties) : Event(engine, client, id, timestamp) , _path(path) , _port_type(PortType::UNKNOWN) @@ -53,8 +53,8 @@ CreatePort::CreatePort(Engine& engine, { const Ingen::URIs& uris = _engine.world()->uris(); - typedef Resource::Properties::const_iterator Iterator; - typedef std::pair<Iterator, Iterator> Range; + typedef Properties::const_iterator Iterator; + typedef std::pair<Iterator, Iterator> Range; const Range types = properties.equal_range(uris.rdf_type); for (Iterator i = types.first; i != types.second; ++i) { @@ -109,7 +109,7 @@ CreatePort::pre_process(PreProcessContext& ctx) const uint32_t buf_size = bufs.default_size(_buf_type); const int32_t old_n_ports = _graph->num_ports_non_rt(); - typedef Resource::Properties::const_iterator PropIter; + typedef Properties::const_iterator PropIter; PropIter index_i = _properties.find(uris.lv2_index); if (index_i == _properties.end()) { diff --git a/src/server/events/CreatePort.hpp b/src/server/events/CreatePort.hpp index 2d32f1dd..a2ea7682 100644 --- a/src/server/events/CreatePort.hpp +++ b/src/server/events/CreatePort.hpp @@ -45,12 +45,12 @@ namespace Events { class CreatePort : public Event { public: - CreatePort(Engine& engine, - SPtr<Interface> client, - int32_t id, - SampleCount timestamp, - const Raul::Path& path, - const Resource::Properties& properties); + CreatePort(Engine& engine, + SPtr<Interface> client, + int32_t id, + SampleCount timestamp, + const Raul::Path& path, + const Properties& properties); bool pre_process(PreProcessContext& ctx); void execute(RunContext& context); @@ -63,16 +63,16 @@ private: OUTPUT }; - Raul::Path _path; - PortType _port_type; - LV2_URID _buf_type; - GraphImpl* _graph; - DuplexPort* _graph_port; - MPtr<BlockImpl::Ports> _ports_array; ///< New external port array for Graph - EnginePort* _engine_port; ///< Driver port if on the root - Resource::Properties _properties; - Resource::Properties _update; - boost::optional<Flow> _flow; + Raul::Path _path; + PortType _port_type; + LV2_URID _buf_type; + GraphImpl* _graph; + DuplexPort* _graph_port; + MPtr<BlockImpl::Ports> _ports_array; ///< New external port array for Graph + EnginePort* _engine_port; ///< Driver port if on the root + Properties _properties; + Properties _update; + boost::optional<Flow> _flow; }; } // namespace Events diff --git a/src/server/events/Delta.cpp b/src/server/events/Delta.cpp index 0398face..9f4c1da2 100644 --- a/src/server/events/Delta.cpp +++ b/src/server/events/Delta.cpp @@ -42,8 +42,6 @@ namespace Ingen { namespace Server { namespace Events { -typedef Resource::Properties Properties; - Delta::Delta(Engine& engine, SPtr<Interface> client, int32_t id, @@ -276,9 +274,9 @@ Delta::pre_process(PreProcessContext& ctx) } for (const auto& p : _properties) { - const Raul::URI& key = p.first; - const Resource::Property& value = p.second; - SpecialType op = SpecialType::NONE; + const Raul::URI& key = p.first; + const Property& value = p.second; + SpecialType op = SpecialType::NONE; if (obj) { Resource& resource = *obj; if (value != uris.patch_wildcard) { diff --git a/src/server/events/Delta.hpp b/src/server/events/Delta.hpp index d751afc7..842986a9 100644 --- a/src/server/events/Delta.hpp +++ b/src/server/events/Delta.hpp @@ -56,15 +56,15 @@ public: PATCH }; - Delta(Engine& engine, - SPtr<Interface> client, - int32_t id, - SampleCount timestamp, - Type type, - Resource::Graph context, - const Raul::URI& subject, - const Resource::Properties& properties, - const Resource::Properties& remove = Resource::Properties()); + Delta(Engine& engine, + SPtr<Interface> client, + int32_t id, + SampleCount timestamp, + Type type, + Resource::Graph context, + const Raul::URI& subject, + const Properties& properties, + const Properties& remove = Properties()); ~Delta(); @@ -99,8 +99,8 @@ private: std::vector<SpecialType> _types; std::vector<SpecialType> _remove_types; Raul::URI _subject; - Resource::Properties _properties; - Resource::Properties _remove; + Properties _properties; + Properties _remove; ClientUpdate _update; Ingen::Resource* _object; GraphImpl* _graph; @@ -110,8 +110,8 @@ private: Resource::Graph _context; Type _type; - Resource::Properties _added; - Resource::Properties _removed; + Properties _added; + Properties _removed; std::vector<ControlBindings::Binding*> _removed_bindings; |