pub enum LanPlacementMode {
JitterBuffered {
jitter_packets: u32,
latency_comp_frames: u64,
},
BarDelay {
bars: u32,
beats_per_bar: u32,
tempo_bpm: u32,
jitter_packets: u32,
latency_comp_frames: u64,
},
}Expand description
Placement mode for a stream fragment hosted on a LAN peer.
Selects how packets crossing the LAN are buffered and time-aligned: a plain jitter buffer for buffered preview, or a musically aligned bar delay for collaborative play.
Variants§
JitterBuffered
Jitter-buffered preview placement.
Fields
BarDelay
Musically aligned collaborative placement delayed by whole bars.
Fields
Implementations§
Source§impl LanPlacementMode
impl LanPlacementMode
Sourcepub fn jitter_buffered(
jitter_packets: u32,
latency_comp_frames: u64,
) -> Result<Self>
pub fn jitter_buffered( jitter_packets: u32, latency_comp_frames: u64, ) -> Result<Self>
Builds a jitter-buffered mode retaining jitter_packets packets.
Returns an evaluation error when jitter_packets is zero.
§Examples
use sim_lib_stream_host::LanPlacementMode;
let mode = LanPlacementMode::jitter_buffered(4, 128).unwrap();
assert_eq!(mode.jitter_packets(), 4);
assert_eq!(mode.latency_comp_frames(), 128);
assert!(mode.bar_delay_millis().is_none());Sourcepub fn bar_delay(
bars: u32,
tempo_bpm: u32,
jitter_packets: u32,
latency_comp_frames: u64,
) -> Result<Self>
pub fn bar_delay( bars: u32, tempo_bpm: u32, jitter_packets: u32, latency_comp_frames: u64, ) -> Result<Self>
Builds a bar-delay mode delaying bars bars at tempo_bpm.
Uses a default of four beats per bar. Returns an evaluation error when
bars, tempo_bpm, or jitter_packets is zero.
Sourcepub fn latency_class(self) -> LatencyClass
pub fn latency_class(self) -> LatencyClass
Returns the latency class this mode places the fragment into.
Sourcepub fn jitter_packets(self) -> u32
pub fn jitter_packets(self) -> u32
Returns the number of packets retained in the jitter buffer.
Sourcepub fn latency_comp_frames(self) -> u64
pub fn latency_comp_frames(self) -> u64
Returns the latency-compensation delay in frames.
Sourcepub fn bar_delay_millis(self) -> Option<u64>
pub fn bar_delay_millis(self) -> Option<u64>
Returns the bar-delay length in milliseconds, or None for
jitter-buffered placement.
Sourcepub fn transport_profile(self) -> Result<TransportProfile>
pub fn transport_profile(self) -> Result<TransportProfile>
Returns the transport profile advertised for this mode.
Trait Implementations§
Source§impl Clone for LanPlacementMode
impl Clone for LanPlacementMode
Source§fn clone(&self) -> LanPlacementMode
fn clone(&self) -> LanPlacementMode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for LanPlacementMode
Source§impl Debug for LanPlacementMode
impl Debug for LanPlacementMode
impl Eq for LanPlacementMode
Source§impl PartialEq for LanPlacementMode
impl PartialEq for LanPlacementMode
Source§fn eq(&self, other: &LanPlacementMode) -> bool
fn eq(&self, other: &LanPlacementMode) -> bool
self and other values to be equal, and is used by ==.