From 2ac1951e227237220da028115a2f0b083a6d82d2 Mon Sep 17 00:00:00 2001 From: casey langen Date: Tue, 4 Jul 2017 15:01:43 -0700 Subject: [PATCH] Minor cleanups to musikdroid --- .../musikcube/remote/playback/ExoPlayerWrapper.kt | 1 - .../remote/playback/MediaPlayerWrapper.kt | 14 ++------------ .../musikcube/remote/playback/PlaybackService.kt | 2 +- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/musikdroid/app/src/main/java/io/casey/musikcube/remote/playback/ExoPlayerWrapper.kt b/src/musikdroid/app/src/main/java/io/casey/musikcube/remote/playback/ExoPlayerWrapper.kt index 4621508fd..fed29147d 100644 --- a/src/musikdroid/app/src/main/java/io/casey/musikcube/remote/playback/ExoPlayerWrapper.kt +++ b/src/musikdroid/app/src/main/java/io/casey/musikcube/remote/playback/ExoPlayerWrapper.kt @@ -274,7 +274,6 @@ class ExoPlayerWrapper : PlayerWrapper() { } private val cacheListener = CacheListener { _: File, _: String, percent: Int -> - //Log.e("CLCLCL", String.format("%d", percent)); percentAvailable = percent if (percentAvailable >= 100) { diff --git a/src/musikdroid/app/src/main/java/io/casey/musikcube/remote/playback/MediaPlayerWrapper.kt b/src/musikdroid/app/src/main/java/io/casey/musikcube/remote/playback/MediaPlayerWrapper.kt index fc14d4693..cd5fcc4fe 100644 --- a/src/musikdroid/app/src/main/java/io/casey/musikcube/remote/playback/MediaPlayerWrapper.kt +++ b/src/musikdroid/app/src/main/java/io/casey/musikcube/remote/playback/MediaPlayerWrapper.kt @@ -78,12 +78,7 @@ class MediaPlayerWrapper : PlayerWrapper() { override var position: Int get() { Preconditions.throwIfNotOnMainThread() - - if (isPreparedOrPlaying) { - return this.player.currentPosition - } - - return 0 + return if (isPreparedOrPlaying) this.player.currentPosition else 0 } set(millis) { Preconditions.throwIfNotOnMainThread() @@ -100,12 +95,7 @@ class MediaPlayerWrapper : PlayerWrapper() { override val duration: Int get() { Preconditions.throwIfNotOnMainThread() - - if (isPreparedOrPlaying) { - return this.player.duration - } - - return 0 + return if (isPreparedOrPlaying) this.player.duration else 0 } override fun resume() { diff --git a/src/musikdroid/app/src/main/java/io/casey/musikcube/remote/playback/PlaybackService.kt b/src/musikdroid/app/src/main/java/io/casey/musikcube/remote/playback/PlaybackService.kt index 312ba43d6..e18ccbf7b 100644 --- a/src/musikdroid/app/src/main/java/io/casey/musikcube/remote/playback/PlaybackService.kt +++ b/src/musikdroid/app/src/main/java/io/casey/musikcube/remote/playback/PlaybackService.kt @@ -23,7 +23,7 @@ interface PlaybackService { fun pause() fun resume() fun prev() - operator fun next() + fun next() fun stop() fun volumeUp()