diff options
| author | Jokler <jokler@protonmail.com> | 2020-02-22 22:46:06 +0100 |
|---|---|---|
| committer | Jokler <jokler@protonmail.com> | 2020-02-22 23:20:10 +0100 |
| commit | 84804836f5c1e782c77f1bbf676177151558e008 (patch) | |
| tree | 55f0ee9664018f6ed0cc41d2cfcf13ca3e0ffe60 /src/audio_player.rs | |
| parent | 5eea11a03c11551091b2c72f48590aec7f5410f0 (diff) | |
| download | pokebot-84804836f5c1e782c77f1bbf676177151558e008.tar.gz pokebot-84804836f5c1e782c77f1bbf676177151558e008.zip | |
Add tmtu mode as a front-end
Diffstat (limited to 'src/audio_player.rs')
| -rw-r--r-- | src/audio_player.rs | 6 |
1 files changed, 6 insertions, 0 deletions
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<Duration> { + self.pipeline + .query_position::<gst::ClockTime>() + .and_then(|t| t.0.map(|v| Duration::from_nanos(v))) + } + pub fn currently_playing(&self) -> Option<AudioMetadata> { self.currently_playing.read().unwrap().clone() } |
