13
0

Add Audio Tracks and Busses too.

This commit is contained in:
Len Ovens 2015-10-18 19:55:56 -07:00
parent 0185c9f25a
commit 48f91c6ef4
2 changed files with 23 additions and 0 deletions

View File

@ -40,6 +40,7 @@
#include "pbd/memento_command.h"
#include "pbd/convert.h"
#include "ardour/audio_track.h"
#include "ardour/automation_control.h"
#include "ardour/async_midi_port.h"
#include "ardour/dB.h"
@ -287,8 +288,16 @@ MackieControlProtocol::get_sorted_routes()
remote_ids.insert (route->remote_control_id());
break;
case AudioTracks:
if (is_audio_track(*it)) {
sorted.push_back (*it);
remote_ids.insert (route->remote_control_id());
}
break;
case Busses:
if (!is_track(*it)) {
sorted.push_back (*it);
remote_ids.insert (route->remote_control_id());
}
break;
case MidiTracks:
if (is_midi_track(*it)) {
@ -1993,6 +2002,18 @@ MackieControlProtocol::connection_handler (boost::weak_ptr<ARDOUR::Port> wp1, st
}
}
bool
MackieControlProtocol::is_track (boost::shared_ptr<Route> r) const
{
return boost::dynamic_pointer_cast<Track>(r) != 0;
}
bool
MackieControlProtocol::is_audio_track (boost::shared_ptr<Route> r) const
{
return boost::dynamic_pointer_cast<AudioTrack>(r) != 0;
}
bool
MackieControlProtocol::is_midi_track (boost::shared_ptr<Route> r) const
{

View File

@ -146,6 +146,8 @@ class MackieControlProtocol
bool zoom_mode () const { return modifier_state() & MODIFIER_ZOOM; }
bool metering_active () const { return _metering_active; }
bool is_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;
void set_view_mode (ViewMode);