Minor cleanups to musikdroid

This commit is contained in:
casey langen 2017-07-04 15:01:43 -07:00
parent 1382ebe68b
commit 2ac1951e22
3 changed files with 3 additions and 14 deletions

View File

@ -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) {

View File

@ -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() {

View File

@ -23,7 +23,7 @@ interface PlaybackService {
fun pause()
fun resume()
fun prev()
operator fun next()
fun next()
fun stop()
fun volumeUp()