mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-20 21:56:30 +01:00
make most (all?) keymouse actions ensure that the entered regionview is selected before the action occurs
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2633 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
4f9eaf6858
commit
c97fbffa9c
2 changed files with 27 additions and 0 deletions
|
|
@ -1885,6 +1885,7 @@ class Editor : public PublicEditor
|
||||||
|
|
||||||
TimeAxisView* entered_track;
|
TimeAxisView* entered_track;
|
||||||
RegionView* entered_regionview;
|
RegionView* entered_regionview;
|
||||||
|
void ensure_entered_selected ();
|
||||||
bool clear_entered_track;
|
bool clear_entered_track;
|
||||||
gint left_track_canvas (GdkEventCrossing*);
|
gint left_track_canvas (GdkEventCrossing*);
|
||||||
void set_entered_track (TimeAxisView*);
|
void set_entered_track (TimeAxisView*);
|
||||||
|
|
|
||||||
|
|
@ -2329,6 +2329,8 @@ Editor::separate_regions_using_location (Location& loc)
|
||||||
void
|
void
|
||||||
Editor::crop_region_to_selection ()
|
Editor::crop_region_to_selection ()
|
||||||
{
|
{
|
||||||
|
ensure_entered_selected ();
|
||||||
|
|
||||||
if (!selection->time.empty()) {
|
if (!selection->time.empty()) {
|
||||||
|
|
||||||
crop_region_to (selection->time.start(), selection->time.end_frame());
|
crop_region_to (selection->time.start(), selection->time.end_frame());
|
||||||
|
|
@ -2352,6 +2354,8 @@ Editor::crop_region_to (nframes_t start, nframes_t end)
|
||||||
boost::shared_ptr<Playlist> playlist;
|
boost::shared_ptr<Playlist> playlist;
|
||||||
TrackSelection* ts;
|
TrackSelection* ts;
|
||||||
|
|
||||||
|
ensure_entered_selected ();
|
||||||
|
|
||||||
if (selection->tracks.empty()) {
|
if (selection->tracks.empty()) {
|
||||||
ts = &track_views;
|
ts = &track_views;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -2583,6 +2587,8 @@ Editor::naturalize ()
|
||||||
void
|
void
|
||||||
Editor::align (RegionPoint what)
|
Editor::align (RegionPoint what)
|
||||||
{
|
{
|
||||||
|
ensure_entered_selected ();
|
||||||
|
|
||||||
nframes64_t where = get_preferred_edit_position();
|
nframes64_t where = get_preferred_edit_position();
|
||||||
|
|
||||||
if (!selection->regions.empty()) {
|
if (!selection->regions.empty()) {
|
||||||
|
|
@ -2747,6 +2753,8 @@ Editor::trim_region_to_punch ()
|
||||||
void
|
void
|
||||||
Editor::trim_region_to_location (const Location& loc, const char* str)
|
Editor::trim_region_to_location (const Location& loc, const char* str)
|
||||||
{
|
{
|
||||||
|
ensure_entered_selected ();
|
||||||
|
|
||||||
RegionSelection& rs (get_regions_for_action ());
|
RegionSelection& rs (get_regions_for_action ());
|
||||||
|
|
||||||
begin_reversible_command (str);
|
begin_reversible_command (str);
|
||||||
|
|
@ -3844,6 +3852,8 @@ Editor::toggle_region_opaque ()
|
||||||
void
|
void
|
||||||
Editor::set_fade_length (bool in)
|
Editor::set_fade_length (bool in)
|
||||||
{
|
{
|
||||||
|
ensure_entered_selected ();
|
||||||
|
|
||||||
/* we need a region to measure the offset from the start */
|
/* we need a region to measure the offset from the start */
|
||||||
|
|
||||||
RegionView* rv;
|
RegionView* rv;
|
||||||
|
|
@ -4068,6 +4078,8 @@ Editor::set_playhead_cursor ()
|
||||||
void
|
void
|
||||||
Editor::split ()
|
Editor::split ()
|
||||||
{
|
{
|
||||||
|
ensure_entered_selected ();
|
||||||
|
|
||||||
nframes64_t where = get_preferred_edit_position();
|
nframes64_t where = get_preferred_edit_position();
|
||||||
|
|
||||||
if (!selection->regions.empty()) {
|
if (!selection->regions.empty()) {
|
||||||
|
|
@ -4081,3 +4093,17 @@ Editor::split ()
|
||||||
split_regions_at (where, rs);
|
split_regions_at (where, rs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Editor::ensure_entered_selected ()
|
||||||
|
{
|
||||||
|
if (entered_regionview) {
|
||||||
|
if (find (selection->regions.begin(), selection->regions.end(), entered_regionview) == selection->regions.end()) {
|
||||||
|
if (selection->regions.empty()) {
|
||||||
|
selection->set (entered_regionview);
|
||||||
|
} else {
|
||||||
|
selection->add (entered_regionview);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue