diff options
-rw-r--r-- | src/libs/client/DeprecatedLoader.cpp | 2 | ||||
-rw-r--r-- | src/libs/client/OSCClientReceiver.cpp | 2 | ||||
-rw-r--r-- | src/libs/client/ObjectModel.cpp | 1 | ||||
-rw-r--r-- | src/libs/client/PluginUI.cpp | 19 | ||||
-rw-r--r-- | src/libs/client/PortModel.cpp | 6 | ||||
-rw-r--r-- | src/libs/client/Store.cpp | 2 | ||||
-rw-r--r-- | src/libs/engine/OSCEngineReceiver.cpp | 2 | ||||
-rw-r--r-- | src/libs/engine/PortImpl.cpp | 2 | ||||
-rw-r--r-- | src/libs/gui/ConnectWindow.cpp | 2 | ||||
-rw-r--r-- | src/libs/gui/ControlGroups.cpp | 2 | ||||
-rw-r--r-- | src/libs/gui/NodeModule.cpp | 1 | ||||
-rw-r--r-- | src/libs/gui/Port.cpp | 15 | ||||
-rw-r--r-- | src/libs/gui/Port.hpp | 4 | ||||
-rw-r--r-- | src/libs/gui/UploadPatchWindow.cpp | 4 | ||||
-rw-r--r-- | src/libs/serialisation/Serialiser.cpp | 2 |
15 files changed, 40 insertions, 26 deletions
diff --git a/src/libs/client/DeprecatedLoader.cpp b/src/libs/client/DeprecatedLoader.cpp index 68f7941d..4897137c 100644 --- a/src/libs/client/DeprecatedLoader.cpp +++ b/src/libs/client/DeprecatedLoader.cpp @@ -160,7 +160,7 @@ DeprecatedLoader::load_patch(const Glib::ustring& filename, /* Use parameter overridden polyphony, if given */ GraphObject::Variables::iterator poly_param = initial_data.find("ingen:polyphony"); if (poly_param != initial_data.end() && poly_param->second.type() == Atom::INT) - poly = poly_param->second; + poly = poly_param->second.get_int32(); if (initial_data.find("filename") == initial_data.end()) initial_data["filename"] = Atom(filename.c_str()); // FIXME: URL? diff --git a/src/libs/client/OSCClientReceiver.cpp b/src/libs/client/OSCClientReceiver.cpp index 04b83d61..6002ca59 100644 --- a/src/libs/client/OSCClientReceiver.cpp +++ b/src/libs/client/OSCClientReceiver.cpp @@ -35,7 +35,7 @@ OSCClientReceiver::OSCClientReceiver(int listen_port) _listen_port(listen_port), _st(NULL) { - start(true); // true = dump, false = shutup + start(false); // true = dump, false = shutup } diff --git a/src/libs/client/ObjectModel.cpp b/src/libs/client/ObjectModel.cpp index 1d22c8eb..b951bc6b 100644 --- a/src/libs/client/ObjectModel.cpp +++ b/src/libs/client/ObjectModel.cpp @@ -124,7 +124,6 @@ ObjectModel::set(SharedPtr<ObjectModel> model) if (mine != _variables.end()) { cerr << "WARNING: " << _path << "Client/Server data mismatch: " << other->first << endl; - cerr << "Setting server value " << other->second; } _variables[other->first] = other->second; diff --git a/src/libs/client/PluginUI.cpp b/src/libs/client/PluginUI.cpp index 5215de25..9dcbfcba 100644 --- a/src/libs/client/PluginUI.cpp +++ b/src/libs/client/PluginUI.cpp @@ -16,12 +16,14 @@ */ #include <iostream> +#include "shared/LV2URIMap.hpp" #include "PluginUI.hpp" #include "NodeModel.hpp" #include "PortModel.hpp" using namespace std; using Ingen::Shared::EngineInterface; +using Ingen::Shared::LV2URIMap; namespace Ingen { namespace Client { @@ -33,6 +35,7 @@ lv2_ui_write(LV2UI_Controller controller, uint32_t format, const void* buffer) { +#if 0 cerr << "********* LV2 UI WRITE (FORMAT " << format << "):" << endl; /*lv2_osc_message_print((const LV2Message*)buffer);*/ @@ -45,16 +48,24 @@ lv2_ui_write(LV2UI_Controller controller, fprintf(stderr, "%2X ", ((unsigned char*)buffer)[i]); } fprintf(stderr, "\n"); +#endif PluginUI* ui = (PluginUI*)controller; SharedPtr<PortModel> port = ui->node()->ports()[port_index]; - if (format == 0) { - ui->world()->engine->set_port_value_immediate(port->path(), - port->type().uri(), - buffer_size, buffer); + LV2URIMap* map = (LV2URIMap*)ui->world()->lv2_features->feature(LV2_URI_MAP_URI); + assert(map); + + if (format == 0) { // float (special case) + assert(buffer_size == 4); + if (*(float*)buffer == port->value().get_float()) + return; // do nothing (handle stupid plugin UIs that feed back) } + + ui->world()->engine->set_port_value_immediate(port->path(), + port->type().uri(), + buffer_size, buffer); } diff --git a/src/libs/client/PortModel.cpp b/src/libs/client/PortModel.cpp index 6b727747..ecf1070b 100644 --- a/src/libs/client/PortModel.cpp +++ b/src/libs/client/PortModel.cpp @@ -26,7 +26,7 @@ bool PortModel::is_logarithmic() const { const Atom& hint = get_variable("ingen:logarithmic"); - return (hint && hint > 0); + return (hint.is_valid() && hint.get_bool() > 0); } @@ -34,7 +34,7 @@ bool PortModel::is_integer() const { const Atom& hint = get_variable("ingen:integer"); - return (hint && hint > 0); + return (hint.is_valid() && hint.get_bool() > 0); } @@ -42,7 +42,7 @@ bool PortModel::is_toggle() const { const Atom& hint = get_variable("ingen:toggled"); - return (hint && hint > 0); + return (hint.is_valid() && hint.get_bool() > 0); } } // namespace Client diff --git a/src/libs/client/Store.cpp b/src/libs/client/Store.cpp index b679b01a..1eea354a 100644 --- a/src/libs/client/Store.cpp +++ b/src/libs/client/Store.cpp @@ -511,7 +511,7 @@ Store::variable_change_event(const Path& subject_path, const string& predicate, { SharedPtr<ObjectModel> subject = object(subject_path); - if (!value) { + if (!value.is_valid()) { cerr << "ERROR: variable '" << predicate << "' has no type" << endl; } else if (subject) { subject->set_variable(predicate, value); diff --git a/src/libs/engine/OSCEngineReceiver.cpp b/src/libs/engine/OSCEngineReceiver.cpp index db51dc29..20971e5a 100644 --- a/src/libs/engine/OSCEngineReceiver.cpp +++ b/src/libs/engine/OSCEngineReceiver.cpp @@ -69,7 +69,7 @@ OSCEngineReceiver::OSCEngineReceiver(Engine& engine, size_t queue_size, uint16_t } // For debugging, print all incoming OSC messages - lo_server_add_method(_server, NULL, NULL, generic_cb, NULL); + //lo_server_add_method(_server, NULL, NULL, generic_cb, NULL); // Set response address for this message. // It's important this is first and returns nonzero. diff --git a/src/libs/engine/PortImpl.cpp b/src/libs/engine/PortImpl.cpp index 9500aab1..04296a04 100644 --- a/src/libs/engine/PortImpl.cpp +++ b/src/libs/engine/PortImpl.cpp @@ -47,7 +47,7 @@ PortImpl::PortImpl(NodeImpl* const node, , _value(value) , _fixed_buffers(false) , _broadcast(false) - , _last_broadcasted_value(_value) // default? + , _last_broadcasted_value(_value.type() == Atom::FLOAT ? _value.get_float() : 0.0f) // default? , _buffers(new Raul::Array<Buffer*>(poly)) { assert(node != NULL); diff --git a/src/libs/gui/ConnectWindow.cpp b/src/libs/gui/ConnectWindow.cpp index 11da988d..7bf34c01 100644 --- a/src/libs/gui/ConnectWindow.cpp +++ b/src/libs/gui/ConnectWindow.cpp @@ -155,6 +155,8 @@ ConnectWindow::set_connected_to(SharedPtr<Shared::EngineInterface> engine) _progress_label->set_text(string("Disconnected")); } + + App::instance().world()->engine = engine.get(); } diff --git a/src/libs/gui/ControlGroups.cpp b/src/libs/gui/ControlGroups.cpp index 114bb79d..f0f5aa13 100644 --- a/src/libs/gui/ControlGroups.cpp +++ b/src/libs/gui/ControlGroups.cpp @@ -249,7 +249,7 @@ SliderControlGroup::update_value_from_slider() if (_port_model->is_integer()) { value = lrintf(value); - if (value == lrintf(_port_model->value())) + if (value == lrintf(_port_model->value().get_float())) change = false; } diff --git a/src/libs/gui/NodeModule.cpp b/src/libs/gui/NodeModule.cpp index b3b191d1..cabea96a 100644 --- a/src/libs/gui/NodeModule.cpp +++ b/src/libs/gui/NodeModule.cpp @@ -110,7 +110,6 @@ void NodeModule::value_changed(uint32_t index, const Atom& value) { float control = value.get_float(); - cout << _node->name() << " control " << index << " = " << control << endl; if (_plugin_ui) { SLV2UIInstance inst = _plugin_ui->instance(); const LV2UI_Descriptor* ui_descriptor = slv2_ui_instance_get_descriptor(inst); diff --git a/src/libs/gui/Port.cpp b/src/libs/gui/Port.cpp index 225ab7ab..df0b779c 100644 --- a/src/libs/gui/Port.cpp +++ b/src/libs/gui/Port.cpp @@ -62,13 +62,13 @@ Port::Port(boost::shared_ptr<FlowCanvas::Module> module, SharedPtr<PortModel> pm set_control_min(min); set_control_max(max); - pm->signal_variable.connect(sigc::mem_fun(this, &Port::variable_change)); - _port_model->signal_value_changed.connect(sigc::mem_fun(this, &Port::control_changed)); + pm->signal_variable.connect(sigc::mem_fun(this, &Port::variable_changed)); + _port_model->signal_value_changed.connect(sigc::mem_fun(this, &Port::value_changed)); } _port_model->signal_activity.connect(sigc::mem_fun(this, &Port::activity)); - control_changed(_port_model->value()); + value_changed(_port_model->value()); } @@ -92,9 +92,12 @@ Port::renamed() void -Port::control_changed(float value) +Port::value_changed(const Atom& value) { - FlowCanvas::Port::set_control(value); + if (value.type() == Atom::FLOAT) + FlowCanvas::Port::set_control(value.get_float()); + else + cerr << "WARNING: Unknown port value type " << (unsigned)value.type() << endl; } @@ -120,7 +123,7 @@ Port::set_control(float value, bool signal) void -Port::variable_change(const string& key, const Atom& value) +Port::variable_changed(const string& key, const Atom& value) { if ( (key == "ingen:minimum") && value.type() == Atom::FLOAT) set_control_min(value.get_float()); diff --git a/src/libs/gui/Port.hpp b/src/libs/gui/Port.hpp index 5748f4c7..e14110e7 100644 --- a/src/libs/gui/Port.hpp +++ b/src/libs/gui/Port.hpp @@ -47,12 +47,12 @@ public: void create_menu(); virtual void set_control(float value, bool signal); - void control_changed(float value); + void value_changed(const Raul::Atom& value); void activity(); private: - void variable_change(const std::string& key, const Raul::Atom& value); + void variable_changed(const std::string& key, const Raul::Atom& value); void renamed(); diff --git a/src/libs/gui/UploadPatchWindow.cpp b/src/libs/gui/UploadPatchWindow.cpp index c69ce7f3..16fa0665 100644 --- a/src/libs/gui/UploadPatchWindow.cpp +++ b/src/libs/gui/UploadPatchWindow.cpp @@ -75,11 +75,11 @@ UploadPatchWindow::on_show() Gtk::Dialog::on_show(); Raul::Atom atom = _patch->get_variable("lv2:symbol"); - if (atom) + if (atom.is_valid()) _symbol_entry->set_text(atom.get_string()); atom = _patch->get_variable("doap:name"); - if (atom) + if (atom.is_valid()) _short_name_entry->set_text(atom.get_string()); } diff --git a/src/libs/serialisation/Serialiser.cpp b/src/libs/serialisation/Serialiser.cpp index d3114082..a6b48fb4 100644 --- a/src/libs/serialisation/Serialiser.cpp +++ b/src/libs/serialisation/Serialiser.cpp @@ -432,7 +432,7 @@ Serialiser::serialise_variables(Redland::Node subject, const GraphObject::Variab { for (GraphObject::Variables::const_iterator v = variables.begin(); v != variables.end(); ++v) { if (v->first.find(":") != string::npos) { - if (v->second) { + if (v->second.is_valid()) { const Redland::Node var_id = _world.blank_id(); const Redland::Node key(_model->world(), Redland::Node::RESOURCE, v->first); const Redland::Node value = AtomRDF::atom_to_node(_model->world(), v->second); |