}
}
+boost::shared_ptr<Route>
+Session::get_midi_nth_route_by_id (PresentationInfo::order_t n) const
+{
+ PresentationInfo::Flag f;
+
+ if (n == 318) {
+ f = PresentationInfo::MasterOut;
+ } else if (n == 319) {
+ f = PresentationInfo::MonitorOut;
+ } else {
+ f = PresentationInfo::Route;
+ }
+
+ boost::shared_ptr<RouteList> r = routes.reader ();
+ PresentationInfo::order_t match_cnt = 0;
+
+ for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
+ if ((*i)->presentation_info().flag_match (f)) {
+ if (match_cnt++ == n) {
+ return *i;
+ }
+ }
+ }
+
+ return boost::shared_ptr<Route>();
+}
+
void
Session::mmc_record_enable (MIDI::MachineControl &mmc, size_t trk, bool enabled)
{
return;
}
- RouteList::iterator i;
- boost::shared_ptr<RouteList> r = routes.reader();
+ boost::shared_ptr<Route> r = get_midi_nth_route_by_id (trk);
- for (i = r->begin(); i != r->end(); ++i) {
- AudioTrack *at;
+ if (r) {
+ boost::shared_ptr<AudioTrack> at;
- if ((at = dynamic_cast<AudioTrack*>((*i).get())) != 0) {
- if (trk == at->remote_control_id()) {
- at->set_record_enabled (enabled, Controllable::UseGroup);
- break;
- }
+ if ((at = boost::dynamic_pointer_cast<AudioTrack> (r))) {
+ at->rec_enable_control()->set_value (enabled, Controllable::UseGroup);
}
}
}
outbound_mtc_timecode_frame = mtc_tc;
transmitting_timecode_time = timecode;
- LatencyRange mtc_out_latency; // TODO cache this, update on engine().GraphReordered()
+ LatencyRange mtc_out_latency = {0, 0}; // TODO cache this, update on engine().GraphReordered()
_midi_ports->mtc_output_port ()->get_connected_latency_range (ltc_out_latency, true);
frameoffset_t mtc_offset = worst_playback_latency() - mtc_out_latency.max;
{
return _midi_ports->mtc_input_port ();
}
-