13
0

manually correct cherry-pick of cdbabe40ed4e

This commit is contained in:
Paul Davis 2019-07-08 10:01:25 -06:00
parent 5e9f4f2572
commit 455039255b
2 changed files with 23 additions and 11 deletions

View File

@ -64,7 +64,7 @@ LTC_TransportMaster::LTC_TransportMaster (std::string const & name)
, a3e_timecode (Timecode::timecode_24) , a3e_timecode (Timecode::timecode_24)
, samples_per_timecode_frame (0) , samples_per_timecode_frame (0)
{ {
if ((_port = AudioEngine::instance()->register_input_port (DataType::AUDIO, string_compose ("%1 in", _name))) == 0) { if ((_port = AudioEngine::instance()->register_input_port (DataType::AUDIO, string_compose ("%1 in", _name, false, TransportMasterPort))) == 0) {
throw failed_constructor(); throw failed_constructor();
} }

View File

@ -396,7 +396,7 @@ PortManager::register_port (DataType dtype, const string& portname, bool input,
/* limit the possible flags that can be set */ /* limit the possible flags that can be set */
flags = PortFlags (flags & (Hidden|Shadow|IsTerminal)); flags = PortFlags (flags & (Hidden|Shadow|IsTerminal|TransportMasterPort));
try { try {
if (dtype == DataType::AUDIO) { if (dtype == DataType::AUDIO) {
@ -802,34 +802,42 @@ PortManager::cycle_start (pframes_t nframes, Session* s)
* A single external source-port may be connected to many ardour * A single external source-port may be connected to many ardour
* input-ports. Currently re-sampling is per input. * input-ports. Currently re-sampling is per input.
*/ */
if (s && s->rt_tasklist () && fabs (Port::speed_ratio ()) != 1.0) { if (0 && s && s->rt_tasklist () && fabs (Port::speed_ratio ()) != 1.0) {
RTTaskList::TaskList tl; RTTaskList::TaskList tl;
for (Ports::iterator p = _cycle_ports->begin(); p != _cycle_ports->end(); ++p) { for (Ports::iterator p = _cycle_ports->begin(); p != _cycle_ports->end(); ++p) {
if (!(p->second->flags() & TransportMasterPort)) {
tl.push_back (boost::bind (&Port::cycle_start, p->second, nframes)); tl.push_back (boost::bind (&Port::cycle_start, p->second, nframes));
} }
}
s->rt_tasklist()->process (tl); s->rt_tasklist()->process (tl);
} else { } else {
for (Ports::iterator p = _cycle_ports->begin(); p != _cycle_ports->end(); ++p) { for (Ports::iterator p = _cycle_ports->begin(); p != _cycle_ports->end(); ++p) {
if (!(p->second->flags() & TransportMasterPort)) {
p->second->cycle_start (nframes); p->second->cycle_start (nframes);
} }
} }
} }
}
void void
PortManager::cycle_end (pframes_t nframes, Session* s) PortManager::cycle_end (pframes_t nframes, Session* s)
{ {
// see optimzation note in ::cycle_start() // see optimzation note in ::cycle_start()
if (s && s->rt_tasklist () && fabs (Port::speed_ratio ()) != 1.0) { if (0 && s && s->rt_tasklist () && fabs (Port::speed_ratio ()) != 1.0) {
RTTaskList::TaskList tl; RTTaskList::TaskList tl;
for (Ports::iterator p = _cycle_ports->begin(); p != _cycle_ports->end(); ++p) { for (Ports::iterator p = _cycle_ports->begin(); p != _cycle_ports->end(); ++p) {
if (!(p->second->flags() & TransportMasterPort)) {
tl.push_back (boost::bind (&Port::cycle_end, p->second, nframes)); tl.push_back (boost::bind (&Port::cycle_end, p->second, nframes));
} }
}
s->rt_tasklist()->process (tl); s->rt_tasklist()->process (tl);
} else { } else {
for (Ports::iterator p = _cycle_ports->begin(); p != _cycle_ports->end(); ++p) { for (Ports::iterator p = _cycle_ports->begin(); p != _cycle_ports->end(); ++p) {
if (!(p->second->flags() & TransportMasterPort)) {
p->second->cycle_end (nframes); p->second->cycle_end (nframes);
} }
} }
}
for (Ports::iterator p = _cycle_ports->begin(); p != _cycle_ports->end(); ++p) { for (Ports::iterator p = _cycle_ports->begin(); p != _cycle_ports->end(); ++p) {
p->second->flush_buffers (nframes); p->second->flush_buffers (nframes);
@ -922,17 +930,21 @@ void
PortManager::cycle_end_fade_out (gain_t base_gain, gain_t gain_step, pframes_t nframes, Session* s) PortManager::cycle_end_fade_out (gain_t base_gain, gain_t gain_step, pframes_t nframes, Session* s)
{ {
// see optimzation note in ::cycle_start() // see optimzation note in ::cycle_start()
if (s && s->rt_tasklist () && fabs (Port::speed_ratio ()) != 1.0) { if (0 && s && s->rt_tasklist () && fabs (Port::speed_ratio ()) != 1.0) {
RTTaskList::TaskList tl; RTTaskList::TaskList tl;
for (Ports::iterator p = _cycle_ports->begin(); p != _cycle_ports->end(); ++p) { for (Ports::iterator p = _cycle_ports->begin(); p != _cycle_ports->end(); ++p) {
if (!(p->second->flags() & TransportMasterPort)) {
tl.push_back (boost::bind (&Port::cycle_end, p->second, nframes)); tl.push_back (boost::bind (&Port::cycle_end, p->second, nframes));
} }
}
s->rt_tasklist()->process (tl); s->rt_tasklist()->process (tl);
} else { } else {
for (Ports::iterator p = _cycle_ports->begin(); p != _cycle_ports->end(); ++p) { for (Ports::iterator p = _cycle_ports->begin(); p != _cycle_ports->end(); ++p) {
if (!(p->second->flags() & TransportMasterPort)) {
p->second->cycle_end (nframes); p->second->cycle_end (nframes);
} }
} }
}
for (Ports::iterator p = _cycle_ports->begin(); p != _cycle_ports->end(); ++p) { for (Ports::iterator p = _cycle_ports->begin(); p != _cycle_ports->end(); ++p) {
p->second->flush_buffers (nframes); p->second->flush_buffers (nframes);