summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2007-04-20 13:41:15 +0000
committerCarl Hetherington <carl@carlh.net>2007-04-20 13:41:15 +0000
commit003c9d6f5e4d5fdc3b95ab516b06e2f89efabdbd (patch)
tree50ee335d80d5fd173472e8b01d89af97801f73b8
parentc46cb59f8d4b25b7199c52f0613ddc5b4186b93f (diff)
Fix mantis bug #1619; de-selecting Options->Crossfades->Show now hides all crossfades, and likewise selecting it shows all crossfades.
git-svn-id: svn://localhost/ardour2/trunk@1733 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--gtk2_ardour/actions.cc13
-rw-r--r--gtk2_ardour/editor.h1
-rw-r--r--gtk2_ardour/editor_actions.cc6
-rw-r--r--gtk2_ardour/editor_ops.cc18
4 files changed, 37 insertions, 1 deletions
diff --git a/gtk2_ardour/actions.cc b/gtk2_ardour/actions.cc
index 6e4a525ba7..40af880f9c 100644
--- a/gtk2_ardour/actions.cc
+++ b/gtk2_ardour/actions.cc
@@ -256,6 +256,13 @@ ActionManager::uncheck_toggleaction (const char * name)
delete [] group_name;
}
+/** Examine the state of a Configuration setting and a toggle action, and toggle the Configuration
+ * setting if its state doesn't match the toggle action.
+ * @param group Action group.
+ * @param action Action name.
+ * @param Method to set the state of the Configuration setting.
+ * @param Method to get the state of the Configuration setting.
+ */
void
ActionManager::toggle_config_state (const char* group, const char* action, bool (Configuration::*set)(bool), bool (Configuration::*get)(void) const)
{
@@ -285,6 +292,12 @@ ActionManager::toggle_config_state (const char* group, const char* action, sigc:
}
}
+
+/** Set the state of a ToggleAction using a particular Configuration get() method
+ * @param group Action group.
+ * @param action Action name.
+ * @param get Method to obtain the state that the ToggleAction should have.
+ */
void
ActionManager::map_some_state (const char* group, const char* action, bool (Configuration::*get)() const)
{
diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h
index 10880c7b1b..ae7201dbbd 100644
--- a/gtk2_ardour/editor.h
+++ b/gtk2_ardour/editor.h
@@ -305,6 +305,7 @@ class Editor : public PublicEditor
void toggle_xfades_active ();
void toggle_xfade_visibility ();
bool xfade_visibility() const { return _xfade_visibility; }
+ void update_xfade_visibility ();
void update_crossfade_model ();
void set_crossfade_model (ARDOUR::CrossfadeModel);
diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc
index 4ce9be20bd..3525910250 100644
--- a/gtk2_ardour/editor_actions.cc
+++ b/gtk2_ardour/editor_actions.cc
@@ -1065,9 +1065,12 @@ Editor::toggle_xfades_active ()
void
Editor::toggle_xfade_visibility ()
{
- ActionManager::toggle_config_state ("Editor", "toggle-xfades-visibility", &Configuration::set_xfades_visible, &Configuration::get_xfades_visible);
+ ActionManager::toggle_config_state ("Editor", "toggle-xfades-visible", &Configuration::set_xfades_visible, &Configuration::get_xfades_visible);
}
+/** A Configuration parameter has changed.
+ * @param parameter_name Name of the changed parameter.
+ */
void
Editor::parameter_changed (const char* parameter_name)
{
@@ -1092,6 +1095,7 @@ Editor::parameter_changed (const char* parameter_name)
ActionManager::map_some_state ("Editor", "toggle-xfades-active", &Configuration::get_xfades_active);
} else if (PARAM_IS ("xfades-visible")) {
ActionManager::map_some_state ("Editor", "toggle-xfades-visible", &Configuration::get_xfades_visible);
+ update_xfade_visibility ();
} else if (PARAM_IS ("auto-xfade")) {
ActionManager::map_some_state ("Editor", "toggle-auto-xfades", &Configuration::get_auto_xfade);
} else if (PARAM_IS ("xfade-model")) {
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc
index 9c972d1fa7..2267c150bf 100644
--- a/gtk2_ardour/editor_ops.cc
+++ b/gtk2_ardour/editor_ops.cc
@@ -3542,3 +3542,21 @@ Editor::set_fade_out_active (bool yn)
}
}
+
+/** Update crossfade visibility after its configuration has been changed */
+void
+Editor::update_xfade_visibility ()
+{
+ _xfade_visibility = Config->get_xfades_visible ();
+
+ for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
+ AudioTimeAxisView* v = dynamic_cast<AudioTimeAxisView*>(*i);
+ if (v) {
+ if (_xfade_visibility) {
+ v->show_all_xfades ();
+ } else {
+ v->hide_all_xfades ();
+ }
+ }
+ }
+}