Prepare timecode-generator direct-out
Generator ports (like TransportMaster slaves), should not be re-sampled when vari-speeding. Instead the Timecode/Clock should directly use the engine-speed. For this to happen, they need to be special-cased: no re-sampler latency, direct access to engine-buffers.
This commit is contained in:
parent
9604e64c35
commit
d9caa7fd9a
@ -735,7 +735,10 @@ enum PortFlags {
|
||||
/* non-JACK related flags */
|
||||
Hidden = 0x20,
|
||||
Shadow = 0x40,
|
||||
TransportMasterPort = 0x80
|
||||
|
||||
TransportMasterPort = 0x80, // incoming data, used by slaves
|
||||
TransportGenerator = 0x100, // outgoing, timecode/clock generators
|
||||
TransportSyncPort = 0x180 // = TransportMasterPort | TransportGenerator
|
||||
};
|
||||
|
||||
enum MidiPortFlags {
|
||||
|
@ -136,7 +136,7 @@ AudioPort::get_audio_buffer (pframes_t nframes)
|
||||
|
||||
Sample* addr;
|
||||
|
||||
if (!externally_connected ()) {
|
||||
if (!externally_connected () || 0 != (flags() & TransportSyncPort)) {
|
||||
addr = (Sample *) port_engine.get_buffer (_port_handle, nframes);
|
||||
} else {
|
||||
/* _data was read and resampled as necessary in ::cycle_start */
|
||||
|
@ -370,7 +370,7 @@ Port::set_public_latency_range (LatencyRange const& range, bool playback) const
|
||||
|
||||
if (_port_handle) {
|
||||
LatencyRange r (range);
|
||||
if (externally_connected () && 0 == (_flags & TransportMasterPort)) {
|
||||
if (externally_connected () && 0 == (_flags & TransportSyncPort)) {
|
||||
#if 0
|
||||
r.min *= _speed_ratio;
|
||||
r.max *= _speed_ratio;
|
||||
@ -436,7 +436,7 @@ Port::public_latency_range (bool /*playback*/) const
|
||||
|
||||
if (_port_handle) {
|
||||
r = port_engine.get_latency_range (_port_handle, sends_output() ? true : false);
|
||||
if (externally_connected () && 0 == (_flags & TransportMasterPort)) {
|
||||
if (externally_connected () && 0 == (_flags & TransportSyncPort)) {
|
||||
#if 0
|
||||
r.min /= _speed_ratio;
|
||||
r.max /= _speed_ratio;
|
||||
@ -485,7 +485,7 @@ Port::get_connected_latency_range (LatencyRange& range, bool playback) const
|
||||
|
||||
if (remote_port) {
|
||||
lr = port_engine.get_latency_range (remote_port, playback);
|
||||
if (externally_connected () && 0 == (_flags & TransportMasterPort)) {
|
||||
if (externally_connected () && 0 == (_flags & TransportSyncPort)) {
|
||||
#if 0
|
||||
lr.min /= _speed_ratio;
|
||||
lr.max /= _speed_ratio;
|
||||
|
@ -395,7 +395,7 @@ PortManager::register_port (DataType dtype, const string& portname, bool input,
|
||||
|
||||
/* limit the possible flags that can be set */
|
||||
|
||||
flags = PortFlags (flags & (Hidden|Shadow|IsTerminal|TransportMasterPort));
|
||||
flags = PortFlags (flags & (Hidden|Shadow|IsTerminal|TransportSyncPort));
|
||||
|
||||
try {
|
||||
if (dtype == DataType::AUDIO) {
|
||||
@ -809,14 +809,14 @@ PortManager::cycle_start (pframes_t nframes, Session* s)
|
||||
if (s && s->rt_tasklist () && fabs (Port::speed_ratio ()) != 1.0) {
|
||||
RTTaskList::TaskList tl;
|
||||
for (Ports::iterator p = _cycle_ports->begin(); p != _cycle_ports->end(); ++p) {
|
||||
if (!(p->second->flags() & TransportMasterPort)) {
|
||||
if (!(p->second->flags() & TransportSyncPort)) {
|
||||
tl.push_back (boost::bind (&Port::cycle_start, p->second, nframes));
|
||||
}
|
||||
}
|
||||
s->rt_tasklist()->process (tl);
|
||||
} else {
|
||||
for (Ports::iterator p = _cycle_ports->begin(); p != _cycle_ports->end(); ++p) {
|
||||
if (!(p->second->flags() & TransportMasterPort)) {
|
||||
if (!(p->second->flags() & TransportSyncPort)) {
|
||||
p->second->cycle_start (nframes);
|
||||
}
|
||||
}
|
||||
@ -830,14 +830,14 @@ PortManager::cycle_end (pframes_t nframes, Session* s)
|
||||
if (0 && s && s->rt_tasklist () && fabs (Port::speed_ratio ()) != 1.0) {
|
||||
RTTaskList::TaskList tl;
|
||||
for (Ports::iterator p = _cycle_ports->begin(); p != _cycle_ports->end(); ++p) {
|
||||
if (!(p->second->flags() & TransportMasterPort)) {
|
||||
if (!(p->second->flags() & TransportSyncPort)) {
|
||||
tl.push_back (boost::bind (&Port::cycle_end, p->second, nframes));
|
||||
}
|
||||
}
|
||||
s->rt_tasklist()->process (tl);
|
||||
} else {
|
||||
for (Ports::iterator p = _cycle_ports->begin(); p != _cycle_ports->end(); ++p) {
|
||||
if (!(p->second->flags() & TransportMasterPort)) {
|
||||
if (!(p->second->flags() & TransportSyncPort)) {
|
||||
p->second->cycle_end (nframes);
|
||||
}
|
||||
}
|
||||
@ -939,14 +939,14 @@ PortManager::cycle_end_fade_out (gain_t base_gain, gain_t gain_step, pframes_t n
|
||||
if (0 && s && s->rt_tasklist () && fabs (Port::speed_ratio ()) != 1.0) {
|
||||
RTTaskList::TaskList tl;
|
||||
for (Ports::iterator p = _cycle_ports->begin(); p != _cycle_ports->end(); ++p) {
|
||||
if (!(p->second->flags() & TransportMasterPort)) {
|
||||
if (!(p->second->flags() & TransportSyncPort)) {
|
||||
tl.push_back (boost::bind (&Port::cycle_end, p->second, nframes));
|
||||
}
|
||||
}
|
||||
s->rt_tasklist()->process (tl);
|
||||
} else {
|
||||
for (Ports::iterator p = _cycle_ports->begin(); p != _cycle_ports->end(); ++p) {
|
||||
if (!(p->second->flags() & TransportMasterPort)) {
|
||||
if (!(p->second->flags() & TransportSyncPort)) {
|
||||
p->second->cycle_end (nframes);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user