Clear selected MIDI notes in all regions when they are
cleared in a single one (#4152). git-svn-id: svn://localhost/ardour2/branches/3.0@10158 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
97a3971bab
commit
5f2ef08666
|
@ -80,6 +80,8 @@ using namespace Editing;
|
|||
using namespace ArdourCanvas;
|
||||
using Gtkmm2ext::Keyboard;
|
||||
|
||||
PBD::Signal1<void, MidiRegionView *> MidiRegionView::SelectionCleared;
|
||||
|
||||
#define MIDI_BP_ZERO ((Config->get_first_midi_bank_is_zero())?0:1)
|
||||
|
||||
MidiRegionView::MidiRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView &tv,
|
||||
|
@ -116,6 +118,8 @@ MidiRegionView::MidiRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView &
|
|||
|
||||
Config->ParameterChanged.connect (*this, invalidator (*this), ui_bind (&MidiRegionView::parameter_changed, this, _1), gui_context());
|
||||
connect_to_diskstream ();
|
||||
|
||||
SelectionCleared.connect (_selection_cleared_connection, invalidator (*this), ui_bind (&MidiRegionView::selection_cleared, this, _1), gui_context ());
|
||||
}
|
||||
|
||||
MidiRegionView::MidiRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView &tv,
|
||||
|
@ -149,6 +153,8 @@ MidiRegionView::MidiRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView &
|
|||
PublicEditor::DropDownKeys.connect (sigc::mem_fun (*this, &MidiRegionView::drop_down_keys));
|
||||
|
||||
connect_to_diskstream ();
|
||||
|
||||
SelectionCleared.connect (_selection_cleared_connection, invalidator (*this), ui_bind (&MidiRegionView::selection_cleared, this, _1), gui_context ());
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -284,6 +290,8 @@ MidiRegionView::init (Gdk::Color const & basic_color, bool wfd)
|
|||
|
||||
Config->ParameterChanged.connect (*this, invalidator (*this), ui_bind (&MidiRegionView::parameter_changed, this, _1), gui_context());
|
||||
connect_to_diskstream ();
|
||||
|
||||
SelectionCleared.connect (_selection_cleared_connection, invalidator (*this), ui_bind (&MidiRegionView::selection_cleared, this, _1), gui_context ());
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1960,7 +1968,7 @@ MidiRegionView::delete_note (boost::shared_ptr<NoteType> n)
|
|||
}
|
||||
|
||||
void
|
||||
MidiRegionView::clear_selection_except (ArdourCanvas::CanvasNoteEvent* ev)
|
||||
MidiRegionView::clear_selection_except (ArdourCanvas::CanvasNoteEvent* ev, bool signal)
|
||||
{
|
||||
for (Selection::iterator i = _selection.begin(); i != _selection.end(); ) {
|
||||
if ((*i) != ev) {
|
||||
|
@ -1980,6 +1988,10 @@ MidiRegionView::clear_selection_except (ArdourCanvas::CanvasNoteEvent* ev)
|
|||
/* this does not change the status of this regionview w.r.t the editor
|
||||
selection.
|
||||
*/
|
||||
|
||||
if (signal) {
|
||||
SelectionCleared (this); /* EMIT SIGNAL */
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -3627,3 +3639,17 @@ MidiRegionView::snap_frame_to_grid_underneath (framepos_t p, framecnt_t& grid_fr
|
|||
|
||||
return snap_frame_to_frame (p);
|
||||
}
|
||||
|
||||
/** Called when the selection has been cleared in any MidiRegionView.
|
||||
* @param rv MidiRegionView that the selection was cleared in.
|
||||
*/
|
||||
void
|
||||
MidiRegionView::selection_cleared (MidiRegionView* rv)
|
||||
{
|
||||
if (rv == this) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Clear our selection in sympathy; but don't signal the fact */
|
||||
clear_selection (false);
|
||||
}
|
||||
|
|
|
@ -311,6 +311,11 @@ protected:
|
|||
|
||||
private:
|
||||
|
||||
/** Emitted when the selection has been cleared in one MidiRegionView */
|
||||
static PBD::Signal1<void, MidiRegionView*> SelectionCleared;
|
||||
PBD::ScopedConnection _selection_cleared_connection;
|
||||
void selection_cleared (MidiRegionView *);
|
||||
|
||||
friend class EditNoteDialog;
|
||||
|
||||
void create_note_at(double x, double y, double length, bool, bool);
|
||||
|
@ -342,8 +347,8 @@ private:
|
|||
void trim_note(ArdourCanvas::CanvasNoteEvent* ev, ARDOUR::MidiModel::TimeType start_delta,
|
||||
ARDOUR::MidiModel::TimeType end_delta);
|
||||
|
||||
void clear_selection_except (ArdourCanvas::CanvasNoteEvent* ev);
|
||||
void clear_selection() { clear_selection_except (0); }
|
||||
void clear_selection_except (ArdourCanvas::CanvasNoteEvent* ev, bool signal = true);
|
||||
void clear_selection (bool signal = true) { clear_selection_except (0, signal); }
|
||||
void update_drag_selection (double last_x, double x, double last_y, double y, bool extend);
|
||||
|
||||
void add_to_selection (ArdourCanvas::CanvasNoteEvent*);
|
||||
|
|
Loading…
Reference in New Issue
Block a user