diff options
Diffstat (limited to 'src/libs')
-rw-r--r-- | src/libs/client/OSCClientReceiver.cpp | 2 | ||||
-rw-r--r-- | src/libs/client/PluginModel.cpp | 2 | ||||
-rw-r--r-- | src/libs/client/PluginUI.cpp | 16 | ||||
-rw-r--r-- | src/libs/client/PortModel.hpp | 8 | ||||
-rw-r--r-- | src/libs/engine/LV2Info.hpp | 2 | ||||
-rw-r--r-- | src/libs/engine/OSCEngineReceiver.cpp | 2 | ||||
-rw-r--r-- | src/libs/gui/ControlGroups.cpp | 8 | ||||
-rw-r--r-- | src/libs/gui/ControlGroups.hpp | 4 | ||||
-rw-r--r-- | src/libs/gui/NodeModule.cpp | 10 | ||||
-rw-r--r-- | src/libs/gui/NodeModule.hpp | 2 | ||||
-rw-r--r-- | src/libs/gui/Port.cpp | 2 |
11 files changed, 30 insertions, 28 deletions
diff --git a/src/libs/client/OSCClientReceiver.cpp b/src/libs/client/OSCClientReceiver.cpp index 6002ca59..04b83d61 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(false); // true = dump, false = shutup + start(true); // true = dump, false = shutup } diff --git a/src/libs/client/PluginModel.cpp b/src/libs/client/PluginModel.cpp index df8d4bf7..1f11cc21 100644 --- a/src/libs/client/PluginModel.cpp +++ b/src/libs/client/PluginModel.cpp @@ -57,6 +57,7 @@ PluginModel::default_node_name(SharedPtr<PatchModel> parent) } +#if 0 struct NodeController { EngineInterface* engine; NodeModel* node; @@ -91,6 +92,7 @@ lv2_ui_write(LV2UI_Controller controller, nc->engine->set_port_value_immediate(port->path(), port->type().uri(), buffer_size, buffer); } +#endif #ifdef HAVE_SLV2 diff --git a/src/libs/client/PluginUI.cpp b/src/libs/client/PluginUI.cpp index b9ef9050..54ee0009 100644 --- a/src/libs/client/PluginUI.cpp +++ b/src/libs/client/PluginUI.cpp @@ -30,11 +30,11 @@ static void lv2_ui_write(LV2UI_Controller controller, uint32_t port_index, uint32_t buffer_size, - uint32_t format, + uint32_t format, const void* buffer) { - /*cerr << "********* LV2 UI WRITE:" << endl; - lv2_osc_message_print((const LV2Message*)buffer); + cerr << "********* LV2 UI WRITE (FORMAT " << format << ":" << endl; + /*lv2_osc_message_print((const LV2Message*)buffer);*/ fprintf(stderr, "RAW:\n"); for (uint32_t i=0; i < buffer_size; ++i) { @@ -44,18 +44,16 @@ lv2_ui_write(LV2UI_Controller controller, else fprintf(stderr, "%2X ", ((unsigned char*)buffer)[i]); } - fprintf(stderr, "\n"); - */ PluginUI* ui = (PluginUI*)controller; SharedPtr<PortModel> port = ui->node()->ports()[port_index]; if (format == 0) { - ui->engine()->set_port_value_immediate(port->path(), - port->type().uri(), - buffer_size, buffer); + ui->engine()->set_port_value_immediate(port->path(), + port->type().uri(), + buffer_size, buffer); } } @@ -73,7 +71,7 @@ PluginUI::~PluginUI() { slv2_ui_instance_free(_instance); } - + SharedPtr<PluginUI> PluginUI::create(SharedPtr<EngineInterface> engine, diff --git a/src/libs/client/PortModel.hpp b/src/libs/client/PortModel.hpp index 940b967e..759b8c1e 100644 --- a/src/libs/client/PortModel.hpp +++ b/src/libs/client/PortModel.hpp @@ -56,18 +56,16 @@ public: inline bool operator==(const PortModel& pm) const { return (_path == pm._path); } - inline void value(float val) + inline void value(const Atom& val) { if (val != _current_val) { _current_val = val; - signal_control.emit(val); + signal_value_changed.emit(val); } } - inline float value() { return _current_val; } - // Signals - sigc::signal<void, float> signal_control; ///< Control ports + sigc::signal<void, const Atom&> signal_value_changed; ///< Value ports sigc::signal<void> signal_activity; ///< Message ports sigc::signal<void, SharedPtr<PortModel> > signal_connection; sigc::signal<void, SharedPtr<PortModel> > signal_disconnection; diff --git a/src/libs/engine/LV2Info.hpp b/src/libs/engine/LV2Info.hpp index 61bfe468..09865784 100644 --- a/src/libs/engine/LV2Info.hpp +++ b/src/libs/engine/LV2Info.hpp @@ -61,7 +61,7 @@ public: const char* uri); static uint32_t event_ref(LV2_Event_Callback_Data callback_data, - LV2_Event* event); + LV2_Event* event); LV2_Feature** lv2_features; }; diff --git a/src/libs/engine/OSCEngineReceiver.cpp b/src/libs/engine/OSCEngineReceiver.cpp index 20971e5a..db51dc29 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/gui/ControlGroups.cpp b/src/libs/gui/ControlGroups.cpp index 236f782e..114bb79d 100644 --- a/src/libs/gui/ControlGroups.cpp +++ b/src/libs/gui/ControlGroups.cpp @@ -64,7 +64,7 @@ ControlGroup::init(ControlPanel* panel, SharedPtr<PortModel> pm) assert(_port_model); assert(panel); - _control_connection = pm->signal_control.connect(sigc::mem_fun(this, &ControlGroup::set_value)); + _control_connection = pm->signal_value_changed.connect(sigc::mem_fun(this, &ControlGroup::set_value)); } @@ -130,7 +130,7 @@ SliderControlGroup::init(ControlPanel* panel, SharedPtr<PortModel> pm) pm->signal_variable.connect(sigc::mem_fun(this, &SliderControlGroup::port_variable_change)); - _slider->set_range(std::min(min, pm->value()), std::max(max, pm->value())); + _slider->set_range(std::min(min, pm->value().get_float()), std::max(max, pm->value().get_float())); //_value_spinner->set_range(min, max); set_value(pm->value()); @@ -165,8 +165,10 @@ SliderControlGroup::menu_properties() void -SliderControlGroup::set_value(float val) +SliderControlGroup::set_value(const Atom& atom) { + float val = atom.get_float(); + if (_port_model->is_integer()) val = lrintf(val); diff --git a/src/libs/gui/ControlGroups.hpp b/src/libs/gui/ControlGroups.hpp index 89f26a6b..da604f72 100644 --- a/src/libs/gui/ControlGroups.hpp +++ b/src/libs/gui/ControlGroups.hpp @@ -49,7 +49,7 @@ public: inline const SharedPtr<PortModel> port_model() const { return _port_model; } protected: - virtual void set_value(float value) = 0; + virtual void set_value(const Atom& value) = 0; virtual void set_range(float min, float max) {} ControlPanel* _control_panel; @@ -80,7 +80,7 @@ private: bool clicked(GdkEventButton* ev); - void set_value(float value); + void set_value(const Atom& value); void set_range(float min, float max); void port_variable_change(const string& key, const Raul::Atom& value); diff --git a/src/libs/gui/NodeModule.cpp b/src/libs/gui/NodeModule.cpp index fefe84fb..0e4ce18b 100644 --- a/src/libs/gui/NodeModule.cpp +++ b/src/libs/gui/NodeModule.cpp @@ -107,8 +107,10 @@ NodeModule::create(boost::shared_ptr<PatchCanvas> canvas, SharedPtr<NodeModel> n void -NodeModule::control_change(uint32_t index, float control) +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); @@ -250,8 +252,8 @@ NodeModule::add_port(SharedPtr<PortModel> port, bool resize_to_fit) Module::add_port(boost::shared_ptr<Port>( new Port(PtrCast<NodeModule>(shared_from_this()), port))); - port->signal_control.connect(sigc::bind<0>( - sigc::mem_fun(this, &NodeModule::control_change), index)); + port->signal_value_changed.connect(sigc::bind<0>( + sigc::mem_fun(this, &NodeModule::value_changed), index)); if (resize_to_fit) resize(); @@ -320,7 +322,7 @@ NodeModule::initialise_gui_values() uint32_t index=0; for (PortModelList::const_iterator p = _node->ports().begin(); p != _node->ports().end(); ++p) { if ((*p)->type().is_control()) - control_change(index, (*p)->value()); + value_changed(index, (*p)->value()); ++index; } } diff --git a/src/libs/gui/NodeModule.hpp b/src/libs/gui/NodeModule.hpp index d73b4529..595cb1e1 100644 --- a/src/libs/gui/NodeModule.hpp +++ b/src/libs/gui/NodeModule.hpp @@ -77,7 +77,7 @@ protected: void add_port(SharedPtr<PortModel> port, bool resize=true); void remove_port(SharedPtr<PortModel> port); - void control_change(uint32_t index, float control); + void value_changed(uint32_t index, const Atom& value); void embed_gui(bool embed); void gui_size_request(Gtk::Requisition* req, bool force); diff --git a/src/libs/gui/Port.cpp b/src/libs/gui/Port.cpp index 97a06bcd..225ab7ab 100644 --- a/src/libs/gui/Port.cpp +++ b/src/libs/gui/Port.cpp @@ -63,7 +63,7 @@ Port::Port(boost::shared_ptr<FlowCanvas::Module> module, SharedPtr<PortModel> pm set_control_max(max); pm->signal_variable.connect(sigc::mem_fun(this, &Port::variable_change)); - _port_model->signal_control.connect(sigc::mem_fun(this, &Port::control_changed)); + _port_model->signal_value_changed.connect(sigc::mem_fun(this, &Port::control_changed)); } _port_model->signal_activity.connect(sigc::mem_fun(this, &Port::activity)); |