summaryrefslogtreecommitdiffstats
path: root/src/progs
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2006-10-15 20:46:26 +0000
committerDavid Robillard <d@drobilla.net>2006-10-15 20:46:26 +0000
commit4174fb8f94139e0a38da150ffb0874b636497dfe (patch)
tree7170dd4b13ee0fe42c67aeabeef3f95437f146b2 /src/progs
parent14542a4634cb211be5bdf590574ae3b8e1715486 (diff)
downloadingen-4174fb8f94139e0a38da150ffb0874b636497dfe.tar.gz
ingen-4174fb8f94139e0a38da150ffb0874b636497dfe.tar.bz2
ingen-4174fb8f94139e0a38da150ffb0874b636497dfe.zip
Fixed feedback problems (CPU chewing) with port controls.
git-svn-id: http://svn.drobilla.net/lad/ingen@176 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/progs')
-rw-r--r--src/progs/ingenuity/ControlGroups.cpp77
-rw-r--r--src/progs/ingenuity/ControlGroups.h7
-rw-r--r--src/progs/ingenuity/ControlPanel.cpp4
-rw-r--r--src/progs/ingenuity/ingenuity.glade10
4 files changed, 26 insertions, 72 deletions
diff --git a/src/progs/ingenuity/ControlGroups.cpp b/src/progs/ingenuity/ControlGroups.cpp
index 6862c499..e228c140 100644
--- a/src/progs/ingenuity/ControlGroups.cpp
+++ b/src/progs/ingenuity/ControlGroups.cpp
@@ -35,7 +35,8 @@ ControlGroup::ControlGroup(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Gl
: Gtk::VBox(cobject),
m_control_panel(NULL),
m_has_separator(false),
- m_separator(NULL)
+ m_separator(NULL),
+ m_enable_signal(false)
{
}
@@ -61,23 +62,12 @@ ControlGroup::init(ControlPanel* panel, SharedPtr<PortModel> pm, bool separator)
}
-void
-ControlGroup::metadata_update(const string& key, const Atom& value)
-{
- if ( (key == "min") && value.type() == Atom::FLOAT)
- set_min(value.get_float());
- else if ( (key == "max") && value.type() == Atom::FLOAT)
- set_max(value.get_float());
-}
-
-
// ////////////////// SliderControlGroup ////////////////////// //
SliderControlGroup::SliderControlGroup(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& xml)
: ControlGroup(cobject, xml),
- m_enabled(true),
- m_enable_signal(false)
+ m_enabled(true)
{
xml->get_widget("control_strip_name_label", m_name_label);
xml->get_widget("control_strip_min_spinner", m_min_spinner);
@@ -88,15 +78,6 @@ SliderControlGroup::SliderControlGroup(BaseObjectType* cobject, const Glib::RefP
void
SliderControlGroup::init(ControlPanel* panel, SharedPtr<PortModel> pm, bool separator)
-/*: ControlGroup(panel, pm, separator),
- m_enabled(true),
- m_enable_signal(false),
- m_name_label(pm->path().name(), 0.0, 0.0),
- m_min_spinner(1.0, (pm->is_integer() ? 0 : 2)), // climb rate, digits
- m_max_spinner(1.0, (pm->is_integer() ? 0 : 2)),
- m_box(false, 0),
- m_value_spinner(1.0, (pm->is_integer() ? 0 : 2)),
- m_slider(0, 1, (pm->is_integer() ? 1.0 : 0.0001))*/
{
ControlGroup::init(panel, pm, separator);
@@ -105,8 +86,6 @@ SliderControlGroup::init(ControlPanel* panel, SharedPtr<PortModel> pm, bool sepa
assert(m_max_spinner);
assert(m_slider);
- //m_slider->set_increments(1.0, 10.0);
- //m_slider->set_value_pos(Gtk::POS_RIGHT);
m_slider->set_draw_value(true);
float min = 0.0f;
@@ -124,25 +103,9 @@ SliderControlGroup::init(ControlPanel* panel, SharedPtr<PortModel> pm, bool sepa
set_name(pm->path().name());
- //m_name_label->property_use_markup() = true;
-
-/*
- m_value_spinner.set_range(-99999, 99999);
- m_value_spinner.set_update_policy(Gtk::UPDATE_ALWAYS); // allow entered values outside range
- m_value_spinner.set_value(m_port_model->value());
- m_value_spinner.set_increments(1.0, 10.0);
- m_value_spinner.set_digits(2);
- m_value_spinner.signal_value_changed().connect(
- sigc::mem_fun(*this, &SliderControlGroup::update_value_from_spinner));*/
- //m_min_spinner->set_range(-99999, 99999);
m_min_spinner->set_value(min);
- //m_min_spinner->set_increments(1.0, 10.0);
- //m_min_spinner->set_digits(2);
m_min_spinner->signal_value_changed().connect(sigc::mem_fun(*this, &SliderControlGroup::min_changed));
- //m_max_spinner->set_range(-99999, 99999);
m_max_spinner->set_value(max);
- //m_max_spinner->set_increments(1.0, 10.0);
- //m_max_spinner->set_digits(2);
m_max_spinner->signal_value_changed().connect(sigc::mem_fun(*this, &SliderControlGroup::max_changed));
m_slider->set_value(m_port_model->value());
@@ -152,15 +115,7 @@ SliderControlGroup::init(ControlPanel* panel, SharedPtr<PortModel> pm, bool sepa
m_slider->signal_value_changed().connect(
sigc::mem_fun(*this, &SliderControlGroup::update_value_from_slider));
-#if 0
- m_box.pack_start(m_name_label, false, false, 6);
- //m_box.pack_start(m_value_spinner, true, true, 1);
- m_box.pack_start(m_min_spinner, false, false, 1);
- m_box.pack_start(m_slider, true, true, 2);
- m_box.pack_start(m_max_spinner, false, false, 1);
- pack_start(m_box);
-#endif
m_slider->set_range(min, max);
m_enable_signal = true;
@@ -170,29 +125,25 @@ SliderControlGroup::init(ControlPanel* panel, SharedPtr<PortModel> pm, bool sepa
void
-SliderControlGroup::set_name(const string& name)
-{
- string name_label = "<span weight=\"bold\">";
- name_label += name + "</span>";
- m_name_label->set_markup(name_label);
-}
-
-
-void
-SliderControlGroup::set_min(float val)
+SliderControlGroup::metadata_update(const string& key, const Atom& value)
{
m_enable_signal = false;
- m_min_spinner->set_value(val);
+
+ if ( (key == "min") && value.type() == Atom::FLOAT)
+ m_min_spinner->set_value(value.get_float());
+ else if ( (key == "max") && value.type() == Atom::FLOAT)
+ m_max_spinner->set_value(value.get_float());
+
m_enable_signal = true;
}
void
-SliderControlGroup::set_max(float val)
+SliderControlGroup::set_name(const string& name)
{
- m_enable_signal = false;
- m_max_spinner->set_value(val);
- m_enable_signal = true;
+ string name_label = "<span weight=\"bold\">";
+ name_label += name + "</span>";
+ m_name_label->set_markup(name_label);
}
diff --git a/src/progs/ingenuity/ControlGroups.h b/src/progs/ingenuity/ControlGroups.h
index 85542dbe..4994a809 100644
--- a/src/progs/ingenuity/ControlGroups.h
+++ b/src/progs/ingenuity/ControlGroups.h
@@ -54,14 +54,13 @@ public:
protected:
virtual void set_value(float value) = 0;
- virtual void set_min(float min) = 0;
- virtual void set_max(float max) = 0;
- virtual void metadata_update(const string& key, const Atom& value);
+ virtual void metadata_update(const string& key, const Atom& value) = 0;
ControlPanel* m_control_panel;
SharedPtr<PortModel> m_port_model;
bool m_has_separator;
Gtk::VSeparator* m_separator;
+ bool m_enable_signal;
};
@@ -80,6 +79,7 @@ public:
private:
void set_name(const string& name);
+ virtual void metadata_update(const string& key, const Atom& value);
inline void set_value(const float val);
void set_min(float val);
@@ -96,7 +96,6 @@ private:
bool slider_pressed(GdkEvent* ev);
bool m_enabled;
- bool m_enable_signal;
Gtk::Label* m_name_label;
Gtk::SpinButton* m_min_spinner;
diff --git a/src/progs/ingenuity/ControlPanel.cpp b/src/progs/ingenuity/ControlPanel.cpp
index eb316860..faffae7a 100644
--- a/src/progs/ingenuity/ControlPanel.cpp
+++ b/src/progs/ingenuity/ControlPanel.cpp
@@ -214,12 +214,16 @@ void
ControlPanel::value_changed(const Path& port_path, float val)
{
if (m_callback_enabled) {
+ App::instance().engine()->disable_responses();
+
if (m_all_voices_radio->get_active()) {
App::instance().engine()->set_port_value(port_path, val);
} else {
int voice = m_voice_spinbutton->get_value_as_int();
App::instance().engine()->set_port_value(port_path, voice, val);
}
+
+ App::instance().engine()->set_next_response_id(rand()); // FIXME: inefficient, probably not good
}
}
diff --git a/src/progs/ingenuity/ingenuity.glade b/src/progs/ingenuity/ingenuity.glade
index 7ffe43bd..edfb60dd 100644
--- a/src/progs/ingenuity/ingenuity.glade
+++ b/src/progs/ingenuity/ingenuity.glade
@@ -2179,7 +2179,7 @@
<property name="label" translatable="yes">&lt;b&gt;Name&lt;/b&gt;</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">1</property>
@@ -2188,11 +2188,11 @@
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
+ <property name="single_line_mode">True</property>
<property name="angle">90</property>
</widget>
<packing>
- <property name="padding">2</property>
+ <property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
@@ -2203,11 +2203,11 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="draw_value">True</property>
- <property name="value_pos">GTK_POS_BOTTOM</property>
+ <property name="value_pos">GTK_POS_RIGHT</property>
<property name="digits">2</property>
<property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
<property name="inverted">True</property>
- <property name="adjustment">0.7 0 1 0 0 0</property>
+ <property name="adjustment">0.8 0 1 0 0 0</property>
</widget>
<packing>
<property name="padding">0</property>