refactor the "selectables" API to allow use within separate (e.g. cue) editors

This commit is contained in:
Paul Davis 2024-10-07 13:20:11 -06:00
parent 83ea6e18b5
commit 4b8c51574d
26 changed files with 104 additions and 36 deletions

View file

@ -1889,17 +1889,19 @@ Editor::invert_selection ()
* within the region are already selected.
*/
void
Editor::select_all_within (timepos_t const & start, timepos_t const & end, double top, double bot, const TrackViewList& tracklist, SelectionOperation op, bool preserve_if_selected)
Editor::select_all_within (timepos_t const & start, timepos_t const & end, double top, double bot, std::list<SelectableOwner*> const & owners, SelectionOperation op, bool preserve_if_selected)
{
list<Selectable*> found;
for (TrackViewList::const_iterator iter = tracklist.begin(); iter != tracklist.end(); ++iter) {
for (auto & owner : owners) {
if ((*iter)->hidden()) {
TimeAxisView* tav = dynamic_cast<TimeAxisView*> (owner);
if (tav && tav->hidden()) {
continue;
}
(*iter)->get_selectables (start, end, top, bot, found);
owner->get_selectables (start, end, top, bot, found);
}
if (found.empty()) {
@ -2481,3 +2483,14 @@ Editor::region_selection()
{
return get_regions_from_selection_and_entered ();
}
std::list<SelectableOwner*>
Editor::selectable_owners()
{
std::list<SelectableOwner*> sl;
for (auto & tv : track_views) {
sl.push_back (tv);
}
return sl;
}