diff --git a/gtk2_ardour/edit_note_dialog.cc b/gtk2_ardour/edit_note_dialog.cc index e5015cce44..471f9087ce 100644 --- a/gtk2_ardour/edit_note_dialog.cc +++ b/gtk2_ardour/edit_note_dialog.cc @@ -233,5 +233,5 @@ EditNoteDialog::done (int r) notes.push_back ((*i)->note()->id()); } - _region_view->select_notes (notes); + _region_view->select_notes (notes, true); } diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index e39eac66a3..ee80019997 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -5319,7 +5319,7 @@ Editor::region_view_added (RegionView * rv) list > >::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); + mrv->select_notes ((*rnote).second, false); selection->pending_midi_note_selection.erase(rnote); break; } diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index 8b9600ceef..81fae686b0 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -889,7 +889,7 @@ MidiRegionView::create_note_at (samplepos_t t, double y, Temporal::Beats length, trackview.editor().set_selected_midi_region_view (*this); list to_be_selected; to_be_selected.push_back (new_note->id()); - select_notes (to_be_selected); + select_notes (to_be_selected, true); play_midi_note (new_note); } @@ -2159,6 +2159,7 @@ MidiRegionView::unique_select(NoteBase* ev) void MidiRegionView::select_all_notes () { + PBD::Unwinder uw (_no_sound_notes, true); for (Events::iterator i = _events.begin(); i != _events.end(); ++i) { add_to_selection (i->second); } @@ -2167,6 +2168,7 @@ MidiRegionView::select_all_notes () void MidiRegionView::select_range (samplepos_t start, samplepos_t end) { + PBD::Unwinder uw (_no_sound_notes, true); for (Events::iterator i = _events.begin(); i != _events.end(); ++i) { samplepos_t t = source_beats_to_absolute_samples(i->first->time()); if (t >= start && t <= end) { @@ -2178,6 +2180,7 @@ MidiRegionView::select_range (samplepos_t start, samplepos_t end) void MidiRegionView::invert_selection () { + PBD::Unwinder uw (_no_sound_notes, true); for (Events::iterator i = _events.begin(); i != _events.end(); ++i) { if (i->second->selected()) { remove_from_selection(i->second); @@ -2191,11 +2194,13 @@ MidiRegionView::invert_selection () The requested notes most likely won't exist in the view until the next model redisplay. */ void -MidiRegionView::select_notes (list notes) +MidiRegionView::select_notes (list notes, bool allow_audition) { NoteBase* cne; list::iterator n; + PBD::Unwinder uw (_no_sound_notes, allow_audition ? _no_sound_notes : true); + for (n = notes.begin(); n != notes.end(); ++n) { if ((cne = find_canvas_note(*n)) != 0) { add_to_selection (cne); diff --git a/gtk2_ardour/midi_region_view.h b/gtk2_ardour/midi_region_view.h index c96f72beb5..1d7dd881fc 100644 --- a/gtk2_ardour/midi_region_view.h +++ b/gtk2_ardour/midi_region_view.h @@ -214,7 +214,7 @@ public: NoteBase* copy_selection (NoteBase* primary); void move_copies(double dx_qn, double dy, double cumulative_dy); - void select_notes (std::list); + void select_notes (std::list, bool allow_audition); void select_matching_notes (uint8_t notenum, uint16_t channel_mask, bool add, bool extend); void toggle_matching_notes (uint8_t notenum, uint16_t channel_mask); diff --git a/gtk2_ardour/selection.cc b/gtk2_ardour/selection.cc index 7a3a9f1fa0..e4397199f5 100644 --- a/gtk2_ardour/selection.cc +++ b/gtk2_ardour/selection.cc @@ -1216,7 +1216,7 @@ Selection::set_state (XMLNode const & node, int) for (RegionSelection::iterator rsi = rs.begin(); rsi != rs.end(); ++rsi) { MidiRegionView* mrv = dynamic_cast (*rsi); if (mrv) { - mrv->select_notes(notes); + mrv->select_notes(notes, false); } }