summaryrefslogtreecommitdiff
path: root/gtk2_ardour/audio_time_axis.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-06-30 18:41:50 +0000
committerDavid Robillard <d@drobilla.net>2007-06-30 18:41:50 +0000
commitbbf41757133a29df0d37905f2fdce091878d2ffd (patch)
tree2506ed83985d406019236c68704df0b9542dbe3a /gtk2_ardour/audio_time_axis.cc
parent685fa95e729e5d510b28b4c715da062e9db580d9 (diff)
Another not-quite-there-but-better commit.
Brought plugin automation into the fold of new automation system. Fixed plugin automation, broke panner automation :] (pending Panner work). Made AutomationController better at automatically following it's controller value (mimic what gain meter does). Fixed some visible automation track bugs (but still broken WRT serialization). git-svn-id: svn://localhost/ardour2/trunk@2092 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/audio_time_axis.cc')
-rw-r--r--gtk2_ardour/audio_time_axis.cc85
1 files changed, 28 insertions, 57 deletions
diff --git a/gtk2_ardour/audio_time_axis.cc b/gtk2_ardour/audio_time_axis.cc
index 284d96b217..53c1a84848 100644
--- a/gtk2_ardour/audio_time_axis.cc
+++ b/gtk2_ardour/audio_time_axis.cc
@@ -49,14 +49,12 @@
#include "ardour_ui.h"
#include "audio_time_axis.h"
-#include "automation_gain_line.h"
-#include "automation_pan_line.h"
+#include "automation_line.h"
#include "canvas_impl.h"
#include "crossfade_view.h"
#include "enums.h"
-#include "gain_automation_time_axis.h"
+#include "automation_time_axis.h"
#include "keyboard.h"
-#include "pan_automation_time_axis.h"
#include "playlist_selector.h"
#include "prompter.h"
#include "public_editor.h"
@@ -291,38 +289,19 @@ AudioTimeAxisView::create_automation_child (ParamID param)
return;
}
- GainAutomationTimeAxisView* gain_track = new GainAutomationTimeAxisView (_session,
- _route,
+ boost::shared_ptr<AutomationTimeAxisView> gain_track(new AutomationTimeAxisView (_session,
+ _route, _route, c,
editor,
*this,
parent_canvas,
_route->describe_parameter(param),
- c);
-
- AutomationLine* line = new AutomationGainLine ("automation gain",
- *gain_track,
- *gain_track->canvas_display,
- c->list());
-
- line->set_line_color (ARDOUR_UI::config()->canvasvar_AutomationLine.get());
-
- gain_track->add_line (*line);
+ c->list()->param_id().to_string() /* FIXME: correct state name? */));
add_automation_child(ParamID(GainAutomation), gain_track);
} else if (param.type() == PanAutomation) {
-
- PanAutomationTimeAxisView* pan_track = new PanAutomationTimeAxisView (_session,
- _route,
- editor,
- *this,
- parent_canvas,
- _route->describe_parameter(param));
ensure_xml_node ();
-
- add_automation_child(ParamID(PanAutomation), pan_track);
-
update_pans ();
} else {
@@ -334,41 +313,33 @@ void
AudioTimeAxisView::update_pans ()
{
Panner::iterator p;
-
- RouteAutomationNode* ran = automation_track(PanAutomation);
- if (!ran) {
- warning << _route << " has no pan automation track" << endmsg;
- return;
- }
- AutomationTimeAxisView* pan_track = ran->track;
-
- pan_track->clear_lines ();
-
- /* we don't draw lines for "greater than stereo" panning.
- */
+ /* 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) {
+ _automation_tracks.erase(i);
+ found = true;
+ break;
+ }
+ }
- if (_route->n_outputs().n_audio() > 2) {
- return;
+ if ( ! found)
+ break;
}
-
+
+ /* Man I hate that damn stereo->stereo panner */
for (p = _route->panner().begin(); p != _route->panner().end(); ++p) {
-
- AutomationLine* line;
-
- line = new AutomationPanLine ("automation pan", *pan_track,
- *pan_track->canvas_display,
- (*p)->automation());
-
- if (p == _route->panner().begin()) {
- /* first line is a nice orange */
- line->set_line_color (ARDOUR_UI::config()->canvasvar_AutomationLine.get());
- } else {
- /* second line is a nice blue */
- line->set_line_color (ARDOUR_UI::config()->canvasvar_AutomationLine.get());
- }
-
- pan_track->add_line (*line);
+ boost::shared_ptr<AutomationTimeAxisView> pan_track(new AutomationTimeAxisView (_session,
+ _route, _route/*FIXME*/, (*p)->pan_control(),
+ editor,
+ *this,
+ parent_canvas,
+ _route->describe_parameter((*p)->pan_control()->list()->param_id()),
+ (*p)->pan_control()->list()->param_id().to_string() /* FIXME: correct state name? */));
}
}