use new CoreSelection methods in editor and mixer
This commit is contained in:
parent
2d0416a016
commit
932eefad9f
@ -58,6 +58,7 @@
|
||||
#include "ardour/legatize.h"
|
||||
#include "ardour/region_factory.h"
|
||||
#include "ardour/reverse.h"
|
||||
#include "ardour/selection.h"
|
||||
#include "ardour/session.h"
|
||||
#include "ardour/session_playlists.h"
|
||||
#include "ardour/strip_silence.h"
|
||||
@ -6422,79 +6423,13 @@ Editor::split_region ()
|
||||
void
|
||||
Editor::select_next_stripable (bool routes_only)
|
||||
{
|
||||
if (selection->tracks.empty()) {
|
||||
selection->set (track_views.front());
|
||||
return;
|
||||
}
|
||||
|
||||
TimeAxisView* current = selection->tracks.front();
|
||||
|
||||
bool valid;
|
||||
do {
|
||||
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
||||
|
||||
if (*i == current) {
|
||||
++i;
|
||||
if (i != track_views.end()) {
|
||||
current = (*i);
|
||||
} else {
|
||||
current = (*(track_views.begin()));
|
||||
//selection->set (*(track_views.begin()));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (routes_only) {
|
||||
RouteUI* rui = dynamic_cast<RouteUI *>(current);
|
||||
valid = rui && rui->route()->active();
|
||||
} else {
|
||||
valid = 0 != current->stripable ().get();
|
||||
}
|
||||
|
||||
} while (current->hidden() || !valid);
|
||||
|
||||
selection->set (current);
|
||||
|
||||
ensure_time_axis_view_is_visible (*current, false);
|
||||
_session->selection().select_next_stripable (false, routes_only);
|
||||
}
|
||||
|
||||
void
|
||||
Editor::select_prev_stripable (bool routes_only)
|
||||
{
|
||||
if (selection->tracks.empty()) {
|
||||
selection->set (track_views.front());
|
||||
return;
|
||||
}
|
||||
|
||||
TimeAxisView* current = selection->tracks.front();
|
||||
|
||||
bool valid;
|
||||
do {
|
||||
for (TrackViewList::reverse_iterator i = track_views.rbegin(); i != track_views.rend(); ++i) {
|
||||
|
||||
if (*i == current) {
|
||||
++i;
|
||||
if (i != track_views.rend()) {
|
||||
current = (*i);
|
||||
} else {
|
||||
current = *(track_views.rbegin());
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (routes_only) {
|
||||
RouteUI* rui = dynamic_cast<RouteUI *>(current);
|
||||
valid = rui && rui->route()->active();
|
||||
} else {
|
||||
valid = 0 != current->stripable ().get();
|
||||
}
|
||||
|
||||
} while (current->hidden() || !valid);
|
||||
|
||||
selection->set (current);
|
||||
|
||||
ensure_time_axis_view_is_visible (*current, false);
|
||||
_session->selection().select_prev_stripable (false, routes_only);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -660,56 +660,14 @@ Mixer_UI::select_none ()
|
||||
Mixer_UI::select_next_strip ()
|
||||
{
|
||||
deselect_all_strip_processors();
|
||||
strips.sort (MixerStripSorter());
|
||||
|
||||
if (_selection.empty()) {
|
||||
_selection.set (strips.front());
|
||||
return;
|
||||
}
|
||||
|
||||
bool select_me = false;
|
||||
|
||||
for (list<MixerStrip*>::iterator i = strips.begin(); i != strips.end(); ++i) {
|
||||
|
||||
if (select_me) {
|
||||
_selection.set (*i);
|
||||
return;
|
||||
}
|
||||
|
||||
if ((*i)->selected()) {
|
||||
select_me = true;
|
||||
}
|
||||
}
|
||||
|
||||
_selection.set (strips.front());
|
||||
_session->selection().select_next_stripable (true, false);
|
||||
}
|
||||
|
||||
void
|
||||
Mixer_UI::select_prev_strip ()
|
||||
{
|
||||
deselect_all_strip_processors();
|
||||
strips.sort (MixerStripSorter());
|
||||
|
||||
if (_selection.empty()) {
|
||||
_selection.set (strips.back());
|
||||
return;
|
||||
}
|
||||
|
||||
bool select_me = false;
|
||||
|
||||
for (list<MixerStrip*>::reverse_iterator i = strips.rbegin(); i != strips.rend(); ++i) {
|
||||
|
||||
if (select_me) {
|
||||
_selection.set (*i);
|
||||
return;
|
||||
}
|
||||
|
||||
if ((*i)->selected()) {
|
||||
select_me = true;
|
||||
}
|
||||
}
|
||||
|
||||
_selection.set (strips.back());
|
||||
_session->selection().select_prev_stripable (true, false);
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user