summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/client/ClientStore.cpp45
-rw-r--r--src/client/NodeModel.cpp27
-rw-r--r--src/client/PatchModel.cpp6
-rw-r--r--src/client/PluginModel.cpp28
-rw-r--r--src/client/PluginUI.cpp15
-rw-r--r--src/server/ConnectionImpl.cpp49
-rw-r--r--src/server/ConnectionImpl.hpp4
-rw-r--r--src/server/EventSource.hpp2
-rw-r--r--src/server/LV2ResizeFeature.hpp6
-rw-r--r--src/server/ObjectSender.cpp5
10 files changed, 109 insertions, 78 deletions
diff --git a/src/client/ClientStore.cpp b/src/client/ClientStore.cpp
index d56c781d..7f2a534f 100644
--- a/src/client/ClientStore.cpp
+++ b/src/client/ClientStore.cpp
@@ -226,7 +226,8 @@ ClientStore::del(const URI& uri)
const Raul::Path path(uri.str());
SharedPtr<ObjectModel> removed = remove_object(path);
removed.reset();
- LOG(debug) << "Removed object " << path << ", count: " << removed.use_count();
+ LOG(debug) << "Removed object " << path
+ << ", count: " << removed.use_count();
}
void
@@ -237,7 +238,8 @@ ClientStore::move(const Path& old_path_str, const Path& new_path_str)
iterator parent = find(old_path);
if (parent == end()) {
- LOG(Raul::error) << "Failed to find object " << old_path << " to move." << endl;
+ LOG(Raul::error) << "Failed to find object " << old_path
+ << " to move." << endl;
return;
}
@@ -257,9 +259,11 @@ ClientStore::move(const Path& old_path_str, const Path& new_path_str)
if (child_old_path == old_path)
child_new_path = new_path;
else
- child_new_path = new_path.base() + child_old_path.substr(old_path.length()+1);
+ child_new_path = new_path.base()
+ + child_old_path.substr(old_path.length() + 1);
- LOG(info) << "Renamed " << child_old_path << " -> " << child_new_path << endl;
+ LOG(info) << "Renamed " << child_old_path
+ << " -> " << child_new_path << endl;
PtrCast<ObjectModel>(i->second)->set_path(child_new_path);
i->first = child_new_path;
}
@@ -294,7 +298,8 @@ ClientStore::put(const URI& uri,
if (plugin_type == Plugin::Patch) {
is_patch = true;
} else if (plugin_type != Plugin::NIL) {
- SharedPtr<PluginModel> p(new PluginModel(uris(), uri, type_uri, properties));
+ SharedPtr<PluginModel> p(
+ new PluginModel(uris(), uri, type_uri, properties));
add_plugin(p);
return;
}
@@ -326,7 +331,8 @@ ClientStore::put(const URI& uri,
SharedPtr<PluginModel> plug;
if (p->second.is_valid() && p->second.type() == _uris->forge.URI) {
if (!(plug = _plugin(p->second.get_uri()))) {
- LOG(warn) << "Unable to find plugin " << p->second.get_uri() << endl;
+ LOG(warn) << "Unable to find plugin "
+ << p->second.get_uri() << endl;
plug = SharedPtr<PluginModel>(
new PluginModel(uris(),
p->second.get_uri(),
@@ -342,7 +348,9 @@ ClientStore::put(const URI& uri,
LOG(warn) << "Node " << path << " has no plugin" << endl;
}
} else if (is_port) {
- PortModel::Direction pdir = is_output ? PortModel::OUTPUT : PortModel::INPUT;
+ PortModel::Direction pdir = (is_output)
+ ? PortModel::OUTPUT
+ : PortModel::INPUT;
const Iterator i = properties.find(_uris->lv2_index);
if (i != properties.end() && i->second.type() == _uris->forge.Int) {
const uint32_t index = i->second.get_int32();
@@ -368,10 +376,12 @@ ClientStore::delta(const URI& uri,
#ifdef INGEN_CLIENT_STORE_DUMP
LOG(info) << "DELTA " << uri << " {" << endl;
for (iterator i = remove.begin(); i != remove.end(); ++i)
- LOG(info) << " - " << i->first << " = " << _uris->forge.str(i->second)
+ LOG(info) << " - " << i->first
+ << " = " << _uris->forge.str(i->second)
<< " :: " << i->second.type() << endl;
for (iterator i = add.begin(); i != add.end(); ++i)
- LOG(info) << " + " << i->first << " = " << _uris->forge.str(i->second)
+ LOG(info) << " + " << i->first
+ << " = " << _uris->forge.str(i->second)
<< " :: " << i->second.type() << endl;
LOG(info) << "}" << endl;
#endif
@@ -393,7 +403,9 @@ ClientStore::delta(const URI& uri,
}
void
-ClientStore::set_property(const URI& subject_uri, const URI& predicate, const Atom& value)
+ClientStore::set_property(const URI& subject_uri,
+ const URI& predicate,
+ const Atom& value)
{
if (subject_uri == _uris->ingen_engine) {
LOG(info) << "Engine property " << predicate
@@ -445,8 +457,8 @@ ClientStore::attempt_connection(const Path& tail_path,
SharedPtr<PortModel> head = PtrCast<PortModel>(_object(head_path));
if (tail && head) {
- SharedPtr<PatchModel> patch = connection_patch(tail_path, head_path);
- SharedPtr<EdgeModel> cm(new EdgeModel(tail, head));
+ SharedPtr<PatchModel> patch = connection_patch(tail_path, head_path);
+ SharedPtr<EdgeModel> cm(new EdgeModel(tail, head));
tail->connected_to(head);
head->connected_to(tail);
@@ -470,7 +482,8 @@ ClientStore::disconnect(const Path& src,
const Path& dst)
{
if (!Path::is_path(src) && !Path::is_path(dst)) {
- std::cerr << "Bad disconnect notification " << src << " => " << dst << std::endl;
+ std::cerr << "Bad disconnect notification " << src
+ << " => " << dst << std::endl;
return;
}
@@ -492,15 +505,15 @@ ClientStore::disconnect(const Path& src,
}
void
-ClientStore::disconnect_all(const Raul::Path& parent_patch_path,
+ClientStore::disconnect_all(const Raul::Path& parent_patch,
const Raul::Path& path)
{
- SharedPtr<PatchModel> patch = PtrCast<PatchModel>(_object(parent_patch_path));
+ SharedPtr<PatchModel> patch = PtrCast<PatchModel>(_object(parent_patch));
SharedPtr<ObjectModel> object = _object(path);
if (!patch || !object) {
std::cerr << "Bad disconnect all notification " << path
- << " in " << parent_patch_path << std::endl;
+ << " in " << parent_patch << std::endl;
return;
}
diff --git a/src/client/NodeModel.cpp b/src/client/NodeModel.cpp
index d1d1108d..cab4dafa 100644
--- a/src/client/NodeModel.cpp
+++ b/src/client/NodeModel.cpp
@@ -160,12 +160,15 @@ Ingen::Port*
NodeModel::port(uint32_t index) const
{
assert(index < num_ports());
- return const_cast<Ingen::Port*>(dynamic_cast<const Ingen::Port*>(_ports[index].get()));
+ return const_cast<Ingen::Port*>(
+ dynamic_cast<const Ingen::Port*>(_ports[index].get()));
}
void
NodeModel::default_port_value_range(SharedPtr<const PortModel> port,
- float& min, float& max, uint32_t srate) const
+ float& min,
+ float& max,
+ uint32_t srate) const
{
// Default control values
min = 0.0;
@@ -227,18 +230,18 @@ NodeModel::port_label(SharedPtr<const PortModel> port) const
}
if (_plugin && _plugin->type() == PluginModel::LV2) {
- LilvWorld* c_world = _plugin->lilv_world();
- const LilvPlugin* c_plugin = _plugin->lilv_plugin();
- LilvNode* c_sym = lilv_new_string(c_world, port->symbol().c_str());
- const LilvPort* c_port = lilv_plugin_get_port_by_symbol(c_plugin, c_sym);
- if (c_port) {
- LilvNode* c_name = lilv_port_get_name(c_plugin, c_port);
- if (c_name && lilv_node_is_string(c_name)) {
- std::string ret(lilv_node_as_string(c_name));
- lilv_node_free(c_name);
+ LilvWorld* w = _plugin->lilv_world();
+ const LilvPlugin* plug = _plugin->lilv_plugin();
+ LilvNode* sym = lilv_new_string(w, port->symbol().c_str());
+ const LilvPort* lport = lilv_plugin_get_port_by_symbol(plug, sym);
+ if (lport) {
+ LilvNode* lname = lilv_port_get_name(plug, lport);
+ if (lname && lilv_node_is_string(lname)) {
+ std::string ret(lilv_node_as_string(lname));
+ lilv_node_free(lname);
return ret;
}
- lilv_node_free(c_name);
+ lilv_node_free(lname);
}
}
diff --git a/src/client/PatchModel.cpp b/src/client/PatchModel.cpp
index ec949429..2513ca70 100644
--- a/src/client/PatchModel.cpp
+++ b/src/client/PatchModel.cpp
@@ -55,7 +55,8 @@ PatchModel::remove_child(SharedPtr<ObjectModel> o)
// Remove any connections which referred to this object,
// since they can't possibly exist anymore
- for (Connections::iterator j = _connections->begin(); j != _connections->end(); ) {
+ for (Connections::iterator j = _connections->begin();
+ j != _connections->end();) {
Connections::iterator next = j;
++next;
@@ -133,7 +134,8 @@ PatchModel::add_connection(SharedPtr<EdgeModel> cm)
assert(cm->tail() == existing->tail());
assert(cm->head() == existing->head());
} else {
- _connections->insert(make_pair(make_pair(cm->tail().get(), cm->head().get()), cm));
+ _connections->insert(make_pair(make_pair(cm->tail().get(),
+ cm->head().get()), cm));
_signal_new_connection.emit(cm);
}
}
diff --git a/src/client/PluginModel.cpp b/src/client/PluginModel.cpp
index 6a5912a8..9c5bd2bb 100644
--- a/src/client/PluginModel.cpp
+++ b/src/client/PluginModel.cpp
@@ -92,7 +92,8 @@ PluginModel::get_property(const URI& key) const
if (isalpha(uri.str()[last_delim + 1]))
symbol = uri.str().substr(last_delim + 1);
else
- symbol = uri.str().substr(first_delim + 1, last_delim - first_delim - 1);
+ symbol = uri.str().substr(first_delim + 1,
+ last_delim - first_delim - 1);
}
set_property(LV2_CORE__symbol, _uris.forge.alloc(symbol));
return get_property(key);
@@ -106,19 +107,20 @@ PluginModel::get_property(const URI& key) const
LILV_FOREACH(nodes, i, values) {
const LilvNode* val = lilv_nodes_get(values, i);
if (lilv_node_is_uri(val)) {
- ret = set_property(key, _uris.forge.alloc_uri(lilv_node_as_uri(val)));
+ ret = set_property(
+ key, _uris.forge.alloc_uri(lilv_node_as_uri(val)));
break;
} else if (lilv_node_is_string(val)) {
- ret = set_property(key,
- _uris.forge.alloc(lilv_node_as_string(val)));
+ ret = set_property(
+ key, _uris.forge.alloc(lilv_node_as_string(val)));
break;
} else if (lilv_node_is_float(val)) {
- ret = set_property(key,
- _uris.forge.make(lilv_node_as_float(val)));
+ ret = set_property(
+ key, _uris.forge.make(lilv_node_as_float(val)));
break;
} else if (lilv_node_is_int(val)) {
- ret = set_property(key,
- _uris.forge.make(lilv_node_as_int(val)));
+ ret = set_property(
+ key, _uris.forge.make(lilv_node_as_int(val)));
break;
}
}
@@ -140,7 +142,9 @@ PluginModel::set(SharedPtr<PluginModel> p)
if (p->_lilv_plugin)
_lilv_plugin = p->_lilv_plugin;
- for (Properties::const_iterator v = p->properties().begin(); v != p->properties().end(); ++v) {
+ for (Properties::const_iterator v = p->properties().begin();
+ v != p->properties().end();
+ ++v) {
ResourceImpl::set_property(v->first, v->second);
_signal_property.emit(v->first, v->second);
}
@@ -169,11 +173,11 @@ PluginModel::human_name() const
}
string
-PluginModel::port_human_name(uint32_t index) const
+PluginModel::port_human_name(uint32_t i) const
{
if (_lilv_plugin) {
- const LilvPort* port = lilv_plugin_get_port_by_index(_lilv_plugin, index);
- LilvNode* name = lilv_port_get_name(_lilv_plugin, port);
+ const LilvPort* port = lilv_plugin_get_port_by_index(_lilv_plugin, i);
+ LilvNode* name = lilv_port_get_name(_lilv_plugin, port);
const string ret(lilv_node_as_string(name));
lilv_node_free(name);
return ret;
diff --git a/src/client/PluginUI.cpp b/src/client/PluginUI.cpp
index a58bdabe..dee00fea 100644
--- a/src/client/PluginUI.cpp
+++ b/src/client/PluginUI.cpp
@@ -67,7 +67,9 @@ lv2_ui_write(SuilController controller,
LV2_Atom* atom = (LV2_Atom*)buffer;
Raul::Atom val = ui->world()->forge().alloc(
atom->size, atom->type, LV2_ATOM_BODY(atom));
- ui->world()->engine()->set_property(port->path(), uris.ingen_value, val);
+ ui->world()->engine()->set_property(port->path(),
+ uris.ingen_value,
+ val);
} else {
warn << "Unknown value format " << format
@@ -170,13 +172,14 @@ PluginUI::port_event(uint32_t port_index,
bool
PluginUI::is_resizable() const
{
+ LilvWorld* w = _world->lilv_world();
const LilvNode* s = _ui_node;
- LilvNode* p = lilv_new_uri(_world->lilv_world(), LV2_CORE__optionalFeature);
- LilvNode* fs = lilv_new_uri(_world->lilv_world(), LV2_UI__fixedSize);
- LilvNode* nrs = lilv_new_uri(_world->lilv_world(), LV2_UI__noUserResize);
+ LilvNode* p = lilv_new_uri(w, LV2_CORE__optionalFeature);
+ LilvNode* fs = lilv_new_uri(w, LV2_UI__fixedSize);
+ LilvNode* nrs = lilv_new_uri(w, LV2_UI__noUserResize);
- LilvNodes* fs_matches = lilv_world_find_nodes(_world->lilv_world(), s, p, fs);
- LilvNodes* nrs_matches = lilv_world_find_nodes(_world->lilv_world(), s, p, nrs);
+ LilvNodes* fs_matches = lilv_world_find_nodes(w, s, p, fs);
+ LilvNodes* nrs_matches = lilv_world_find_nodes(w, s, p, nrs);
lilv_nodes_free(nrs_matches);
lilv_nodes_free(fs_matches);
diff --git a/src/server/ConnectionImpl.cpp b/src/server/ConnectionImpl.cpp
index d233ab5d..1fde56b4 100644
--- a/src/server/ConnectionImpl.cpp
+++ b/src/server/ConnectionImpl.cpp
@@ -81,14 +81,17 @@ ConnectionImpl::head_path() const
}
void
-ConnectionImpl::get_sources(Context& context, uint32_t voice,
- boost::intrusive_ptr<Buffer>* srcs, uint32_t max_num_srcs, uint32_t& num_srcs)
+ConnectionImpl::get_sources(Context& context,
+ uint32_t voice,
+ boost::intrusive_ptr<Buffer>* srcs,
+ uint32_t max_num_srcs,
+ uint32_t& num_srcs)
{
if (must_queue() && _queue->read_space() > 0) {
LV2_Atom obj;
_queue->peek(sizeof(LV2_Atom), &obj);
- boost::intrusive_ptr<Buffer> buf = context.engine().buffer_factory()->get(
- head()->buffer_type(), sizeof(LV2_Atom) + obj.size);
+ BufferRef buf = context.engine().buffer_factory()->get(
+ head()->buffer_type(), sizeof(LV2_Atom) + obj.size);
void* data = buf->port_data(PortType::ATOM, context.offset());
_queue->read(sizeof(LV2_Atom) + obj.size, (LV2_Atom*)data);
srcs[num_srcs++] = buf;
@@ -116,7 +119,7 @@ ConnectionImpl::queue(Context& context)
boost::intrusive_ptr<Buffer> src_buf = _tail->buffer(0);
if (src_buf->atom()->type != uris.atom_Sequence) {
- Raul::error << "Queued connection but source is not a Sequence" << std::endl;
+ Raul::error << "Queued edge source is not a Sequence" << std::endl;
return;
}
@@ -160,29 +163,29 @@ ConnectionImpl::can_connect(const OutputPort* src, const InputPort* dst)
{
const Ingen::Shared::URIs& uris = src->bufs().uris();
return (
- // (Audio | Control | CV) => (Audio | Control | CV)
- ( (src->is_a(PortType::CONTROL) ||
- src->is_a(PortType::AUDIO) ||
- src->is_a(PortType::CV))
- && (dst->is_a(PortType::CONTROL)
- || dst->is_a(PortType::AUDIO)
- || dst->is_a(PortType::CV)))
+ // (Audio | Control | CV) => (Audio | Control | CV)
+ ( (src->is_a(PortType::CONTROL) ||
+ src->is_a(PortType::AUDIO) ||
+ src->is_a(PortType::CV))
+ && (dst->is_a(PortType::CONTROL)
+ || dst->is_a(PortType::AUDIO)
+ || dst->is_a(PortType::CV)))
- // Equal types
- || (src->type() == dst->type() &&
- src->buffer_type() == dst->buffer_type())
+ // Equal types
+ || (src->type() == dst->type() &&
+ src->buffer_type() == dst->buffer_type())
- // Control => atom:Float Value
- || (src->is_a(PortType::CONTROL) && dst->supports(uris.atom_Float))
+ // Control => atom:Float Value
+ || (src->is_a(PortType::CONTROL) && dst->supports(uris.atom_Float))
- // Audio => atom:Sound Value
- || (src->is_a(PortType::AUDIO) && dst->supports(uris.atom_Sound))
+ // Audio => atom:Sound Value
+ || (src->is_a(PortType::AUDIO) && dst->supports(uris.atom_Sound))
- // atom:Float Value => Control
- || (src->supports(uris.atom_Float) && dst->is_a(PortType::CONTROL))
+ // atom:Float Value => Control
+ || (src->supports(uris.atom_Float) && dst->is_a(PortType::CONTROL))
- // atom:Sound Value => Audio
- || (src->supports(uris.atom_Sound) && dst->is_a(PortType::AUDIO)));
+ // atom:Sound Value => Audio
+ || (src->supports(uris.atom_Sound) && dst->is_a(PortType::AUDIO)));
}
} // namespace Server
diff --git a/src/server/ConnectionImpl.hpp b/src/server/ConnectionImpl.hpp
index a93674b6..395e749d 100644
--- a/src/server/ConnectionImpl.hpp
+++ b/src/server/ConnectionImpl.hpp
@@ -83,10 +83,10 @@ public:
*/
BufferRef buffer(uint32_t voice) const;
- /** Returns true if this connection must mix down voices into a local buffer */
+ /** Whether this connection must mix down voices into a local buffer */
bool must_mix() const;
- /** Returns true if this connection crosses contexts and must buffer */
+ /** Whether this connection crosses contexts and must buffer */
bool must_queue() const;
static bool can_connect(const OutputPort* src, const InputPort* dst);
diff --git a/src/server/EventSource.hpp b/src/server/EventSource.hpp
index ebe3dd70..e8619786 100644
--- a/src/server/EventSource.hpp
+++ b/src/server/EventSource.hpp
@@ -42,7 +42,7 @@ public:
void process(PostProcessor& dest, ProcessContext& context, bool limit=true);
- inline bool unprepared_events() const { return (_prepared_back.get() != NULL); }
+ inline bool unprepared_events() const { return _prepared_back.get(); }
inline bool empty() const { return !_head.get(); }
protected:
diff --git a/src/server/LV2ResizeFeature.hpp b/src/server/LV2ResizeFeature.hpp
index 915c7442..a2d9e8b6 100644
--- a/src/server/LV2ResizeFeature.hpp
+++ b/src/server/LV2ResizeFeature.hpp
@@ -29,8 +29,8 @@ namespace Server {
struct ResizeFeature : public Ingen::Shared::LV2Features::Feature {
static LV2_Resize_Port_Status resize_port(
LV2_Resize_Port_Feature_Data data,
- uint32_t index,
- size_t size) {
+ uint32_t index,
+ size_t size) {
NodeImpl* node = (NodeImpl*)data;
PortImpl* port = node->port_impl(index);
if (node->context() == Context::MESSAGE) {
@@ -51,7 +51,7 @@ struct ResizeFeature : public Ingen::Shared::LV2Features::Feature {
if (!node)
return SharedPtr<LV2_Feature>();
LV2_Resize_Port_Resize* data
- = (LV2_Resize_Port_Resize*)malloc(sizeof(LV2_Resize_Port_Resize));
+ = (LV2_Resize_Port_Resize*)malloc(sizeof(LV2_Resize_Port_Resize));
data->data = node;
data->resize = &resize_port;
LV2_Feature* f = (LV2_Feature*)malloc(sizeof(LV2_Feature));
diff --git a/src/server/ObjectSender.cpp b/src/server/ObjectSender.cpp
index 4115f2e3..85be4efd 100644
--- a/src/server/ObjectSender.cpp
+++ b/src/server/ObjectSender.cpp
@@ -58,7 +58,10 @@ ObjectSender::send_object(Interface* client,
}
void
-ObjectSender::send_patch(Interface* client, const PatchImpl* patch, bool recursive, bool bundle)
+ObjectSender::send_patch(Interface* client,
+ const PatchImpl* patch,
+ bool recursive,
+ bool bundle)
{
if (bundle)
client->bundle_begin();