(&self)
| 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 |
nothing calls this directly
no test coverage detected