mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 23:35:03 +01:00
Enforce internal/external selection exclusivity.
This commit is contained in:
parent
cebf191cba
commit
7ab8a11fb5
7 changed files with 57 additions and 15 deletions
|
|
@ -329,13 +329,37 @@ Editor::internal_editing() const
|
||||||
void
|
void
|
||||||
Editor::update_time_selection_display ()
|
Editor::update_time_selection_display ()
|
||||||
{
|
{
|
||||||
switch (mouse_mode) {
|
if (smart_mode_action->get_active()) {
|
||||||
case MouseRange:
|
/* not sure what to do here */
|
||||||
selection->clear_objects ();
|
if (mouse_mode == MouseObject) {
|
||||||
break;
|
} else {
|
||||||
default:
|
}
|
||||||
selection->clear_time ();
|
} else {
|
||||||
break;
|
switch (mouse_mode) {
|
||||||
|
case MouseRange:
|
||||||
|
selection->clear_objects ();
|
||||||
|
selection->ClearMidiNoteSelection(); //signal
|
||||||
|
break;
|
||||||
|
case MouseObject:
|
||||||
|
selection->clear_objects ();
|
||||||
|
selection->clear_time ();
|
||||||
|
selection->clear_tracks ();
|
||||||
|
selection->ClearMidiNoteSelection(); //signal
|
||||||
|
break;
|
||||||
|
case MouseContent:
|
||||||
|
case MouseDraw:
|
||||||
|
//if we go into internal editing, clear everything in the outside world
|
||||||
|
selection->clear_objects ();
|
||||||
|
selection->clear_time ();
|
||||||
|
selection->clear_tracks ();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
//clear everything
|
||||||
|
selection->clear_objects ();
|
||||||
|
selection->clear_time ();
|
||||||
|
selection->clear_tracks ();
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -135,6 +135,9 @@ MidiRegionView::MidiRegionView (ArdourCanvas::Container* parent,
|
||||||
connect_to_diskstream ();
|
connect_to_diskstream ();
|
||||||
|
|
||||||
SelectionCleared.connect (_selection_cleared_connection, invalidator (*this), boost::bind (&MidiRegionView::selection_cleared, this, _1), gui_context ());
|
SelectionCleared.connect (_selection_cleared_connection, invalidator (*this), boost::bind (&MidiRegionView::selection_cleared, this, _1), gui_context ());
|
||||||
|
|
||||||
|
PublicEditor& editor (trackview.editor());
|
||||||
|
editor.get_selection().ClearMidiNoteSelection.connect (_clear_midi_selection_connection, invalidator (*this), boost::bind (&MidiRegionView::clear_midi_selection, this), gui_context ());
|
||||||
}
|
}
|
||||||
|
|
||||||
MidiRegionView::MidiRegionView (ArdourCanvas::Container* parent,
|
MidiRegionView::MidiRegionView (ArdourCanvas::Container* parent,
|
||||||
|
|
@ -181,6 +184,9 @@ MidiRegionView::MidiRegionView (ArdourCanvas::Container* parent,
|
||||||
connect_to_diskstream ();
|
connect_to_diskstream ();
|
||||||
|
|
||||||
SelectionCleared.connect (_selection_cleared_connection, invalidator (*this), boost::bind (&MidiRegionView::selection_cleared, this, _1), gui_context ());
|
SelectionCleared.connect (_selection_cleared_connection, invalidator (*this), boost::bind (&MidiRegionView::selection_cleared, this, _1), gui_context ());
|
||||||
|
|
||||||
|
PublicEditor& editor (trackview.editor());
|
||||||
|
editor.get_selection().ClearMidiNoteSelection.connect (_clear_midi_selection_connection, invalidator (*this), boost::bind (&MidiRegionView::clear_midi_selection, this), gui_context ());
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -315,6 +321,9 @@ MidiRegionView::init (bool wfd)
|
||||||
connect_to_diskstream ();
|
connect_to_diskstream ();
|
||||||
|
|
||||||
SelectionCleared.connect (_selection_cleared_connection, invalidator (*this), boost::bind (&MidiRegionView::selection_cleared, this, _1), gui_context ());
|
SelectionCleared.connect (_selection_cleared_connection, invalidator (*this), boost::bind (&MidiRegionView::selection_cleared, this, _1), gui_context ());
|
||||||
|
|
||||||
|
PublicEditor& editor (trackview.editor());
|
||||||
|
editor.get_selection().ClearMidiNoteSelection.connect (_clear_midi_selection_connection, invalidator (*this), boost::bind (&MidiRegionView::clear_midi_selection, this), gui_context ());
|
||||||
}
|
}
|
||||||
|
|
||||||
InstrumentInfo&
|
InstrumentInfo&
|
||||||
|
|
|
||||||
|
|
@ -348,6 +348,11 @@ private:
|
||||||
PBD::ScopedConnection _selection_cleared_connection;
|
PBD::ScopedConnection _selection_cleared_connection;
|
||||||
void selection_cleared (MidiRegionView *);
|
void selection_cleared (MidiRegionView *);
|
||||||
|
|
||||||
|
/** this handles the case when the "external" world wants us to clear our internal selections
|
||||||
|
*/
|
||||||
|
PBD::ScopedConnection _clear_midi_selection_connection;
|
||||||
|
void clear_midi_selection () { clear_selection(); }
|
||||||
|
|
||||||
friend class EditNoteDialog;
|
friend class EditNoteDialog;
|
||||||
|
|
||||||
/** Play the NoteOn event of the given note immediately
|
/** Play the NoteOn event of the given note immediately
|
||||||
|
|
|
||||||
|
|
@ -235,6 +235,7 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible, publi
|
||||||
virtual void copy_playlists (TimeAxisView*) = 0;
|
virtual void copy_playlists (TimeAxisView*) = 0;
|
||||||
virtual void clear_playlists (TimeAxisView*) = 0;
|
virtual void clear_playlists (TimeAxisView*) = 0;
|
||||||
virtual void select_all_tracks () = 0;
|
virtual void select_all_tracks () = 0;
|
||||||
|
virtual void deselect_all () = 0;
|
||||||
virtual void set_selected_track (TimeAxisView&, Selection::Operation op = Selection::Set, bool no_remove = false) = 0;
|
virtual void set_selected_track (TimeAxisView&, Selection::Operation op = Selection::Set, bool no_remove = false) = 0;
|
||||||
virtual void set_selected_mixer_strip (TimeAxisView&) = 0;
|
virtual void set_selected_mixer_strip (TimeAxisView&) = 0;
|
||||||
virtual void hide_track_in_display (TimeAxisView* tv, bool apply_to_selection = false) = 0;
|
virtual void hide_track_in_display (TimeAxisView* tv, bool apply_to_selection = false) = 0;
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,8 @@ using namespace std;
|
||||||
using namespace ARDOUR;
|
using namespace ARDOUR;
|
||||||
using namespace PBD;
|
using namespace PBD;
|
||||||
|
|
||||||
|
PBD::Signal0<void> Selection::ClearMidiNoteSelection;
|
||||||
|
|
||||||
struct AudioRangeComparator {
|
struct AudioRangeComparator {
|
||||||
bool operator()(AudioRange a, AudioRange b) {
|
bool operator()(AudioRange a, AudioRange b) {
|
||||||
return a.start < b.start;
|
return a.start < b.start;
|
||||||
|
|
@ -173,6 +175,10 @@ Selection::clear_midi_notes ()
|
||||||
midi_notes.clear ();
|
midi_notes.clear ();
|
||||||
MidiNotesChanged ();
|
MidiNotesChanged ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* The note selection is actually stored in MidiRegionView, emit signal to
|
||||||
|
tell them to clear their selection. */
|
||||||
|
ClearMidiNoteSelection(); /* EMIT SIGNAL */
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -198,6 +198,8 @@ class Selection : public sigc::trackable, public PBD::ScopedConnectionList
|
||||||
* The Track selection isn't affected when ranges or objects are added.
|
* The Track selection isn't affected when ranges or objects are added.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
void clear_all() { clear_time(); clear_tracks(); clear_objects(); }
|
||||||
|
|
||||||
void clear_time(); //clears any time selection ( i.e. Range )
|
void clear_time(); //clears any time selection ( i.e. Range )
|
||||||
void clear_tracks (); //clears the track header selections
|
void clear_tracks (); //clears the track header selections
|
||||||
void clear_objects(); //clears the items listed below
|
void clear_objects(); //clears the items listed below
|
||||||
|
|
@ -219,6 +221,8 @@ class Selection : public sigc::trackable, public PBD::ScopedConnectionList
|
||||||
XMLNode& get_state () const;
|
XMLNode& get_state () const;
|
||||||
int set_state (XMLNode const &, int);
|
int set_state (XMLNode const &, int);
|
||||||
|
|
||||||
|
static PBD::Signal0<void> ClearMidiNoteSelection;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
PublicEditor const * editor;
|
PublicEditor const * editor;
|
||||||
uint32_t next_time_id;
|
uint32_t next_time_id;
|
||||||
|
|
|
||||||
|
|
@ -782,14 +782,7 @@ TimeAxisViewItem::set_frame_color()
|
||||||
set_frame_gradient ();
|
set_frame_gradient ();
|
||||||
|
|
||||||
if (!_recregion) {
|
if (!_recregion) {
|
||||||
uint32_t f = ARDOUR_UI::config()->color ("time axis frame");
|
frame->set_outline_color (ARDOUR_UI::config()->color ("time axis frame"));
|
||||||
|
|
||||||
if (!rect_visible) {
|
|
||||||
/* make the frame outline be visible but rather transparent */
|
|
||||||
f = UINT_RGBA_CHANGE_A (f, 64);
|
|
||||||
}
|
|
||||||
|
|
||||||
frame->set_outline_color (f);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue