when clearing route solo state, do the required update
[ardour.git] / gtk2_ardour / editor.cc
index ccb839ccc18a7cc8ef3555d52562454b73d7d4c0..806ec3cd1c1d41508affce5ca62f1a88e555ad02 100644 (file)
@@ -1407,6 +1407,25 @@ Editor::set_session (Session *t)
                break;
        }
 
+       /* catch up on selection of stripables (other selection state is lost
+        * when a session is closed
+        */
+
+       StripableList sl;
+       TrackViewList tl;
+       _session->get_stripables (sl);
+       for (StripableList::const_iterator s = sl.begin(); s != sl.end(); ++s) {
+               if ((*s)->presentation_info().selected()) {
+                       RouteTimeAxisView* rtav = get_route_view_by_route_id ((*s)->id());
+                       if (rtav) {
+                               tl.push_back (rtav);
+                       }
+               }
+       }
+       if (!tl.empty()) {
+               selection->set (tl);
+       }
+
        /* register for undo history */
        _session->register_with_memento_command_factory(id(), this);
        _session->register_with_memento_command_factory(_selection_memento->id(), _selection_memento);
@@ -2220,10 +2239,8 @@ Editor::set_snap_to (SnapType st)
        case SnapToBeatDiv4:
        case SnapToBeatDiv3:
        case SnapToBeatDiv2: {
-               std::vector<TempoMap::BBTPoint> grid;
-               compute_current_bbt_points (grid, leftmost_frame, leftmost_frame + current_page_samples());
-               compute_bbt_ruler_scale (grid, leftmost_frame, leftmost_frame + current_page_samples());
-               update_tempo_based_rulers (grid);
+               compute_bbt_ruler_scale (leftmost_frame, leftmost_frame + current_page_samples());
+               update_tempo_based_rulers ();
                break;
        }
 
@@ -4038,7 +4055,7 @@ Editor::get_grid_beat_divisions(framepos_t position)
     if the grid is snapped to bars, returns -1.
     @param event_state the current keyboard modifier mask.
 */
-unsigned
+int32_t
 Editor::get_grid_music_divisions (uint32_t event_state)
 {
        if (snap_mode() == Editing::SnapOff && !ArdourKeyboard::indicates_snap (event_state)) {
@@ -4595,10 +4612,8 @@ Editor::visual_changer (const VisualChange& vc)
 
                compute_fixed_ruler_scale ();
 
-               std::vector<TempoMap::BBTPoint> grid;
-               compute_current_bbt_points (grid, vc.time_origin, pending_visual_change.time_origin + current_page_samples());
-               compute_bbt_ruler_scale (grid, vc.time_origin, pending_visual_change.time_origin + current_page_samples());
-               update_tempo_based_rulers (grid);
+               compute_bbt_ruler_scale (vc.time_origin, pending_visual_change.time_origin + current_page_samples());
+               update_tempo_based_rulers ();
 
                update_video_timeline();
        }
@@ -5149,7 +5164,7 @@ Editor::region_view_added (RegionView * rv)
 
        MidiRegionView* mrv = dynamic_cast<MidiRegionView*> (rv);
        if (mrv) {
-               list<pair<PBD::ID const, list<boost::shared_ptr<Evoral::Note<Evoral::Beats> > > > >::iterator rnote;
+               list<pair<PBD::ID const, list<Evoral::event_id_t> > >::iterator rnote;
                for (rnote = selection->pending_midi_note_selection.begin(); rnote != selection->pending_midi_note_selection.end(); ++rnote) {
                        if (rv->region()->id () == (*rnote).first) {
                                mrv->select_notes ((*rnote).second);