Editor zooming: Initialize leftmost_frame, for sessions that start at high timecodes.
[ardour.git] / gtk2_ardour / editor.cc
index d84d92267ddee72720589bcdc9d1d72abaffc017..d525761140384c43e4fa42f62ba05cf14d06d60e 100644 (file)
@@ -1132,7 +1132,7 @@ Editor::deferred_control_scroll (framepos_t /*target*/)
 }
 
 void
-Editor::access_action (std::string action_group, std::string action_item)
+Editor::access_action (const std::string& action_group, const std::string& action_item)
 {
        if (!_session) {
                return;
@@ -1148,6 +1148,12 @@ Editor::access_action (std::string action_group, std::string action_item)
        }
 }
 
+void
+Editor::set_toggleaction (const std::string& action_group, const std::string& action_item, bool s)
+{
+       ActionManager::set_toggleaction_state (action_group.c_str(), action_item.c_str(), s);
+}
+
 void
 Editor::on_realize ()
 {
@@ -1313,6 +1319,10 @@ Editor::set_session (Session *t)
                return;
        }
 
+       //initialize leftmost_frame to the extents of the session
+       //this prevents a bogus setting of leftmost = "0" if the summary view asks for the leftmost frame before the visible state has been loaded from instant.xml
+       leftmost_frame = session_gui_extents().first;
+       
        _playlist_selector->set_session (_session);
        nudge_clock->set_session (_session);
        _summary->set_session (_session);
@@ -5552,15 +5562,15 @@ Editor::foreach_time_axis_view (sigc::slot<void,TimeAxisView&> theslot)
        }
 }
 
-/** Find a RouteTimeAxisView by the ID of its route */
-RouteTimeAxisView*
-Editor::get_route_view_by_route_id (const PBD::ID& id) const
+/** Find a StripableTimeAxisView by the ID of its stripable */
+StripableTimeAxisView*
+Editor::get_stripable_time_axis_by_id (const PBD::ID& id) const
 {
-       RouteTimeAxisView* v;
+       StripableTimeAxisView* v;
 
        for (TrackViewList::const_iterator i = track_views.begin(); i != track_views.end(); ++i) {
-               if((v = dynamic_cast<RouteTimeAxisView*>(*i)) != 0) {
-                       if(v->route()->id() == id) {
+               if((v = dynamic_cast<StripableTimeAxisView*>(*i)) != 0) {
+                       if(v->stripable()->id() == id) {
                                return v;
                        }
                }