summaryrefslogtreecommitdiff
path: root/gtk2_ardour/route_time_axis.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2006-12-14 16:21:43 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2006-12-14 16:21:43 +0000
commit0d6c5f78e9b7986afb220c559015da53a36e4e03 (patch)
tree59d81d0cee6884a7f6208af5012863e8da86ffe1 /gtk2_ardour/route_time_axis.cc
parentb7f645cbe633cf1235c5bc28df7f93254b3a15f0 (diff)
fix for crash when loading a session after running another, caused by not checking for _view != 0 in route_time_axis.cc; make fit_to_pixels() more useful and use it to truncate redirect and redirect parameters names in track control area
git-svn-id: svn://localhost/ardour2/trunk@1212 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/route_time_axis.cc')
-rw-r--r--gtk2_ardour/route_time_axis.cc34
1 files changed, 20 insertions, 14 deletions
diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc
index bacd9e23f4..b3a95711f1 100644
--- a/gtk2_ardour/route_time_axis.cc
+++ b/gtk2_ardour/route_time_axis.cc
@@ -186,11 +186,6 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session& sess, boost::sh
hide_button.unset_flags (Gtk::CAN_FOCUS);
visual_button.unset_flags (Gtk::CAN_FOCUS);
- /* map current state of the route */
-
- update_diskstream_display ();
- redirects_changed (0);
- reset_redirect_automation_curves ();
y_position = -1;
_route->redirects_changed.connect (mem_fun(*this, &RouteTimeAxisView::redirects_changed));
@@ -203,11 +198,6 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session& sess, boost::sh
track()->DiskstreamChanged.connect (mem_fun(*this, &RouteTimeAxisView::diskstream_changed));
get_diskstream()->SpeedChanged.connect (mem_fun(*this, &RouteTimeAxisView::speed_changed));
- /* ask for notifications of any new RegionViews */
- // FIXME: _view is NULL, but it would be nice to attach this here :/
- //_view->RegionViewAdded.connect (mem_fun(*this, &RouteTimeAxisView::region_view_added));
- //_view->attach ();
-
/* pick up the correct freeze state */
map_frozen ();
@@ -215,7 +205,6 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session& sess, boost::sh
editor.ZoomChanged.connect (mem_fun(*this, &RouteTimeAxisView::reset_samples_per_unit));
ColorChanged.connect (mem_fun (*this, &RouteTimeAxisView::color_handler));
-
}
RouteTimeAxisView::~RouteTimeAxisView ()
@@ -245,6 +234,17 @@ RouteTimeAxisView::~RouteTimeAxisView ()
}
void
+RouteTimeAxisView::post_construct ()
+{
+ /* map current state of the route */
+
+ update_diskstream_display ();
+ _route->foreach_redirect (this, &RouteTimeAxisView::add_redirect_to_subplugin_menu);
+ _route->foreach_redirect (this, &RouteTimeAxisView::add_existing_redirect_automation_curves);
+ reset_redirect_automation_curves ();
+}
+
+void
RouteTimeAxisView::set_playlist (boost::shared_ptr<Playlist> newplaylist)
{
boost::shared_ptr<Playlist> pl = playlist();
@@ -663,7 +663,9 @@ RouteTimeAxisView::set_height (TrackHeight h)
ensure_xml_node ();
- _view->set_height ((double) height);
+ if (_view) {
+ _view->set_height ((double) height);
+ }
switch (height_style) {
case Largest:
@@ -1032,7 +1034,9 @@ RouteTimeAxisView::set_selected_points (PointSelection& points)
void
RouteTimeAxisView::set_selected_regionviews (RegionSelection& regions)
{
- _view->set_selected_regionviews (regions);
+ if (_view) {
+ _view->set_selected_regionviews (regions);
+ }
}
void
@@ -1549,7 +1553,9 @@ RouteTimeAxisView::add_redirect_automation_curve (boost::shared_ptr<Redirect> re
add_child (ran->view);
- _view->foreach_regionview (bind (mem_fun(*this, &RouteTimeAxisView::add_ghost_to_redirect), ran->view));
+ if (_view) {
+ _view->foreach_regionview (bind (mem_fun(*this, &RouteTimeAxisView::add_ghost_to_redirect), ran->view));
+ }
redirect->mark_automation_visible (what, true);
}