mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 07:45:00 +01:00
add method (taken from GTK GUI) to goto_nth_marker() to BasicUI
This commit is contained in:
parent
93dd5414d6
commit
ac9b5f872d
2 changed files with 33 additions and 0 deletions
|
|
@ -539,6 +539,37 @@ BasicUI::cancel_all_solo ()
|
|||
}
|
||||
}
|
||||
|
||||
struct SortLocationsByPosition {
|
||||
bool operator() (Location* a, Location* b) {
|
||||
return a->start() < b->start();
|
||||
}
|
||||
};
|
||||
|
||||
void
|
||||
BasicUI::goto_nth_marker (int n)
|
||||
{
|
||||
if (!session) {
|
||||
return;
|
||||
}
|
||||
|
||||
const Locations::LocationList& l (session->locations()->list());
|
||||
Locations::LocationList ordered;
|
||||
ordered = l;
|
||||
|
||||
SortLocationsByPosition cmp;
|
||||
ordered.sort (cmp);
|
||||
|
||||
for (Locations::LocationList::iterator i = ordered.begin(); n >= 0 && i != ordered.end(); ++i) {
|
||||
if ((*i)->is_mark() && !(*i)->is_hidden() && !(*i)->is_session_range()) {
|
||||
if (n == 0) {
|
||||
session->request_locate ((*i)->start(), session->transport_rolling());
|
||||
break;
|
||||
}
|
||||
--n;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
this stuff is waiting to go in so that all UIs can offer complex solo/mute functionality
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue