diff options
author | David Robillard <d@drobilla.net> | 2014-08-09 04:23:18 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-08-09 04:23:18 +0000 |
commit | 42347b5c859a77eb99af1c718b48170b0672dc5e (patch) | |
tree | c77c9567d64623a2df9f674a3c8791ded2dbb033 | |
parent | ed2d6f395dd6363f1955512b3f20cf3f39954783 (diff) | |
download | ingen-42347b5c859a77eb99af1c718b48170b0672dc5e.tar.gz ingen-42347b5c859a77eb99af1c718b48170b0672dc5e.tar.bz2 ingen-42347b5c859a77eb99af1c718b48170b0672dc5e.zip |
Fix GUI updates after operations by emulating set feedback.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5445 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r-- | src/gui/App.cpp | 15 | ||||
-rw-r--r-- | src/gui/App.hpp | 4 | ||||
-rw-r--r-- | src/gui/GraphTreeWindow.cpp | 7 | ||||
-rw-r--r-- | src/gui/GraphView.cpp | 14 | ||||
-rw-r--r-- | src/gui/NodeMenu.cpp | 9 | ||||
-rw-r--r-- | src/gui/NodeModule.cpp | 6 | ||||
-rw-r--r-- | src/gui/ObjectMenu.cpp | 2 | ||||
-rw-r--r-- | src/gui/Port.cpp | 21 | ||||
-rw-r--r-- | src/gui/PortMenu.cpp | 8 | ||||
-rw-r--r-- | src/gui/RenameWindow.cpp | 6 |
10 files changed, 53 insertions, 39 deletions
diff --git a/src/gui/App.cpp b/src/gui/App.cpp index 3dc08609..22a5a95c 100644 --- a/src/gui/App.cpp +++ b/src/gui/App.cpp @@ -235,6 +235,21 @@ App::error_message(const string& str) } void +App::set_property(const Raul::URI& subject, + const Raul::URI& key, + const Atom& value) +{ + // Send message to server + interface()->set_property(subject, key, value); + + /* The server does not feed back set messages (kludge to prevent control + feedback and bandwidth wastage, see Delta.cpp). So, assume everything + went as planned here and fire the signal ourselves as if the server + feedback came back immediately. */ + _client->signal_property_change().emit(subject, key, value); +} + +void App::property_change(const Raul::URI& subject, const Raul::URI& key, const Atom& value) diff --git a/src/gui/App.hpp b/src/gui/App.hpp index 4adee828..f875c7c6 100644 --- a/src/gui/App.hpp +++ b/src/gui/App.hpp @@ -98,6 +98,10 @@ public: return old; } + void set_property(const Raul::URI& subject, + const Raul::URI& key, + const Atom& value); + uint32_t sample_rate() const; ConnectWindow* connect_window() const { return _connect_window; } diff --git a/src/gui/GraphTreeWindow.cpp b/src/gui/GraphTreeWindow.cpp index ae4e522d..d3bf8526 100644 --- a/src/gui/GraphTreeWindow.cpp +++ b/src/gui/GraphTreeWindow.cpp @@ -185,10 +185,9 @@ GraphTreeWindow::event_graph_enabled_toggled(const Glib::ustring& path_str) assert(pm); if (_enable_signal) - _app->interface()->set_property( - pm->uri(), - _app->uris().ingen_enabled, - _app->forge().make((bool)!pm->enabled())); + _app->set_property(pm->uri(), + _app->uris().ingen_enabled, + _app->forge().make((bool)!pm->enabled())); } void diff --git a/src/gui/GraphView.cpp b/src/gui/GraphView.cpp index 444075b9..001d1faf 100644 --- a/src/gui/GraphView.cpp +++ b/src/gui/GraphView.cpp @@ -121,10 +121,9 @@ GraphView::process_toggled() if (!_enable_signal) return; - _app->interface()->set_property( - _graph->uri(), - _app->uris().ingen_enabled, - _app->forge().make((bool)_process_but->get_active())); + _app->set_property(_graph->uri(), + _app->uris().ingen_enabled, + _app->forge().make((bool)_process_but->get_active())); } void @@ -132,10 +131,9 @@ GraphView::poly_changed() { const int poly = _poly_spin->get_value_as_int(); if (_enable_signal && poly != (int)_graph->internal_poly()) { - _app->interface()->set_property( - _graph->uri(), - _app->uris().ingen_polyphony, - _app->forge().make(poly)); + _app->set_property(_graph->uri(), + _app->uris().ingen_polyphony, + _app->forge().make(poly)); } } diff --git a/src/gui/NodeMenu.cpp b/src/gui/NodeMenu.cpp index ed764904..1a64d04e 100644 --- a/src/gui/NodeMenu.cpp +++ b/src/gui/NodeMenu.cpp @@ -157,10 +157,9 @@ NodeMenu::on_menu_randomize() float min = 0.0f, max = 1.0f; bm->port_value_range(p, min, max, _app->sample_rate()); const float val = g_random_double_range(0.0, 1.0) * (max - min) + min; - _app->interface()->set_property( - p->uri(), - _app->uris().ingen_value, - _app->forge().make(val)); + _app->set_property(p->uri(), + _app->uris().ingen_value, + _app->forge().make(val)); } } @@ -189,7 +188,7 @@ set_port_value(const char* port_symbol, return; } - menu->app()->interface()->set_property( + menu->app()->set_property( Node::path_to_uri(block->path().child(Raul::Symbol(port_symbol))), menu->app()->uris().ingen_value, menu->app()->forge().alloc(size, type, value)); diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp index aa2b543c..1eb07b2b 100644 --- a/src/gui/NodeModule.cpp +++ b/src/gui/NodeModule.cpp @@ -207,9 +207,9 @@ void NodeModule::on_embed_gui_toggled(bool embed) { embed_gui(embed); - app().interface()->set_property(_block->uri(), - app().uris().ingen_uiEmbedded, - app().forge().make(embed)); + app().set_property(_block->uri(), + app().uris().ingen_uiEmbedded, + app().forge().make(embed)); } void diff --git a/src/gui/ObjectMenu.cpp b/src/gui/ObjectMenu.cpp index 8432e7b7..a6211797 100644 --- a/src/gui/ObjectMenu.cpp +++ b/src/gui/ObjectMenu.cpp @@ -110,7 +110,7 @@ void ObjectMenu::on_menu_polyphonic() { if (_enable_signal) - _app->interface()->set_property( + _app->set_property( _object->uri(), _app->uris().ingen_polyphonic, _app->forge().make(bool(_polyphonic_menuitem->get_active()))); diff --git a/src/gui/Port.cpp b/src/gui/Port.cpp index 31850120..b04e93b5 100644 --- a/src/gui/Port.cpp +++ b/src/gui/Port.cpp @@ -168,9 +168,9 @@ Port::on_value_changed(double value) } const Atom atom = _app.forge().make(float(value)); - _app.interface()->set_property(model()->uri(), - _app.world()->uris().ingen_value, - atom); + _app.set_property(model()->uri(), + _app.world()->uris().ingen_value, + atom); if (_entered) { GraphBox* box = get_graph_box(); @@ -191,9 +191,9 @@ Port::value_changed(const Atom& value) void Port::on_scale_point_activated(float f) { - _app.interface()->set_property(model()->uri(), - _app.world()->uris().ingen_value, - _app.world()->forge().make(f)); + _app.set_property(model()->uri(), + _app.world()->uris().ingen_value, + _app.world()->forge().make(f)); } Gtk::Menu* @@ -219,11 +219,10 @@ Port::build_enum_menu() void Port::on_uri_activated(const Raul::URI& uri) { - _app.interface()->set_property( - model()->uri(), - _app.world()->uris().ingen_value, - _app.world()->forge().make_urid( - _app.world()->uri_map().map_uri(uri.c_str()))); + _app.set_property(model()->uri(), + _app.world()->uris().ingen_value, + _app.world()->forge().make_urid( + _app.world()->uri_map().map_uri(uri.c_str()))); } Gtk::Menu* diff --git a/src/gui/PortMenu.cpp b/src/gui/PortMenu.cpp index d1d1a923..3b8cc741 100644 --- a/src/gui/PortMenu.cpp +++ b/src/gui/PortMenu.cpp @@ -103,9 +103,9 @@ PortMenu::on_menu_set_min() { const URIs& uris = _app->uris(); SPtr<const PortModel> model = dynamic_ptr_cast<const PortModel>(_object); - const Atom& value = model->get_property(uris.ingen_value); + const Atom& value = model->get_property(uris.ingen_value); if (value.is_valid()) - _app->interface()->set_property(_object->uri(), uris.lv2_minimum, value); + _app->set_property(_object->uri(), uris.lv2_minimum, value); } void @@ -113,9 +113,9 @@ PortMenu::on_menu_set_max() { const URIs& uris = _app->uris(); SPtr<const PortModel> model = dynamic_ptr_cast<const PortModel>(_object); - const Atom& value = model->get_property(uris.ingen_value); + const Atom& value = model->get_property(uris.ingen_value); if (value.is_valid()) - _app->interface()->set_property(_object->uri(), uris.lv2_maximum, value); + _app->set_property(_object->uri(), uris.lv2_maximum, value); } void diff --git a/src/gui/RenameWindow.cpp b/src/gui/RenameWindow.cpp index e4d6fe05..880277ed 100644 --- a/src/gui/RenameWindow.cpp +++ b/src/gui/RenameWindow.cpp @@ -125,9 +125,9 @@ RenameWindow::ok_clicked() } if (!label.empty() && (!name_atom.is_valid() || label != name_atom.ptr<char>())) { - _app->interface()->set_property(Node::path_to_uri(path), - uris.lv2_name, - _app->forge().alloc(label)); + _app->set_property(Node::path_to_uri(path), + uris.lv2_name, + _app->forge().alloc(label)); } hide(); |