summaryrefslogtreecommitdiffstats
path: root/src/progs
diff options
context:
space:
mode:
Diffstat (limited to 'src/progs')
-rw-r--r--src/progs/ingenuity/ControlGroups.cpp14
-rw-r--r--src/progs/ingenuity/ControlGroups.h7
-rw-r--r--src/progs/ingenuity/ControlPanel.cpp11
-rw-r--r--src/progs/ingenuity/ControlPanel.h6
-rw-r--r--src/progs/ingenuity/Makefile.am4
-rw-r--r--src/progs/ingenuity/main.cpp3
6 files changed, 25 insertions, 20 deletions
diff --git a/src/progs/ingenuity/ControlGroups.cpp b/src/progs/ingenuity/ControlGroups.cpp
index e228c140..bbd83ee8 100644
--- a/src/progs/ingenuity/ControlGroups.cpp
+++ b/src/progs/ingenuity/ControlGroups.cpp
@@ -118,6 +118,8 @@ SliderControlGroup::init(ControlPanel* panel, SharedPtr<PortModel> pm, bool sepa
m_slider->set_range(min, max);
+ set_value(pm->value());
+
m_enable_signal = true;
show_all();
@@ -218,9 +220,9 @@ SliderControlGroup::update_value_from_slider()
const float value = m_slider->get_value();
// Prevent spinner signal from doing all this over again (slow)
m_enable_signal = false;
- //m_value_spinner.set_value(value);
- m_control_panel->value_changed(m_port_model->path(), value);
- //m_port_model->value(value);
+
+ m_control_panel->value_changed(m_port_model, value);
+
m_enable_signal = true;
}
}
@@ -245,7 +247,7 @@ SliderControlGroup::update_value_from_spinner()
m_slider->set_value(m_value_spinner.get_value());
- m_control_panel->value_changed(m_port_model->path(), value);
+ m_control_panel->value_changed(m_port_model, value);
//m_port_model->value(value);
m_enable_signal = true;
@@ -342,7 +344,7 @@ IntegerControlGroup::update_value()
{
if (m_enable_signal) {
float value = m_spinner.get_value();
- m_control_panel->value_changed(m_port_model->path(), value);
+ m_control_panel->value_changed(m_port_model, value);
//m_port_model->value(value);
}
}
@@ -413,7 +415,7 @@ ToggleControlGroup::update_value()
{
if (m_enable_signal) {
float value = m_checkbutton.get_active() ? 1.0f : 0.0f;
- m_control_panel->value_changed(m_port_model->path(), value);
+ m_control_panel->value_changed(m_port_model, value);
//m_port_model->value(value);
}
}
diff --git a/src/progs/ingenuity/ControlGroups.h b/src/progs/ingenuity/ControlGroups.h
index 4994a809..fa43b77e 100644
--- a/src/progs/ingenuity/ControlGroups.h
+++ b/src/progs/ingenuity/ControlGroups.h
@@ -109,10 +109,11 @@ inline void
SliderControlGroup::set_value(const float val)
{
m_enable_signal = false;
- if (m_enabled) {
- m_slider->set_value(val);
+ //if (m_enabled) {
+ if (m_slider->get_value() != val)
+ m_slider->set_value(val);
//m_value_spinner->set_value(val);
- }
+ //}
m_enable_signal = true;
}
diff --git a/src/progs/ingenuity/ControlPanel.cpp b/src/progs/ingenuity/ControlPanel.cpp
index faffae7a..4a96b480 100644
--- a/src/progs/ingenuity/ControlPanel.cpp
+++ b/src/progs/ingenuity/ControlPanel.cpp
@@ -211,16 +211,21 @@ ControlPanel::disable_port(const Path& path)
/** Callback for ControlGroups to notify this of a change.
*/
void
-ControlPanel::value_changed(const Path& port_path, float val)
+ControlPanel::value_changed(SharedPtr<PortModel> port, float val)
{
if (m_callback_enabled) {
App::instance().engine()->disable_responses();
+ /* Send the message, but set the client-side model's value to the new
+ * setting right away (so the value doesn't need to be echoed back) */
+
if (m_all_voices_radio->get_active()) {
- App::instance().engine()->set_port_value(port_path, val);
+ App::instance().engine()->set_port_value(port->path(), val);
+ port->value(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_port_value(port->path(), voice, val);
+ port->value(val);
}
App::instance().engine()->set_next_response_id(rand()); // FIXME: inefficient, probably not good
diff --git a/src/progs/ingenuity/ControlPanel.h b/src/progs/ingenuity/ControlPanel.h
index 8d91df8d..f7a1cc5b 100644
--- a/src/progs/ingenuity/ControlPanel.h
+++ b/src/progs/ingenuity/ControlPanel.h
@@ -64,9 +64,9 @@ public:
size_t num_controls() const { return m_controls.size(); }
pair<int,int> ideal_size() const { return m_ideal_size; }
- // Callback for ControlGroup (FIXME: ugly)
- void value_changed(const Path& port_path, float val);
-
+ // Callback for ControlGroup
+ void value_changed(SharedPtr<PortModel> port_path, float val);
+
private:
void all_voices_selected();
void specific_voice_selected();
diff --git a/src/progs/ingenuity/Makefile.am b/src/progs/ingenuity/Makefile.am
index 898a8b83..33829b9b 100644
--- a/src/progs/ingenuity/Makefile.am
+++ b/src/progs/ingenuity/Makefile.am
@@ -12,8 +12,8 @@ dist_desktopfiles_DATA = ingenuity.desktop
globalpixmapsdir = $(datadir)/pixmaps
dist_globalpixmaps_DATA = ingen-icon.svg
-ingenuity_CXXFLAGS = -DGTK_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -I$(top_srcdir)/src/common -I$(top_srcdir)/src/libs/client -DPKGDATADIR=\"$(pkgdatadir)\" @GTKMM_CFLAGS@ @LIBGLADEMM_CFLAGS@ @GNOMECANVASMM_CFLAGS@ @LOSC_CFLAGS@ @LASH_CFLAGS@ @FLOWCANVAS_CFLAGS@ @RAUL_CFLAGS@
-ingenuity_LDADD = @GTKMM_LIBS@ @LIBGLADEMM_LIBS@ @GNOMECANVASMM_LIBS@ @LOSC_LIBS@ @LASH_LIBS@ @FLOWCANVAS_LIBS@ @RAUL_LIBS@ ../../libs/client/libingenclient.la
+ingenuity_CXXFLAGS = -DGTK_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -I$(top_srcdir)/src/common -I$(top_srcdir)/src/libs/client -DPKGDATADIR=\"$(pkgdatadir)\" @RAUL_CFLAGS@ @GTKMM_CFLAGS@ @LIBGLADEMM_CFLAGS@ @GNOMECANVASMM_CFLAGS@ @LOSC_CFLAGS@ @LASH_CFLAGS@ @FLOWCANVAS_CFLAGS@
+ingenuity_LDADD = @RAUL_LIBS@ @GTKMM_LIBS@ @LIBGLADEMM_LIBS@ @GNOMECANVASMM_LIBS@ @LOSC_LIBS@ @LASH_LIBS@ @FLOWCANVAS_LIBS@ ../../libs/client/libingenclient.la
ingenuity_DEPENDENCIES = ../../libs/client/libingenclient.la
# FIXME: make engine have a separate include dir
diff --git a/src/progs/ingenuity/main.cpp b/src/progs/ingenuity/main.cpp
index d200c3d6..2456ff66 100644
--- a/src/progs/ingenuity/main.cpp
+++ b/src/progs/ingenuity/main.cpp
@@ -42,9 +42,6 @@ main(int argc, char** argv)
if (args_info.client_port_given)
client_port = args_info.client_port_arg;
- // FIXME:
- client_port = 16181;
-
Gnome::Canvas::init();
Gtk::Main gtk_main(argc, argv);