From 84804836f5c1e782c77f1bbf676177151558e008 Mon Sep 17 00:00:00 2001 From: Jokler Date: Sat, 22 Feb 2020 22:46:06 +0100 Subject: Add tmtu mode as a front-end --- src/audio_player.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/audio_player.rs') diff --git a/src/audio_player.rs b/src/audio_player.rs index 4df213f..4bcab56 100644 --- a/src/audio_player.rs +++ b/src/audio_player.rs @@ -223,6 +223,12 @@ impl AudioPlayer { *self.volume_f64.read().unwrap() } + pub fn position(&self) -> Option { + self.pipeline + .query_position::() + .and_then(|t| t.0.map(|v| Duration::from_nanos(v))) + } + pub fn currently_playing(&self) -> Option { self.currently_playing.read().unwrap().clone() } -- cgit v1.2.3-70-g09d2