From 696535322342c56901d4d48641b6f9cf816ac1e1 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 17 Aug 2008 04:12:10 +0000 Subject: Remove remnants of imperative polyphony interface. git-svn-id: http://svn.drobilla.net/lad/ingen@1413 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/client/OSCEngineSender.cpp | 28 ---------------------------- src/libs/client/OSCEngineSender.hpp | 4 ---- src/libs/engine/QueuedEngineInterface.cpp | 14 ++++++++++++-- src/libs/gui/LoadSubpatchWindow.cpp | 2 +- src/libs/gui/ObjectMenu.cpp | 3 ++- src/libs/gui/PatchView.cpp | 3 ++- 6 files changed, 17 insertions(+), 37 deletions(-) (limited to 'src/libs') diff --git a/src/libs/client/OSCEngineSender.cpp b/src/libs/client/OSCEngineSender.cpp index 22f0ce86..4f8fcbe5 100644 --- a/src/libs/client/OSCEngineSender.cpp +++ b/src/libs/client/OSCEngineSender.cpp @@ -219,34 +219,6 @@ OSCEngineSender::clear_patch(const string& patch_path) } -void -OSCEngineSender::set_polyphony(const string& patch_path, uint32_t poly) -{ - send("/ingen/set_polyphony", "isi", - next_id(), - patch_path.c_str(), - poly, - LO_ARGS_END); -} - - -void -OSCEngineSender::set_polyphonic(const string& path, bool poly) -{ - if (poly) { - send("/ingen/set_polyphonic", "isT", - next_id(), - path.c_str(), - LO_ARGS_END); - } else { - send("/ingen/set_polyphonic", "isF", - next_id(), - path.c_str(), - LO_ARGS_END); - } -} - - void OSCEngineSender::connect(const string& src_port_path, const string& dst_port_path) diff --git a/src/libs/client/OSCEngineSender.hpp b/src/libs/client/OSCEngineSender.hpp index 771a7232..f94b86d5 100644 --- a/src/libs/client/OSCEngineSender.hpp +++ b/src/libs/client/OSCEngineSender.hpp @@ -100,10 +100,6 @@ public: void clear_patch(const string& patch_path); - void set_polyphony(const string& patch_path, uint32_t poly); - - void set_polyphonic(const string& path, bool poly); - void connect(const string& src_port_path, const string& dst_port_path); diff --git a/src/libs/engine/QueuedEngineInterface.cpp b/src/libs/engine/QueuedEngineInterface.cpp index 23b9c77e..3e45734a 100644 --- a/src/libs/engine/QueuedEngineInterface.cpp +++ b/src/libs/engine/QueuedEngineInterface.cpp @@ -319,10 +319,20 @@ QueuedEngineInterface::set_property(const string& path, push_queued(new EnablePatchEvent(_engine, _responder, now(), path, value.get_bool())); return; } + } else if (predicate == "ingen:polyphonic") { + if (value.type() == Atom::BOOL) { + push_queued(new SetPolyphonicEvent(_engine, _responder, now(), this, path, value.get_bool())); + return; + } + } else if (predicate == "ingen:polyphony") { + if (value.type() == Atom::INT) { + push_queued(new SetPolyphonyEvent(_engine, _responder, now(), this, path, value.get_int32())); + return; + } } - cerr << "WARNING: Unknown property \"" << predicate << "\" ignored" << endl; -} + cerr << "WARNING: Unknown property (or bad type) \"" << predicate << "\"" << endl; +} // Requests // diff --git a/src/libs/gui/LoadSubpatchWindow.cpp b/src/libs/gui/LoadSubpatchWindow.cpp index f637409e..cd3745dd 100644 --- a/src/libs/gui/LoadSubpatchWindow.cpp +++ b/src/libs/gui/LoadSubpatchWindow.cpp @@ -91,7 +91,7 @@ LoadSubpatchWindow::set_patch(SharedPtr patch) _patch = patch; char temp_buf[4]; - snprintf(temp_buf, 4, "%zd", patch->poly()); + snprintf(temp_buf, 4, "%u", patch->poly()); Glib::ustring txt = "Same as parent ("; txt.append(temp_buf).append(")"); _poly_from_parent_radio->set_label(txt); diff --git a/src/libs/gui/ObjectMenu.cpp b/src/libs/gui/ObjectMenu.cpp index 8f7c3869..becbf964 100644 --- a/src/libs/gui/ObjectMenu.cpp +++ b/src/libs/gui/ObjectMenu.cpp @@ -78,7 +78,8 @@ void ObjectMenu::on_menu_polyphonic() { if (_enable_signal) - App::instance().engine()->set_polyphonic(_object->path(), _polyphonic_menuitem->get_active()); + App::instance().engine()->set_property( + _object->path(), "ingen:polyphonic", _polyphonic_menuitem->get_active()); } diff --git a/src/libs/gui/PatchView.cpp b/src/libs/gui/PatchView.cpp index 8b720db4..0ffe1191 100644 --- a/src/libs/gui/PatchView.cpp +++ b/src/libs/gui/PatchView.cpp @@ -161,7 +161,8 @@ PatchView::process_toggled() void PatchView::poly_changed() { - App::instance().engine()->set_polyphony(_patch->path(), _poly_spin->get_value_as_int()); + App::instance().engine()->set_property(_patch->path(), "ingen:polyphony", + _poly_spin->get_value_as_int()); } -- cgit v1.2.1