summaryrefslogtreecommitdiff
path: root/gtk2_ardour/panner_ui.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-11-19 16:34:50 +0000
committerCarl Hetherington <carl@carlh.net>2010-11-19 16:34:50 +0000
commitb5fcd80ed6bb1dfd45d083f12a972ed88366ca58 (patch)
treefc20488416af941980b0a1d6732d6e9fcdcd72f4 /gtk2_ardour/panner_ui.cc
parent3aa8ff4a5e3f2c323bf35f3734a8d1e55be3c922 (diff)
Fix crash on updating route IOs, and clean up confusing method names slightly.
git-svn-id: svn://localhost/ardour2/branches/3.0@8058 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/panner_ui.cc')
-rw-r--r--gtk2_ardour/panner_ui.cc86
1 files changed, 40 insertions, 46 deletions
diff --git a/gtk2_ardour/panner_ui.cc b/gtk2_ardour/panner_ui.cc
index 263a8ec518..ea9b270bb5 100644
--- a/gtk2_ardour/panner_ui.cc
+++ b/gtk2_ardour/panner_ui.cc
@@ -150,13 +150,11 @@ PannerUI::set_panner (boost::shared_ptr<Panner> p)
return;
}
- _panner->Changed.connect (connections, invalidator (*this), boost::bind (&PannerUI::panner_changed, this), gui_context());
+ _panner->Changed.connect (connections, invalidator (*this), boost::bind (&PannerUI::panner_changed, this, this), gui_context());
_panner->LinkStateChanged.connect (connections, invalidator (*this), boost::bind (&PannerUI::update_pan_linkage, this), gui_context());
_panner->StateChanged.connect (connections, invalidator (*this), boost::bind (&PannerUI::update_pan_state, this), gui_context());
- setup_pan ();
-
- pan_changed (0);
+ panner_changed (0);
update_pan_sensitive ();
update_pan_linkage ();
pan_automation_state_changed ();
@@ -301,11 +299,47 @@ PannerUI::~PannerUI ()
void
-PannerUI::panner_changed ()
+PannerUI::panner_changed (void* src)
{
ENSURE_GUI_THREAD (*this, &PannerUI::panner_changed)
+
setup_pan ();
- pan_changed (0);
+
+ if (src == this) {
+ return;
+ }
+
+ switch (_panner->npanners()) {
+ case 0:
+ panning_link_direction_button.set_sensitive (false);
+ panning_link_button.set_sensitive (false);
+ return;
+ case 1:
+ panning_link_direction_button.set_sensitive (false);
+ panning_link_button.set_sensitive (false);
+ break;
+ default:
+ panning_link_direction_button.set_sensitive (_panner->linked ());
+ panning_link_button.set_sensitive (true);
+ }
+
+ uint32_t const nouts = _panner->nouts();
+
+ switch (nouts) {
+ case 0:
+ case 1:
+ /* relax */
+ break;
+
+ case 2:
+ /* bring pan bar state up to date */
+ update_pan_bars (false);
+ break;
+
+ default:
+ // panner->move_puck (pan_value (pans[0], pans[1]), 0.5);
+ break;
+ }
}
void
@@ -591,46 +625,6 @@ PannerUI::effective_pan_display ()
}
void
-PannerUI::pan_changed (void *src)
-{
- if (src == this) {
- return;
- }
-
- switch (_panner->npanners()) {
- case 0:
- panning_link_direction_button.set_sensitive (false);
- panning_link_button.set_sensitive (false);
- return;
- case 1:
- panning_link_direction_button.set_sensitive (false);
- panning_link_button.set_sensitive (false);
- break;
- default:
- panning_link_direction_button.set_sensitive (_panner->linked ());
- panning_link_button.set_sensitive (true);
- }
-
- uint32_t const nouts = _panner->nouts();
-
- switch (nouts) {
- case 0:
- case 1:
- /* relax */
- break;
-
- case 2:
- /* bring pan bar state up to date */
- update_pan_bars (false);
- break;
-
- default:
- // panner->move_puck (pan_value (pans[0], pans[1]), 0.5);
- break;
- }
-}
-
-void
PannerUI::pan_adjustment_changed (uint32_t which)
{
if (!in_pan_update && which < _panner->npanners()) {