MCPcopy Create free account
hub / github.com/BillyDM/Firewheel / playhead_range

Method playhead_range

crates/firewheel-core/src/node.rs:846–867  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

844 /// playing, then this will return `None`.
845 #[cfg(feature = "musical_transport")]
846 pub fn playhead(&self) -> Option<InstantMusical> {
847 self.transport_info.as_ref().and_then(|transport_info| {
848 transport_info
849 .start_clock_samples
850 .map(|start_clock_samples| {
851 transport_info.transport.samples_to_musical(
852 self.clock_samples,
853 start_clock_samples,
854 transport_info.speed_multiplier,
855 self.sample_rate,
856 self.sample_rate_recip,
857 )
858 })
859 })
860 }
861
862 /// Get the playhead of the transport as a range for this processing
863 /// block.
864 ///
865 /// If there is no active transport, or if the transport is not currently
866 /// playing, then this will return `None`.
867 #[cfg(feature = "musical_transport")]
868 pub fn playhead_range(&self) -> Option<Range<InstantMusical>> {
869 self.transport_info.as_ref().and_then(|transport_info| {
870 transport_info

Callers

nothing calls this directly

Calls 3

DurationSamplesClass · 0.85
as_refMethod · 0.80
samples_to_musicalMethod · 0.45

Tested by

no test coverage detected