summaryrefslogtreecommitdiff
path: root/gtk2_ardour/audio_time_axis.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-07-04 00:39:00 +0000
committerDavid Robillard <d@drobilla.net>2007-07-04 00:39:00 +0000
commit2177f008411821e7bce9ca3c306ec64c70b1c58e (patch)
tree79b2f1827163aa40fdde34c5f9b89f7bd1eb3d49 /gtk2_ardour/audio_time_axis.cc
parente0f287045eff5b6f0581b741a3005f54d6578737 (diff)
Add AutomationControl::parameter() for terseness.
Future-proof automation track GUI 'extra' XML (<GUI><AutomationChild automation-id="gain"> instead of <GUI><gain> so Parameter.to_string isn't used as an XML node name). Fix automation track controller bar shown/hidden state. Fix automation track initial show bug. git-svn-id: svn://localhost/ardour2/trunk@2103 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/audio_time_axis.cc')
-rw-r--r--gtk2_ardour/audio_time_axis.cc43
1 files changed, 10 insertions, 33 deletions
diff --git a/gtk2_ardour/audio_time_axis.cc b/gtk2_ardour/audio_time_axis.cc
index 0b20c007ef..73500f3ea1 100644
--- a/gtk2_ardour/audio_time_axis.cc
+++ b/gtk2_ardour/audio_time_axis.cc
@@ -85,8 +85,7 @@ AudioTimeAxisView::AudioTimeAxisView (PublicEditor& ed, Session& sess, boost::sh
_view = new AudioStreamView (*this);
- create_automation_child (GainAutomation);
- create_automation_child (PanAutomation);
+ create_automation_child (GainAutomation, false);
ignore_toggle = false;
@@ -107,7 +106,7 @@ AudioTimeAxisView::AudioTimeAxisView (PublicEditor& ed, Session& sess, boost::sh
set_state (*xml_node);
- _route->panner().Changed.connect (mem_fun(*this, &AudioTimeAxisView::update_pans));
+ _route->panner().Changed.connect (bind (mem_fun(*this, &AudioTimeAxisView::update_pans), false));
update_control_names ();
@@ -279,7 +278,7 @@ AudioTimeAxisView::set_waveform_scale (WaveformScale scale)
}
void
-AudioTimeAxisView::create_automation_child (Parameter param)
+AudioTimeAxisView::create_automation_child (Parameter param, bool show)
{
if (param.type() == GainAutomation) {
@@ -294,15 +293,14 @@ AudioTimeAxisView::create_automation_child (Parameter param)
editor,
*this,
parent_canvas,
- _route->describe_parameter(param),
- c->list()->parameter().to_string() /* FIXME: correct state name? */));
+ _route->describe_parameter(param)));
- add_automation_child(Parameter(GainAutomation), gain_track);
+ add_automation_child(Parameter(GainAutomation), gain_track, show);
} else if (param.type() == PanAutomation) {
ensure_xml_node ();
- update_pans ();
+ update_pans (show);
} else {
error << "AudioTimeAxisView: unknown automation child " << param.to_string() << endmsg;
@@ -310,35 +308,15 @@ AudioTimeAxisView::create_automation_child (Parameter param)
}
void
-AudioTimeAxisView::update_pans ()
+AudioTimeAxisView::update_pans (bool show)
{
Panner::iterator p;
- /* This is a filthy kludge until the panner stuff gets up to speed. */
-
- /* Remove all our old automation tracks. Slowly. */
- /*while (true) {
- bool found = false;
- for (AutomationTracks::iterator i = _automation_tracks.begin(); i != _automation_tracks.end(); ++i) {
- if (i->first.type() == PanAutomation) {
- remove_child(i->second->track);
- delete i->second;
- _automation_tracks.erase(i);
- found = true;
- break;
- }
- }
-
- if ( ! found)
- break;
- }*/
-
- /* Man I hate that damn stereo->stereo panner */
uint32_t i = 0;
for (p = _route->panner().begin(); p != _route->panner().end(); ++p) {
boost::shared_ptr<AutomationControl> pan_control = (*p)->pan_control();
- if (pan_control->list()->parameter().type() == NullAutomation) {
+ if (pan_control->parameter().type() == NullAutomation) {
error << "Pan control has NULL automation type!" << endmsg;
continue;
}
@@ -348,9 +326,8 @@ AudioTimeAxisView::update_pans ()
editor,
*this,
parent_canvas,
- _route->describe_parameter(pan_control->list()->parameter()),
- pan_control->list()->parameter().to_string()/* FIXME: correct state name? */));
- add_automation_child(Parameter(PanAutomation, i), pan_track);
+ _route->describe_parameter(pan_control->parameter())));
+ add_automation_child(Parameter(PanAutomation, i), pan_track, show);
++i;
}
}