Commit e058d8af authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Rename PlayerController.getTime to fix shadowing

parent 760074d7
...@@ -320,7 +320,7 @@ class PlaybackService : MediaBrowserServiceCompat() { ...@@ -320,7 +320,7 @@ class PlaybackService : MediaBrowserServiceCompat() {
var time: Long var time: Long
@MainThread @MainThread
get() = playlistManager.player.getTime() get() = playlistManager.player.getCurrentTime()
@MainThread @MainThread
set(time) = playlistManager.player.setTime(time) set(time) = playlistManager.player.setTime(time)
......
...@@ -211,7 +211,7 @@ class PlayerController : IVLCVout.Callback, MediaPlayer.EventListener { ...@@ -211,7 +211,7 @@ class PlayerController : IVLCVout.Callback, MediaPlayer.EventListener {
switchToVideo = false switchToVideo = false
} }
fun getTime() = currentTime.value ?: 0L fun getCurrentTime() = currentTime.value ?: 0L
fun setRate(rate: Float, save: Boolean) { fun setRate(rate: Float, save: Boolean) {
mediaplayer.rate = rate mediaplayer.rate = rate
......
...@@ -207,7 +207,7 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList ...@@ -207,7 +207,7 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
@MainThread @MainThread
fun previous(force : Boolean) { fun previous(force : Boolean) {
if (hasPrevious() && currentIndex > 0 && if (hasPrevious() && currentIndex > 0 &&
(force || !player.seekable || player.getTime() < PREVIOUS_LIMIT_DELAY)) { (force || !player.seekable || player.getCurrentTime() < PREVIOUS_LIMIT_DELAY)) {
val size = mediaList.size() val size = mediaList.size()
currentIndex = prevIndex currentIndex = prevIndex
if (previous.size > 0) previous.pop() if (previous.size > 0) previous.pop()
...@@ -389,7 +389,7 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList ...@@ -389,7 +389,7 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
val canSwitchToVideo = player.canSwitchToVideo() val canSwitchToVideo = player.canSwitchToVideo()
if (media.type == MediaWrapper.TYPE_VIDEO || canSwitchToVideo || media.isPodcast) { if (media.type == MediaWrapper.TYPE_VIDEO || canSwitchToVideo || media.isPodcast) {
//Save progress //Save progress
val time = player.getTime() val time = player.getCurrentTime()
val length = player.length val length = player.length
var progress = time / length.toFloat() var progress = time / length.toFloat()
if (progress > 0.95f || length - time < 10000) { if (progress > 0.95f || length - time < 10000) {
...@@ -577,7 +577,7 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList ...@@ -577,7 +577,7 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
editor.putBoolean(if (audio) "audio_shuffling" else "media_shuffling", shuffling) editor.putBoolean(if (audio) "audio_shuffling" else "media_shuffling", shuffling)
editor.putInt(if (audio) "audio_repeating" else "media_repeating", repeating) editor.putInt(if (audio) "audio_repeating" else "media_repeating", repeating)
editor.putInt(if (audio) "position_in_audio_list" else "position_in_media_list", if (reset) 0 else currentIndex) editor.putInt(if (audio) "position_in_audio_list" else "position_in_media_list", if (reset) 0 else currentIndex)
editor.putLong(if (audio) "position_in_song" else "position_in_media", if (reset) 0L else player.getTime()) editor.putLong(if (audio) "position_in_song" else "position_in_media", if (reset) 0L else player.getCurrentTime())
if (!audio) { if (!audio) {
editor.putBoolean(PreferencesActivity.VIDEO_PAUSED, !player.isPlaying()) editor.putBoolean(PreferencesActivity.VIDEO_PAUSED, !player.isPlaying())
editor.putFloat(PreferencesActivity.VIDEO_SPEED, player.getRate()) editor.putFloat(PreferencesActivity.VIDEO_SPEED, player.getRate())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment