From 0c9e861caa8b1eed5068942edc35d5f91bac816e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 10 May 2012 06:24:07 +0000 Subject: Work towards translatable strings and a cleaner log interface. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4338 a436a847-0d15-0410-975c-d299462d15a1 --- src/server/AudioBuffer.cpp | 1 - src/server/BufferFactory.cpp | 2 -- src/server/ClientBroadcaster.cpp | 27 +++++++++-------- src/server/ControlBindings.cpp | 13 ++++----- src/server/Engine.cpp | 1 - src/server/EngineStore.cpp | 17 +++++------ src/server/EventWriter.cpp | 37 ++++++++++------------- src/server/GraphObjectImpl.cpp | 9 +++--- src/server/InternalPlugin.cpp | 1 - src/server/JackDriver.cpp | 58 +++++++++++++++---------------------- src/server/JackDriver.hpp | 4 --- src/server/LV2Node.cpp | 19 ++++++------ src/server/LV2Plugin.cpp | 3 +- src/server/MessageContext.cpp | 1 - src/server/NodeFactory.cpp | 1 - src/server/ObjectSender.cpp | 7 ++--- src/server/PatchImpl.cpp | 7 ++--- src/server/PluginImpl.cpp | 5 ++-- src/server/PortImpl.cpp | 9 +++--- src/server/PostProcessor.cpp | 1 - src/server/events/Connect.cpp | 15 ++++------ src/server/events/CreateNode.cpp | 7 ++--- src/server/events/CreatePatch.cpp | 5 +--- src/server/events/CreatePort.cpp | 7 ++--- src/server/events/Delete.cpp | 2 -- src/server/events/Disconnect.cpp | 3 -- src/server/events/DisconnectAll.cpp | 15 ++++------ src/server/events/Get.cpp | 16 +++++----- src/server/events/Move.cpp | 27 ++++++++--------- src/server/events/SetMetadata.cpp | 13 ++++----- src/server/events/SetPortValue.cpp | 5 +--- src/server/internals/Delay.cpp | 1 - src/server/internals/Note.cpp | 1 - src/server/internals/Trigger.cpp | 1 - 34 files changed, 133 insertions(+), 208 deletions(-) (limited to 'src/server') diff --git a/src/server/AudioBuffer.cpp b/src/server/AudioBuffer.cpp index 66977643..476bdf07 100644 --- a/src/server/AudioBuffer.cpp +++ b/src/server/AudioBuffer.cpp @@ -26,7 +26,6 @@ #include "ProcessContext.hpp" using namespace std; -using namespace Raul; /* TODO: Be sure these functions are vectorized by GCC when its vectorizer * stops sucking. Probably a good idea to inline them as well */ diff --git a/src/server/BufferFactory.cpp b/src/server/BufferFactory.cpp index fce074da..535da6b5 100644 --- a/src/server/BufferFactory.cpp +++ b/src/server/BufferFactory.cpp @@ -25,8 +25,6 @@ #include "Engine.hpp" #include "ThreadManager.hpp" -using namespace Raul; - namespace Ingen { namespace Server { diff --git a/src/server/ClientBroadcaster.cpp b/src/server/ClientBroadcaster.cpp index 42aad778..1194cd82 100644 --- a/src/server/ClientBroadcaster.cpp +++ b/src/server/ClientBroadcaster.cpp @@ -16,19 +16,18 @@ #include #include -#include "raul/log.hpp" + #include "ingen/Interface.hpp" +#include "raul/log.hpp" + #include "ClientBroadcaster.hpp" -#include "PluginImpl.hpp" #include "ConnectionImpl.hpp" #include "EngineStore.hpp" #include "ObjectSender.hpp" +#include "PluginImpl.hpp" #include "util.hpp" -#define LOG(s) s << "[ClientBroadcaster] " - -using namespace std; -using namespace Raul; +#define LOG(s) (s("[ClientBroadcaster] ")) namespace Ingen { namespace Server { @@ -36,10 +35,11 @@ namespace Server { /** Register a client to receive messages over the notification band. */ void -ClientBroadcaster::register_client(const URI& uri, SharedPtr client) +ClientBroadcaster::register_client(const Raul::URI& uri, + SharedPtr client) { Glib::Mutex::Lock lock(_clients_mutex); - LOG(info) << "Registered client: " << uri << endl; + LOG(Raul::info)(Raul::fmt("Registered client <%1%>\n") % uri); _clients[uri] = client; } @@ -48,15 +48,13 @@ ClientBroadcaster::register_client(const URI& uri, SharedPtr client) * @return true if client was found and removed. */ bool -ClientBroadcaster::unregister_client(const URI& uri) +ClientBroadcaster::unregister_client(const Raul::URI& uri) { Glib::Mutex::Lock lock(_clients_mutex); const size_t erased = _clients.erase(uri); if (erased > 0) { - LOG(info) << "Unregistered client: " << uri << endl; - } else { - LOG(warn) << "Failed to find client to unregister: " << uri << endl; + LOG(Raul::info)(Raul::fmt("Unregistered client <%1%>\n") % uri); } return (erased > 0); @@ -66,7 +64,7 @@ ClientBroadcaster::unregister_client(const URI& uri) * unique identifier for registered clients). */ SharedPtr -ClientBroadcaster::client(const URI& uri) +ClientBroadcaster::client(const Raul::URI& uri) { Glib::Mutex::Lock lock(_clients_mutex); Clients::iterator i = _clients.find(uri); @@ -87,7 +85,8 @@ ClientBroadcaster::send_plugins(const NodeFactory::Plugins& plugins) } void -ClientBroadcaster::send_plugins_to(Interface* client, const NodeFactory::Plugins& plugins) +ClientBroadcaster::send_plugins_to(Interface* client, + const NodeFactory::Plugins& plugins) { client->bundle_begin(); diff --git a/src/server/ControlBindings.cpp b/src/server/ControlBindings.cpp index ac0d5018..1cf8e969 100644 --- a/src/server/ControlBindings.cpp +++ b/src/server/ControlBindings.cpp @@ -33,7 +33,6 @@ #define LOG(s) s << "[ControlBindings] " using namespace std; -using namespace Raul; namespace Ingen { namespace Server { @@ -68,9 +67,9 @@ ControlBindings::binding_key(const Raul::Atom& binding) const const Ingen::Shared::URIs& uris = *_engine.world()->uris().get(); Key key; if (binding.type() == _engine.world()->forge().Dict) { - const Atom::DictValue& dict = binding.get_dict(); - Atom::DictValue::const_iterator t = dict.find(uris.rdf_type); - Atom::DictValue::const_iterator n; + const Raul::Atom::DictValue& dict = binding.get_dict(); + Raul::Atom::DictValue::const_iterator t = dict.find(uris.rdf_type); + Raul::Atom::DictValue::const_iterator n; if (t == dict.end()) { return key; } else if (t->second == uris.midi_Bender) { @@ -225,14 +224,14 @@ ControlBindings::port_value_to_control(PortImpl* port, float normal = (value - min) / (max - min); if (normal < 0.0f) { - warn << "Value " << value << " (normal " << normal << ") for " + LOG(Raul::warn) << "Value " << value << " (normal " << normal << ") for " << port->path() << " out of range" << endl; normal = 0.0f; } if (normal > 1.0f) { - warn << "Value " << value << " (normal " << normal << ") for " - << port->path() << " out of range" << endl; + LOG(Raul::warn) << "Value " << value << " (normal " << normal << ") for " + << port->path() << " out of range" << endl; normal = 1.0f; } diff --git a/src/server/Engine.cpp b/src/server/Engine.cpp index 004a9806..971b41e0 100644 --- a/src/server/Engine.cpp +++ b/src/server/Engine.cpp @@ -45,7 +45,6 @@ #include "ThreadManager.hpp" using namespace std; -using namespace Raul; namespace Ingen { namespace Server { diff --git a/src/server/EngineStore.cpp b/src/server/EngineStore.cpp index 105fcc3c..00856ee5 100644 --- a/src/server/EngineStore.cpp +++ b/src/server/EngineStore.cpp @@ -29,7 +29,6 @@ #define LOG(s) s << "[EngineStore] " using namespace std; -using namespace Raul; namespace Ingen { namespace Server { @@ -42,7 +41,7 @@ EngineStore::~EngineStore() /** Find the Patch at the given path. */ PatchImpl* -EngineStore::find_patch(const Path& path) +EngineStore::find_patch(const Raul::Path& path) { GraphObjectImpl* const object = find_object(path); return dynamic_cast(object); @@ -51,7 +50,7 @@ EngineStore::find_patch(const Path& path) /** Find the Node at the given path. */ NodeImpl* -EngineStore::find_node(const Path& path) +EngineStore::find_node(const Raul::Path& path) { GraphObjectImpl* const object = find_object(path); return dynamic_cast(object); @@ -60,7 +59,7 @@ EngineStore::find_node(const Path& path) /** Find the Port at the given path. */ PortImpl* -EngineStore::find_port(const Path& path) +EngineStore::find_port(const Raul::Path& path) { GraphObjectImpl* const object = find_object(path); return dynamic_cast(object); @@ -69,7 +68,7 @@ EngineStore::find_port(const Path& path) /** Find the Object at the given path. */ GraphObjectImpl* -EngineStore::find_object(const Path& path) +EngineStore::find_object(const Raul::Path& path) { iterator i = find(path); return ((i == end()) ? NULL : dynamic_cast(i->second.get())); @@ -99,7 +98,7 @@ EngineStore::add(const Objects& table) * including the object itself, in lexicographically sorted order by Path. */ SharedPtr -EngineStore::remove(const Path& path) +EngineStore::remove(const Raul::Path& path) { return remove(find(path)); } @@ -121,7 +120,7 @@ EngineStore::remove(iterator object) return removed; } else { - LOG(warn) << "Removing " << object->first << " failed." << endl; + LOG(Raul::warn) << "Removing " << object->first << " failed." << endl; return SharedPtr(); } } @@ -132,7 +131,7 @@ EngineStore::remove(iterator object) * in lexicographically sorted order by Path. */ SharedPtr -EngineStore::remove_children(const Path& path) +EngineStore::remove_children(const Raul::Path& path) { return remove_children(find(path)); } @@ -153,7 +152,7 @@ EngineStore::remove_children(iterator object) return yank(first_child, descendants_end); } } else { - LOG(warn) << "Removing children of " << object->first << " failed." << endl; + LOG(Raul::warn) << "Removing children of " << object->first << " failed." << endl; return SharedPtr(); } diff --git a/src/server/EventWriter.cpp b/src/server/EventWriter.cpp index 4ec0756b..7286cc9e 100644 --- a/src/server/EventWriter.cpp +++ b/src/server/EventWriter.cpp @@ -29,7 +29,6 @@ #define LOG(s) s << "[EventWriter] " using namespace std; -using namespace Raul; namespace Ingen { namespace Server { @@ -62,7 +61,7 @@ EventWriter::set_response_id(int32_t id) } void -EventWriter::put(const URI& uri, +EventWriter::put(const Raul::URI& uri, const Resource::Properties& properties, const Resource::Graph ctx) { @@ -72,7 +71,7 @@ EventWriter::put(const URI& uri, } void -EventWriter::delta(const URI& uri, +EventWriter::delta(const Raul::URI& uri, const Resource::Properties& remove, const Resource::Properties& add) { @@ -82,8 +81,8 @@ EventWriter::delta(const URI& uri, } void -EventWriter::move(const Path& old_path, - const Path& new_path) +EventWriter::move(const Raul::Path& old_path, + const Raul::Path& new_path) { _engine.enqueue_event( new Events::Move(_engine, _respondee.get(), _request_id, now(), @@ -91,7 +90,7 @@ EventWriter::move(const Path& old_path, } void -EventWriter::del(const URI& uri) +EventWriter::del(const Raul::URI& uri) { if (uri == "ingen:engine") { if (_respondee) { @@ -105,8 +104,8 @@ EventWriter::del(const URI& uri) } void -EventWriter::connect(const Path& tail_path, - const Path& head_path) +EventWriter::connect(const Raul::Path& tail_path, + const Raul::Path& head_path) { _engine.enqueue_event( new Events::Connect(_engine, _respondee.get(), _request_id, now(), @@ -115,23 +114,17 @@ EventWriter::connect(const Path& tail_path, } void -EventWriter::disconnect(const Path& src, - const Path& dst) +EventWriter::disconnect(const Raul::Path& src, + const Raul::Path& dst) { - if (!Path::is_path(src) && !Path::is_path(dst)) { - LOG(Raul::error) << "Bad disconnect request " << src - << " => " << dst << std::endl; - return; - } - _engine.enqueue_event( new Events::Disconnect(_engine, _respondee.get(), _request_id, now(), src, dst)); } void -EventWriter::disconnect_all(const Path& patch_path, - const Path& path) +EventWriter::disconnect_all(const Raul::Path& patch_path, + const Raul::Path& path) { _engine.enqueue_event( new Events::DisconnectAll(_engine, _respondee.get(), _request_id, now(), @@ -139,9 +132,9 @@ EventWriter::disconnect_all(const Path& patch_path, } void -EventWriter::set_property(const URI& uri, - const URI& predicate, - const Atom& value) +EventWriter::set_property(const Raul::URI& uri, + const Raul::URI& predicate, + const Raul::Atom& value) { if (uri == "ingen:engine" && predicate == "ingen:enabled" && value.type() == _engine.world()->forge().Bool) { @@ -165,7 +158,7 @@ EventWriter::set_property(const URI& uri, } void -EventWriter::get(const URI& uri) +EventWriter::get(const Raul::URI& uri) { _engine.enqueue_event( new Events::Get(_engine, _respondee.get(), _request_id, now(), uri)); diff --git a/src/server/GraphObjectImpl.cpp b/src/server/GraphObjectImpl.cpp index 8d052540..8310b670 100644 --- a/src/server/GraphObjectImpl.cpp +++ b/src/server/GraphObjectImpl.cpp @@ -22,14 +22,13 @@ #include "ThreadManager.hpp" using namespace std; -using namespace Raul; namespace Ingen { namespace Server { GraphObjectImpl::GraphObjectImpl(Ingen::Shared::URIs& uris, - GraphObjectImpl* parent, - const Symbol& symbol) + GraphObjectImpl* parent, + const Raul::Symbol& symbol) : ResourceImpl(uris, parent ? parent->path().child(symbol) : Raul::Path::root()) , _parent(parent) , _path(parent ? parent->path().child(symbol) : "/") @@ -37,11 +36,11 @@ GraphObjectImpl::GraphObjectImpl(Ingen::Shared::URIs& uris, { } -const Atom& +const Raul::Atom& GraphObjectImpl::get_property(const Raul::URI& key) const { ThreadManager::assert_not_thread(THREAD_PROCESS); - static const Atom null_atom; + static const Raul::Atom null_atom; Resource::Properties::const_iterator i = properties().find(key); return (i != properties().end()) ? i->second : null_atom; } diff --git a/src/server/InternalPlugin.cpp b/src/server/InternalPlugin.cpp index edfc75a2..c7c0e0a8 100644 --- a/src/server/InternalPlugin.cpp +++ b/src/server/InternalPlugin.cpp @@ -26,7 +26,6 @@ #include "InternalPlugin.hpp" using namespace std; -using namespace Raul; namespace Ingen { namespace Server { diff --git a/src/server/JackDriver.cpp b/src/server/JackDriver.cpp index 370a4ce8..6fa1f890 100644 --- a/src/server/JackDriver.cpp +++ b/src/server/JackDriver.cpp @@ -47,10 +47,9 @@ #include "ingen/shared/World.hpp" #include "util.hpp" -#define LOG(s) s << "[JackDriver] " +#define LOG(s) (s("[JackDriver] ")) using namespace std; -using namespace Raul; typedef jack_default_audio_sample_t jack_sample_t; @@ -87,7 +86,8 @@ JackPort::create() 0); if (_jack_port == NULL) { - error << "[JackPort] Failed to register port " << _patch_port->path() << endl; + LOG(Raul::error)(Raul::fmt("Failed to register port %1%\n") + % _patch_port->path()); throw JackDriver::PortRegistrationFailedException(); } } @@ -97,7 +97,7 @@ JackPort::destroy() { assert(_jack_port); if (jack_port_unregister(_driver->jack_client(), _jack_port)) - error << "[JackPort] Unable to unregister port" << endl; + LOG(Raul::error)("Unable to unregister port\n"); _jack_port = NULL; } @@ -136,7 +136,7 @@ JackPort::pre_process(ProcessContext& context) if (!patch_buf->append_event( ev.time, ev.size, _driver->_midi_event_type, ev.buffer)) { - LOG(warn) << "Failed to write MIDI to port buffer, event(s) lost!" << endl; + LOG(Raul::warn)("Failed to write to MIDI buffer, events lost!\n"); } } } @@ -208,8 +208,8 @@ JackDriver::attach(const std::string& server_name, _client = jack_client_open(client_name.c_str(), JackSessionID, NULL, uuid.c_str()); - LOG(info) << "Connected to JACK server as client `" - << client_name.c_str() << "' UUID `" << uuid << "'" << endl; + LOG(Raul::info)(Raul::fmt("Connected to JACK as `%1%' (UUID `%2%')\n") + % client_name.c_str() % uuid); } #endif @@ -218,7 +218,8 @@ JackDriver::attach(const std::string& server_name, if ((_client = jack_client_open(client_name.c_str(), JackServerName, NULL, server_name.c_str()))) { - LOG(info) << "Connected to JACK server `" << server_name << "'" << endl; + LOG(Raul::info)(Raul::fmt("Connected to JACK server `%1%'\n") + % server_name); } } @@ -226,12 +227,12 @@ JackDriver::attach(const std::string& server_name, // Connect to default server if (!_client) { if ((_client = jack_client_open(client_name.c_str(), JackNullOption, NULL))) - LOG(info) << "Connected to default JACK server" << endl; + LOG(Raul::info)("Connected to default JACK server\n"); } // Still failed if (!_client) { - LOG(error) << "Unable to connect to Jack" << endl; + LOG(Raul::error)("Unable to connect to Jack\n"); return false; } } else { @@ -244,7 +245,6 @@ JackDriver::attach(const std::string& server_name, jack_on_shutdown(_client, shutdown_cb, this); jack_set_thread_init_callback(_client, thread_init_cb, this); - jack_set_sample_rate_callback(_client, sample_rate_cb, this); jack_set_buffer_size_callback(_client, block_length_cb, this); #ifdef INGEN_JACK_SESSION jack_set_session_callback(_client, session_cb, this); @@ -262,7 +262,7 @@ JackDriver::activate() Shared::World* world = _engine.world(); if (_is_activated) { - LOG(warn) << "Jack driver already activated" << endl; + LOG(Raul::warn)("Jack driver already activated\n"); return; } @@ -279,10 +279,10 @@ JackDriver::activate() is_realtime()); if (jack_activate(_client)) { - LOG(error) << "Could not activate Jack client, aborting" << endl; + LOG(Raul::error)("Could not activate Jack client, aborting\n"); exit(EXIT_FAILURE); } else { - LOG(info) << "Activated Jack client" << endl; + LOG(Raul::info)("Activated Jack client\n"); } } @@ -305,7 +305,7 @@ JackDriver::deactivate() _jack_threads.clear(); - LOG(info) << "Deactivated Jack client" << endl; + LOG(Raul::info)("Deactivated Jack client\n"); } } @@ -333,7 +333,7 @@ JackDriver::add_port(EnginePort* port) * It is the callers responsibility to delete the returned port. */ Raul::Deletable* -JackDriver::remove_port(const Path& path, EnginePort** port) +JackDriver::remove_port(const Raul::Path& path, EnginePort** port) { ThreadManager::assert_thread(THREAD_PROCESS); @@ -346,12 +346,12 @@ JackDriver::remove_port(const Path& path, EnginePort** port) } } - LOG(warn) << "Unable to find port " << path << endl; + LOG(Raul::warn)(Raul::fmt("Unable to find port %1%\n") % path); return NULL; } EnginePort* -JackDriver::port(const Path& path) +JackDriver::port(const Raul::Path& path) { for (Raul::List::iterator i = _ports.begin(); i != _ports.end(); ++i) if ((*i)->patch_port()->path() == path) @@ -377,7 +377,7 @@ JackDriver::create_port(DuplexPort* patch_port) } EnginePort* -JackDriver::engine_port(const Path& path) +JackDriver::engine_port(const Raul::Path& path) { ThreadManager::assert_thread(THREAD_PROCESS); @@ -428,7 +428,7 @@ JackDriver::_process_cb(jack_nframes_t nframes) void JackDriver::_thread_init_cb() { - Raul::Thread* thread = &Thread::get(); + Raul::Thread* thread = &Raul::Thread::get(); thread->set_name("Jack"); thread->set_context(THREAD_PROCESS); _jack_threads.push_back(SharedPtr(thread)); @@ -437,24 +437,12 @@ JackDriver::_thread_init_cb() void JackDriver::_shutdown_cb() { - LOG(info) << "Jack shutdown. Exiting." << endl; + LOG(Raul::info)("Jack shutdown, exiting\n"); _is_activated = false; _jack_threads.clear(); _client = NULL; } -int -JackDriver::_sample_rate_cb(jack_nframes_t nframes) -{ - if (_is_activated) { - LOG(error) << "On-the-fly sample rate changing not supported (yet). Aborting." << endl; - exit(EXIT_FAILURE); - } else { - _sample_rate = nframes; - } - return 0; -} - int JackDriver::_block_length_cb(jack_nframes_t nframes) { @@ -471,7 +459,7 @@ JackDriver::_block_length_cb(jack_nframes_t nframes) void JackDriver::_session_cb(jack_session_event_t* event) { - LOG(info) << "Jack session save to " << event->session_dir << endl; + LOG(Raul::info)(Raul::fmt("Jack session save to %1%\n") % event->session_dir); const string cmd = (boost::format("ingen -eg -n %1% -u %2% -l ${SESSION_DIR}") % jack_get_client_name(_client) @@ -491,7 +479,7 @@ JackDriver::_session_cb(jack_session_event_t* event) case JackSessionSave: break; case JackSessionSaveAndQuit: - LOG(warn) << "Jack session quit" << endl; + LOG(Raul::warn)("Jack session quit\n"); _engine.quit(); break; case JackSessionSaveTemplate: diff --git a/src/server/JackDriver.hpp b/src/server/JackDriver.hpp index 3bc9c037..a2da2034 100644 --- a/src/server/JackDriver.hpp +++ b/src/server/JackDriver.hpp @@ -135,9 +135,6 @@ private: inline static int block_length_cb(jack_nframes_t nframes, void* const jack_driver) { return ((JackDriver*)jack_driver)->_block_length_cb(nframes); } - inline static int sample_rate_cb(jack_nframes_t nframes, void* const jack_driver) { - return ((JackDriver*)jack_driver)->_sample_rate_cb(nframes); - } #ifdef INGEN_JACK_SESSION inline static void session_cb(jack_session_event_t* event, void* jack_driver) { ((JackDriver*)jack_driver)->_session_cb(event); @@ -149,7 +146,6 @@ private: void _shutdown_cb(); int _process_cb(jack_nframes_t nframes); int _block_length_cb(jack_nframes_t nframes); - int _sample_rate_cb(jack_nframes_t nframes); #ifdef INGEN_JACK_SESSION void _session_cb(jack_session_event_t* event); #endif diff --git a/src/server/LV2Node.cpp b/src/server/LV2Node.cpp index a3d8b104..68a771e8 100644 --- a/src/server/LV2Node.cpp +++ b/src/server/LV2Node.cpp @@ -40,7 +40,6 @@ #include "ProcessContext.hpp" using namespace std; -using namespace Raul; namespace Ingen { namespace Server { @@ -89,7 +88,7 @@ LV2Node::prepare_poly(BufferFactory& bufs, uint32_t poly) lilv_instance_free); if (!_prepared_instances->at(i)) { - error << "Failed to instantiate plugin" << endl; + Raul::error << "Failed to instantiate plugin" << endl; return false; } @@ -164,8 +163,8 @@ LV2Node::instantiate(BufferFactory& bufs) lilv_instance_free); if (!instance(i)) { - error << "Failed to instantiate plugin " << _lv2_plugin->uri() - << " voice " << i << endl; + Raul::error << "Failed to instantiate plugin " << _lv2_plugin->uri() + << " voice " << i << endl; return false; } @@ -178,8 +177,8 @@ LV2Node::instantiate(BufferFactory& bufs) lilv_node_free(work_schedule); - string port_name; - Path port_path; + string port_name; + Raul::Path port_path; PortImpl* port = NULL; bool ret = true; @@ -213,9 +212,9 @@ LV2Node::instantiate(BufferFactory& bufs) // LV2 port symbols are guaranteed to be unique, valid C identifiers port_name = lilv_node_as_string(lilv_port_get_symbol(plug, id)); - if (!Symbol::is_valid(port_name)) { - error << "Plugin " << _lv2_plugin->uri() << " port " << j - << " has illegal symbol `" << port_name << "'" << endl; + if (!Raul::Symbol::is_valid(port_name)) { + Raul::error << "Plugin " << _lv2_plugin->uri() << " port " << j + << " has illegal symbol `" << port_name << "'" << endl; ret = false; break; } @@ -288,7 +287,7 @@ LV2Node::instantiate(BufferFactory& bufs) } if (port_type == PortType::UNKNOWN || direction == UNKNOWN) { - warn << "Unknown type or direction for port `" << port_name << "'" << endl; + Raul::warn << "Unknown type or direction for port `" << port_name << "'" << endl; ret = false; break; } diff --git a/src/server/LV2Plugin.cpp b/src/server/LV2Plugin.cpp index 0989f881..93e2d1d6 100644 --- a/src/server/LV2Plugin.cpp +++ b/src/server/LV2Plugin.cpp @@ -29,7 +29,6 @@ #include "NodeImpl.hpp" using namespace std; -using namespace Raul; namespace Ingen { namespace Server { @@ -54,7 +53,7 @@ LV2Plugin::symbol() const const string symbol = working.substr(last_slash+1); if ( (symbol[0] >= 'a' && symbol[0] <= 'z') || (symbol[0] >= 'A' && symbol[0] <= 'Z') ) - return Path::nameify(symbol); + return Raul::Path::nameify(symbol); else working = working.substr(0, last_slash); } diff --git a/src/server/MessageContext.cpp b/src/server/MessageContext.cpp index ed2c8543..d59452d7 100644 --- a/src/server/MessageContext.cpp +++ b/src/server/MessageContext.cpp @@ -27,7 +27,6 @@ #include "ThreadManager.hpp" using namespace std; -using namespace Raul; namespace Ingen { namespace Server { diff --git a/src/server/NodeFactory.cpp b/src/server/NodeFactory.cpp index ea8132d1..231a7db1 100644 --- a/src/server/NodeFactory.cpp +++ b/src/server/NodeFactory.cpp @@ -41,7 +41,6 @@ #include "ThreadManager.hpp" using namespace std; -using namespace Raul; namespace Ingen { namespace Server { diff --git a/src/server/ObjectSender.cpp b/src/server/ObjectSender.cpp index 9565bd82..167ffb1f 100644 --- a/src/server/ObjectSender.cpp +++ b/src/server/ObjectSender.cpp @@ -27,7 +27,6 @@ #include "AudioBuffer.hpp" using namespace std; -using namespace Raul; namespace Ingen { namespace Server { @@ -75,8 +74,8 @@ ObjectSender::send_patch(Interface* client, if (recursive) { // Send nodes - for (List::const_iterator j = patch->nodes().begin(); - j != patch->nodes().end(); ++j) { + for (Raul::List::const_iterator j = patch->nodes().begin(); + j != patch->nodes().end(); ++j) { const NodeImpl* const node = (*j); send_node(client, node, true, false); } @@ -109,7 +108,7 @@ ObjectSender::send_node(Interface* client, const NodeImpl* node, bool recursive, } if (plugin->uri().length() == 0) { - error << "Node " << node->path() << "'s plugin has no URI! Not sending." << endl; + Raul::error << "Node " << node->path() << "'s plugin has no URI! Not sending." << endl; return; } diff --git a/src/server/PatchImpl.cpp b/src/server/PatchImpl.cpp index 912ce9c2..b17d0475 100644 --- a/src/server/PatchImpl.cpp +++ b/src/server/PatchImpl.cpp @@ -34,7 +34,6 @@ #include "ThreadManager.hpp" using namespace std; -using namespace Raul; namespace Ingen { namespace Server { @@ -315,7 +314,7 @@ PatchImpl::remove_connection(const PortImpl* tail, const PortImpl* dst_port) _connections.erase(i); return c; } else { - error << "[PatchImpl::remove_connection] Connection not found" << endl; + Raul::error << "[PatchImpl::remove_connection] Connection not found" << endl; return SharedPtr(); } } @@ -349,7 +348,7 @@ PatchImpl::create_port(BufferFactory& bufs, bool polyphonic) { if (type == PortType::UNKNOWN) { - error << "[PatchImpl::create_port] Unknown port type " << type.uri() << endl; + Raul::error << "[PatchImpl::create_port] Unknown port type " << type.uri() << endl; return NULL; } @@ -393,7 +392,7 @@ PatchImpl::remove_port(const string& symbol) } if ( ! found) - error << "[PatchImpl::remove_port] Port not found!" << endl; + Raul::error << "[PatchImpl::remove_port] Port not found!" << endl; return ret; } diff --git a/src/server/PluginImpl.cpp b/src/server/PluginImpl.cpp index b8ba9c2b..cec70c06 100644 --- a/src/server/PluginImpl.cpp +++ b/src/server/PluginImpl.cpp @@ -18,7 +18,6 @@ #include "PluginImpl.hpp" using namespace std; -using namespace Raul; namespace Ingen { namespace Server { @@ -27,7 +26,7 @@ void PluginImpl::load() { if (!_module) { - debug << "Loading plugin library " << _library_path << endl; + Raul::debug << "Loading plugin library " << _library_path << endl; _module = new Glib::Module(_library_path, Glib::MODULE_BIND_LOCAL); if (!(*_module)) delete _module; @@ -38,7 +37,7 @@ void PluginImpl::unload() { if (_module) { - debug << "Unloading plugin library " << _library_path << endl; + Raul::debug << "Unloading plugin library " << _library_path << endl; delete _module; _module = NULL; } diff --git a/src/server/PortImpl.cpp b/src/server/PortImpl.cpp index a775ab91..1e5cc11c 100644 --- a/src/server/PortImpl.cpp +++ b/src/server/PortImpl.cpp @@ -29,7 +29,6 @@ #include "ThreadManager.hpp" using namespace std; -using namespace Raul; namespace Ingen { namespace Server { @@ -41,7 +40,7 @@ PortImpl::PortImpl(BufferFactory& bufs, uint32_t poly, PortType type, LV2_URID buffer_type, - const Atom& value, + const Raul::Atom& value, size_t buffer_size) : GraphObjectImpl(bufs.uris(), node, name) , _bufs(bufs) @@ -54,7 +53,7 @@ PortImpl::PortImpl(BufferFactory& bufs, , _min(bufs.forge().make(0.0f)) , _max(bufs.forge().make(1.0f)) , _last_broadcasted_value(value) - , _buffers(new Array(static_cast(poly))) + , _buffers(new Raul::Array(static_cast(poly))) , _prepared_buffers(NULL) , _broadcast(false) , _set_by_user(false) @@ -134,7 +133,7 @@ PortImpl::prepare_poly(BufferFactory& bufs, uint32_t poly) } if (!_prepared_buffers) - _prepared_buffers = new Array(poly, *_buffers, NULL); + _prepared_buffers = new Raul::Array(poly, *_buffers, NULL); return true; } @@ -147,7 +146,7 @@ PortImpl::prepare_poly_buffers(BufferFactory& bufs) } bool -PortImpl::apply_poly(Maid& maid, uint32_t poly) +PortImpl::apply_poly(Raul::Maid& maid, uint32_t poly) { ThreadManager::assert_thread(THREAD_PROCESS); if (_type != PortType::CONTROL && diff --git a/src/server/PostProcessor.cpp b/src/server/PostProcessor.cpp index 2ad23254..7a51f5e9 100644 --- a/src/server/PostProcessor.cpp +++ b/src/server/PostProcessor.cpp @@ -27,7 +27,6 @@ #include "ThreadManager.hpp" using namespace std; -using namespace Raul; namespace Ingen { namespace Server { diff --git a/src/server/events/Connect.cpp b/src/server/events/Connect.cpp index 6ad8d4f6..1fe88c22 100644 --- a/src/server/events/Connect.cpp +++ b/src/server/events/Connect.cpp @@ -35,19 +35,16 @@ #include "ProcessContext.hpp" #include "types.hpp" -using namespace std; -using namespace Raul; - namespace Ingen { namespace Server { namespace Events { -Connect::Connect(Engine& engine, - Interface* client, - int32_t id, - SampleCount timestamp, - const Path& tail_path, - const Path& head_path) +Connect::Connect(Engine& engine, + Interface* client, + int32_t id, + SampleCount timestamp, + const Raul::Path& tail_path, + const Raul::Path& head_path) : Event(engine, client, id, timestamp) , _tail_path(tail_path) , _head_path(head_path) diff --git a/src/server/events/CreateNode.cpp b/src/server/events/CreateNode.cpp index 231cf2e2..9a9df50e 100644 --- a/src/server/events/CreateNode.cpp +++ b/src/server/events/CreateNode.cpp @@ -32,9 +32,6 @@ #include "PortImpl.hpp" #include "Driver.hpp" -using namespace std; -using namespace Raul; - namespace Ingen { namespace Server { namespace Events { @@ -43,8 +40,8 @@ CreateNode::CreateNode(Engine& engine, Interface* client, int32_t id, SampleCount timestamp, - const Path& path, - const URI& plugin_uri, + const Raul::Path& path, + const Raul::URI& plugin_uri, const Resource::Properties& properties) : Event(engine, client, id, timestamp) , _path(path) diff --git a/src/server/events/CreatePatch.cpp b/src/server/events/CreatePatch.cpp index ed31130b..d23c4506 100644 --- a/src/server/events/CreatePatch.cpp +++ b/src/server/events/CreatePatch.cpp @@ -27,9 +27,6 @@ #include "Driver.hpp" #include "EngineStore.hpp" -using namespace std; -using namespace Raul; - namespace Ingen { namespace Server { namespace Events { @@ -66,7 +63,7 @@ CreatePatch::pre_process() return; } - const Path& path = (const Path&)_path; + const Raul::Path& path = (const Raul::Path&)_path; _parent = _engine.engine_store()->find_patch(path.parent()); if (_parent == NULL) { diff --git a/src/server/events/CreatePort.cpp b/src/server/events/CreatePort.cpp index d2377a36..448f7768 100644 --- a/src/server/events/CreatePort.cpp +++ b/src/server/events/CreatePort.cpp @@ -33,9 +33,6 @@ #include "PluginImpl.hpp" #include "PortImpl.hpp" -using namespace std; -using namespace Raul; - namespace Ingen { namespace Server { namespace Events { @@ -113,8 +110,8 @@ CreatePort::pre_process() Resource::Properties::const_iterator index_i = _properties.find(uris.lv2_index); if (index_i == _properties.end()) { index_i = _properties.insert( - make_pair(uris.lv2_index, - _engine.world()->forge().make(int32_t(old_num_ports)))); + std::make_pair(uris.lv2_index, + _engine.world()->forge().make(int32_t(old_num_ports)))); } else if (index_i->second.type() != uris.forge.Int || index_i->second.get_int32() != static_cast(old_num_ports)) { Event::pre_process(); diff --git a/src/server/events/Delete.cpp b/src/server/events/Delete.cpp index a91702cc..c7e658bc 100644 --- a/src/server/events/Delete.cpp +++ b/src/server/events/Delete.cpp @@ -30,8 +30,6 @@ #include "PluginImpl.hpp" #include "PortImpl.hpp" -using namespace std; - namespace Ingen { namespace Server { namespace Events { diff --git a/src/server/events/Disconnect.cpp b/src/server/events/Disconnect.cpp index b6432d0b..e7ed572f 100644 --- a/src/server/events/Disconnect.cpp +++ b/src/server/events/Disconnect.cpp @@ -34,9 +34,6 @@ #include "ThreadManager.hpp" #include "events/Disconnect.hpp" -using namespace std; -using namespace Raul; - namespace Ingen { namespace Server { namespace Events { diff --git a/src/server/events/DisconnectAll.cpp b/src/server/events/DisconnectAll.cpp index 123b218b..f869c5d3 100644 --- a/src/server/events/DisconnectAll.cpp +++ b/src/server/events/DisconnectAll.cpp @@ -36,19 +36,16 @@ #include "events/DisconnectAll.hpp" #include "util.hpp" -using namespace std; -using namespace Raul; - namespace Ingen { namespace Server { namespace Events { -DisconnectAll::DisconnectAll(Engine& engine, - Interface* client, - int32_t id, - SampleCount timestamp, - const Path& parent_path, - const Path& node_path) +DisconnectAll::DisconnectAll(Engine& engine, + Interface* client, + int32_t id, + SampleCount timestamp, + const Raul::Path& parent_path, + const Raul::Path& node_path) : Event(engine, client, id, timestamp) , _parent_path(parent_path) , _path(node_path) diff --git a/src/server/events/Get.cpp b/src/server/events/Get.cpp index 1e5e8cd7..0f1a16d7 100644 --- a/src/server/events/Get.cpp +++ b/src/server/events/Get.cpp @@ -24,17 +24,15 @@ #include "ObjectSender.hpp" #include "PluginImpl.hpp" -using namespace Raul; - namespace Ingen { namespace Server { namespace Events { -Get::Get(Engine& engine, - Interface* client, - int32_t id, - SampleCount timestamp, - const URI& uri) +Get::Get(Engine& engine, + Interface* client, + int32_t id, + SampleCount timestamp, + const Raul::URI& uri) : Event(engine, client, id, timestamp) , _uri(uri) , _object(NULL) @@ -50,8 +48,8 @@ Get::pre_process() if (_uri == "ingen:plugins") { _plugins = _engine.node_factory()->plugins(); - } else if (Path::is_valid(_uri.str())) { - _object = _engine.engine_store()->find_object(Path(_uri.str())); + } else if (Raul::Path::is_valid(_uri.str())) { + _object = _engine.engine_store()->find_object(Raul::Path(_uri.str())); } else { _plugin = _engine.node_factory()->plugin(_uri); } diff --git a/src/server/events/Move.cpp b/src/server/events/Move.cpp index 0969eea2..a7273d81 100644 --- a/src/server/events/Move.cpp +++ b/src/server/events/Move.cpp @@ -27,19 +27,16 @@ #include "PatchImpl.hpp" #include "events/Move.hpp" -using namespace std; -using namespace Raul; - namespace Ingen { namespace Server { namespace Events { -Move::Move(Engine& engine, - Interface* client, - int32_t id, - SampleCount timestamp, - const Path& path, - const Path& new_path) +Move::Move(Engine& engine, + Interface* client, + int32_t id, + SampleCount timestamp, + const Raul::Path& path, + const Raul::Path& new_path) : Event(engine, client, id, timestamp) , _old_path(path) , _new_path(new_path) @@ -75,20 +72,20 @@ Move::pre_process() return; } - SharedPtr< Table > > removed + SharedPtr< Raul::Table< Raul::Path, SharedPtr > > removed = _engine.engine_store()->remove(_store_iterator); assert(removed->size() > 0); - for (Table >::iterator i = removed->begin(); i != removed->end(); ++i) { - const Path& child_old_path = i->first; - assert(Path::descendant_comparator(_old_path, child_old_path)); + for (Raul::Table< Raul::Path, SharedPtr >::iterator i = removed->begin(); i != removed->end(); ++i) { + const Raul::Path& child_old_path = i->first; + assert(Raul::Path::descendant_comparator(_old_path, child_old_path)); - Path child_new_path; + Raul::Path child_new_path; if (child_old_path == _old_path) child_new_path = _new_path; else - child_new_path = Path(_new_path).base() + child_old_path.substr(_old_path.length()+1); + child_new_path = Raul::Path(_new_path).base() + child_old_path.substr(_old_path.length()+1); PtrCast(i->second)->set_path(child_new_path); i->first = child_new_path; diff --git a/src/server/events/SetMetadata.cpp b/src/server/events/SetMetadata.cpp index 42392a8a..38e7490c 100644 --- a/src/server/events/SetMetadata.cpp +++ b/src/server/events/SetMetadata.cpp @@ -42,9 +42,6 @@ #define LOG(s) s << "[SetMetadata] " -using namespace std; -using namespace Raul; - namespace Ingen { namespace Server { namespace Events { @@ -57,7 +54,7 @@ SetMetadata::SetMetadata(Engine& engine, SampleCount timestamp, bool create, Resource::Graph context, - const URI& subject, + const Raul::URI& subject, const Properties& properties, const Properties& remove) : Event(engine, client, id, timestamp) @@ -107,12 +104,12 @@ SetMetadata::pre_process() { typedef Properties::const_iterator iterator; - const bool is_graph_object = Path::is_path(_subject); + const bool is_graph_object = Raul::Path::is_path(_subject); _lock.acquire(); _object = is_graph_object - ? _engine.engine_store()->find_object(Path(_subject.str())) + ? _engine.engine_store()->find_object(Raul::Path(_subject.str())) : static_cast(_engine.node_factory()->plugin(_subject)); if (!_object && (!is_graph_object || !_create)) { @@ -124,7 +121,7 @@ SetMetadata::pre_process() const Ingen::Shared::URIs& uris = *_engine.world()->uris().get(); if (is_graph_object && !_object) { - Path path(_subject.str()); + Raul::Path path(_subject.str()); bool is_patch = false, is_node = false, is_port = false, is_output = false; Shared::ResourceImpl::type(uris, _properties, is_patch, is_node, is_port, is_output); @@ -146,7 +143,7 @@ SetMetadata::pre_process() if (_create_event) { _create_event->pre_process(); // Grab the object for applying properties, if the create-event succeeded - _object = _engine.engine_store()->find_object(Path(_subject.str())); + _object = _engine.engine_store()->find_object(Raul::Path(_subject.str())); } else { _status = BAD_OBJECT_TYPE; } diff --git a/src/server/events/SetPortValue.cpp b/src/server/events/SetPortValue.cpp index 2c21fdbb..6305ff1e 100644 --- a/src/server/events/SetPortValue.cpp +++ b/src/server/events/SetPortValue.cpp @@ -33,9 +33,6 @@ #include "ProcessContext.hpp" #include "SetPortValue.hpp" -using namespace std; -using namespace Raul; - namespace Ingen { namespace Server { namespace Events { @@ -145,7 +142,7 @@ SetPortValue::apply(Context& context) return; } - warn << "Unknown value type " << (int)_value.type() << endl; + Raul::warn(Raul::fmt("Unknown value type %1%\n") % _value.type()); } } diff --git a/src/server/internals/Delay.cpp b/src/server/internals/Delay.cpp index 0386b2d2..315ba4e4 100644 --- a/src/server/internals/Delay.cpp +++ b/src/server/internals/Delay.cpp @@ -39,7 +39,6 @@ (f_clamp (delaytime * (float)sample_rate, 1.0f, (float)(buffer_mask + 1))) using namespace std; -using namespace Raul; namespace Ingen { namespace Server { diff --git a/src/server/internals/Note.cpp b/src/server/internals/Note.cpp index 3733a274..f488f898 100644 --- a/src/server/internals/Note.cpp +++ b/src/server/internals/Note.cpp @@ -37,7 +37,6 @@ #define LOG(s) s << "[NoteNode] " using namespace std; -using namespace Raul; namespace Ingen { namespace Server { diff --git a/src/server/internals/Trigger.cpp b/src/server/internals/Trigger.cpp index 3de1ffc6..2224e39f 100644 --- a/src/server/internals/Trigger.cpp +++ b/src/server/internals/Trigger.cpp @@ -33,7 +33,6 @@ #define LOG(s) s << "[TriggerNode] " using namespace std; -using namespace Raul; namespace Ingen { namespace Server { -- cgit v1.2.1