Mackie Control: Don't show hidden routes.

This commit is contained in:
Len Ovens 2016-01-15 13:16:24 -08:00
parent d14e3ccc24
commit 6b356448e3
2 changed files with 17 additions and 8 deletions

View file

@ -298,11 +298,13 @@ MackieControlProtocol::get_sorted_routes()
if (route->route_group()) { if (route->route_group()) {
route->route_group()->set_active (true, this); route->route_group()->set_active (true, this);
} }
sorted.push_back (route); if (! is_hidden(route)) {
remote_ids.insert (route->remote_control_id()); sorted.push_back (route);
remote_ids.insert (route->remote_control_id());
}
break; break;
case AudioTracks: case AudioTracks:
if (is_audio_track(route)) { if (is_audio_track(route) && !is_hidden(route)) {
if (route->route_group()) { if (route->route_group()) {
route->route_group()->set_active (true, this); route->route_group()->set_active (true, this);
} }
@ -319,7 +321,7 @@ MackieControlProtocol::get_sorted_routes()
} }
#endif #endif
} else { } else {
if (!is_track(route)) { if (!is_track(route) && !is_hidden(route)) {
if (route->route_group()) { if (route->route_group()) {
route->route_group()->set_active (true, this); route->route_group()->set_active (true, this);
} }
@ -329,7 +331,7 @@ MackieControlProtocol::get_sorted_routes()
} }
break; break;
case MidiTracks: case MidiTracks:
if (is_midi_track(route)) { if (is_midi_track(route) && !is_hidden(route)) {
if (route->route_group()) { if (route->route_group()) {
route->route_group()->set_active (true, this); route->route_group()->set_active (true, this);
} }
@ -340,7 +342,7 @@ MackieControlProtocol::get_sorted_routes()
case Plugins: case Plugins:
break; break;
case Auxes: // in ardour, for now aux and buss are same. for mixbus, see "Busses" case above case Auxes: // in ardour, for now aux and buss are same. for mixbus, see "Busses" case above
if (!is_track(route)) { if (!is_track(route) && !is_hidden(route)) {
if (route->route_group()) { if (route->route_group()) {
route->route_group()->set_active (true, this); route->route_group()->set_active (true, this);
} }
@ -348,8 +350,8 @@ MackieControlProtocol::get_sorted_routes()
remote_ids.insert (route->remote_control_id()); remote_ids.insert (route->remote_control_id());
} }
break; break;
case Selected: // For example: a group case Selected: // For example: a group (this is USER)
if (selected(route)) { if (selected(route) && !is_hidden(route)) {
/* Selected may be a group in which case we want to /* Selected may be a group in which case we want to
* control each track separately. * control each track separately.
*/ */
@ -2219,6 +2221,12 @@ MackieControlProtocol::selected (boost::shared_ptr<Route> r) const
return false; return false;
} }
bool
MackieControlProtocol::is_hidden (boost::shared_ptr<Route> r) const
{
return ((r->remote_control_id()) >>31) != 0;
}
boost::shared_ptr<Route> boost::shared_ptr<Route>
MackieControlProtocol::first_selected_route () const MackieControlProtocol::first_selected_route () const
{ {

View file

@ -160,6 +160,7 @@ class MackieControlProtocol
bool is_audio_track (boost::shared_ptr<ARDOUR::Route>) const; bool is_audio_track (boost::shared_ptr<ARDOUR::Route>) const;
bool is_midi_track (boost::shared_ptr<ARDOUR::Route>) const; bool is_midi_track (boost::shared_ptr<ARDOUR::Route>) const;
bool selected (boost::shared_ptr<ARDOUR::Route>) const; bool selected (boost::shared_ptr<ARDOUR::Route>) const;
bool is_hidden (boost::shared_ptr<ARDOUR::Route>) const;
boost::shared_ptr<ARDOUR::Route> first_selected_route () const; boost::shared_ptr<ARDOUR::Route> first_selected_route () const;
void set_view_mode (ViewMode); void set_view_mode (ViewMode);