summaryrefslogtreecommitdiffstats
path: root/src/libs/gui
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-09-20 02:43:59 +0000
committerDavid Robillard <d@drobilla.net>2007-09-20 02:43:59 +0000
commit8e747504412c62f27c599f3f5e001ff3e2e36a82 (patch)
tree78c96ae09ae1c3c52ccdee28dbf0851651d3c3c9 /src/libs/gui
parented782b485becdaa2db064adaa00f1ffcd4880c26 (diff)
downloadingen-8e747504412c62f27c599f3f5e001ff3e2e36a82.tar.gz
ingen-8e747504412c62f27c599f3f5e001ff3e2e36a82.tar.bz2
ingen-8e747504412c62f27c599f3f5e001ff3e2e36a82.zip
Fix voice-specific polyphony controls.
Restore patch polyphony correctly on client reattach. Fix crash on multiple polyphony changes w/ LV2 plugins. git-svn-id: http://svn.drobilla.net/lad/ingen@737 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/gui')
-rw-r--r--src/libs/gui/ControlPanel.cpp24
-rw-r--r--src/libs/gui/ControlPanel.hpp2
-rw-r--r--src/libs/gui/NodeControlWindow.cpp1
-rw-r--r--src/libs/gui/NodeControlWindow.hpp4
-rw-r--r--src/libs/gui/ingen_gui.glade1
5 files changed, 23 insertions, 9 deletions
diff --git a/src/libs/gui/ControlPanel.cpp b/src/libs/gui/ControlPanel.cpp
index 5a4fbb95..be524814 100644
--- a/src/libs/gui/ControlPanel.cpp
+++ b/src/libs/gui/ControlPanel.cpp
@@ -39,9 +39,11 @@ ControlPanel::ControlPanel(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Gl
xml->get_widget("control_panel_specific_voice_radio", _specific_voice_radio);
xml->get_widget("control_panel_voice_spinbutton", _voice_spinbutton);
- _all_voices_radio->signal_toggled().connect(sigc::mem_fun(this, &ControlPanel::all_voices_selected));
- _specific_voice_radio->signal_toggled().connect(sigc::mem_fun(this, &ControlPanel::specific_voice_selected));
- _voice_spinbutton->signal_value_changed().connect(sigc::mem_fun(this, &ControlPanel::voice_selected));
+ _all_voices_radio->signal_toggled().connect(
+ sigc::mem_fun(this, &ControlPanel::all_voices_selected));
+
+ _specific_voice_radio->signal_toggled().connect(
+ sigc::mem_fun(this, &ControlPanel::specific_voice_selected));
show_all();
}
@@ -60,15 +62,23 @@ ControlPanel::init(SharedPtr<NodeModel> node, uint32_t poly)
assert(node != NULL);
assert(poly > 0);
- if (poly > 1) {
+ if (node->polyphonic()) {
_voice_spinbutton->set_range(0, poly - 1);
+ _voice_control_box->show();
} else {
- remove(*_voice_control_box);
+ //remove(*_voice_control_box);
+ _voice_control_box->hide();
}
for (PortModelList::const_iterator i = node->ports().begin(); i != node->ports().end(); ++i) {
add_port(*i);
}
+
+ if (node->parent())
+ ((PatchModel*)node->parent().get())->signal_polyphony.connect(
+ sigc::mem_fun(this, &ControlPanel::polyphony_changed));
+ else
+ cerr << "[ControlPanel] No parent, polyphonic controls disabled" << endl;
_callback_enabled = true;
}
@@ -254,8 +264,10 @@ ControlPanel::specific_voice_selected()
void
-ControlPanel::voice_selected()
+ControlPanel::polyphony_changed(uint32_t poly)
{
+ cerr << "POLY CHANGED" << endl;
+ _voice_spinbutton->set_range(0, poly - 1);
}
diff --git a/src/libs/gui/ControlPanel.hpp b/src/libs/gui/ControlPanel.hpp
index 1c206c52..bab865b2 100644
--- a/src/libs/gui/ControlPanel.hpp
+++ b/src/libs/gui/ControlPanel.hpp
@@ -73,7 +73,7 @@ public:
private:
void all_voices_selected();
void specific_voice_selected();
- void voice_selected();
+ void polyphony_changed(uint32_t poly);
bool _callback_enabled;
diff --git a/src/libs/gui/NodeControlWindow.cpp b/src/libs/gui/NodeControlWindow.cpp
index 482f2c3b..853a15bb 100644
--- a/src/libs/gui/NodeControlWindow.cpp
+++ b/src/libs/gui/NodeControlWindow.cpp
@@ -48,6 +48,7 @@ NodeControlWindow::NodeControlWindow(SharedPtr<NodeModel> node, uint32_t poly)
Glib::RefPtr<Gnome::Glade::Xml> xml = GladeFactory::new_glade_reference("warehouse_win");
xml->get_widget_derived("control_panel_vbox", _control_panel);
+
_control_panel->reparent(*this);
_control_panel->init(_node, poly);
diff --git a/src/libs/gui/NodeControlWindow.hpp b/src/libs/gui/NodeControlWindow.hpp
index a749fe86..84e462c5 100644
--- a/src/libs/gui/NodeControlWindow.hpp
+++ b/src/libs/gui/NodeControlWindow.hpp
@@ -61,8 +61,8 @@ protected:
private:
SharedPtr<NodeModel> _node;
- ControlPanel* _control_panel;
- bool _callback_enabled;
+ ControlPanel* _control_panel;
+ bool _callback_enabled;
bool _position_stored;
int _x;
diff --git a/src/libs/gui/ingen_gui.glade b/src/libs/gui/ingen_gui.glade
index 849f5f8a..8d1b157e 100644
--- a/src/libs/gui/ingen_gui.glade
+++ b/src/libs/gui/ingen_gui.glade
@@ -1210,6 +1210,7 @@
<property name="homogeneous">True</property>
<child>
<widget class="GtkRadioButton" id="control_panel_all_voices_radio">
+ <property name="visible">True</property>
<property name="can_focus">True</property>
<property name="tooltip" translatable="yes">Apply changed controls to all voices</property>
<property name="label" translatable="yes">All Voices</property>