From bd77a7bc22f686c321ca872a1f66e7d53139dba0 Mon Sep 17 00:00:00 2001 From: Felix Date: Thu, 11 Jun 2020 21:41:55 +0200 Subject: [PATCH] fix: match parameters of free and nonFree CastServiceImpl --- .../touch/browse/cast/CastServiceImpl.kt | 7 ++++++- .../chaosflix/touch/browse/cast/CastService.kt | 17 +++++++++++------ .../touch/browse/cast/CastServiceImpl.kt | 6 +++--- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/common/src/free/java/de/nicidienase/chaosflix/touch/browse/cast/CastServiceImpl.kt b/common/src/free/java/de/nicidienase/chaosflix/touch/browse/cast/CastServiceImpl.kt index b263746f..bd88d5db 100644 --- a/common/src/free/java/de/nicidienase/chaosflix/touch/browse/cast/CastServiceImpl.kt +++ b/common/src/free/java/de/nicidienase/chaosflix/touch/browse/cast/CastServiceImpl.kt @@ -7,10 +7,15 @@ import de.nicidienase.chaosflix.common.mediadata.entities.recording.persistence. import de.nicidienase.chaosflix.common.mediadata.entities.recording.persistence.Recording import de.nicidienase.chaosflix.common.mediadata.entities.streaming.StreamUrl import de.nicidienase.chaosflix.common.userdata.entities.progress.PlaybackProgress +import de.nicidienase.chaosflix.common.userdata.entities.progress.PlaybackProgressDao import de.nicidienase.chaosflix.touch.browse.streaming.StreamingItem +import kotlinx.coroutines.CoroutineScope @SuppressWarnings("unused") -class CastServiceImpl : CastService { +class CastServiceImpl( + playbackProgressDao: PlaybackProgressDao, + scope: CoroutineScope +) : CastService(playbackProgressDao, scope) { override val connected: Boolean = false diff --git a/common/src/main/java/de/nicidienase/chaosflix/touch/browse/cast/CastService.kt b/common/src/main/java/de/nicidienase/chaosflix/touch/browse/cast/CastService.kt index 10238247..cd5e0ce4 100644 --- a/common/src/main/java/de/nicidienase/chaosflix/touch/browse/cast/CastService.kt +++ b/common/src/main/java/de/nicidienase/chaosflix/touch/browse/cast/CastService.kt @@ -6,13 +6,18 @@ import de.nicidienase.chaosflix.common.mediadata.entities.recording.persistence. import de.nicidienase.chaosflix.common.mediadata.entities.recording.persistence.Recording import de.nicidienase.chaosflix.common.mediadata.entities.streaming.StreamUrl import de.nicidienase.chaosflix.common.userdata.entities.progress.PlaybackProgress +import de.nicidienase.chaosflix.common.userdata.entities.progress.PlaybackProgressDao import de.nicidienase.chaosflix.touch.browse.streaming.StreamingItem +import kotlinx.coroutines.CoroutineScope -interface CastService { - val connected: Boolean +abstract class CastService( + val playbackProgressDao: PlaybackProgressDao, + val scope: CoroutineScope +) { + abstract val connected: Boolean - fun attachToActivity(activity: AppCompatActivity) - fun castStream(streamingItem: StreamingItem, streamUrl: StreamUrl, contentKey: String) - fun loadMediaAndPlay(recording: Recording, event: Event, progress: PlaybackProgress?) - fun addMediaRouteMenuItem(menu: Menu) + abstract fun attachToActivity(activity: AppCompatActivity) + abstract fun castStream(streamingItem: StreamingItem, streamUrl: StreamUrl, contentKey: String) + abstract fun loadMediaAndPlay(recording: Recording, event: Event, progress: PlaybackProgress?) + abstract fun addMediaRouteMenuItem(menu: Menu) } diff --git a/common/src/noFree/java/de/nicidienase/chaosflix/touch/browse/cast/CastServiceImpl.kt b/common/src/noFree/java/de/nicidienase/chaosflix/touch/browse/cast/CastServiceImpl.kt index 9a414120..9d04900f 100644 --- a/common/src/noFree/java/de/nicidienase/chaosflix/touch/browse/cast/CastServiceImpl.kt +++ b/common/src/noFree/java/de/nicidienase/chaosflix/touch/browse/cast/CastServiceImpl.kt @@ -25,9 +25,9 @@ import pl.droidsonroids.casty.Casty import pl.droidsonroids.casty.MediaData class CastServiceImpl( - private val playbackProgressDao: PlaybackProgressDao, - private val scope: CoroutineScope -) : LifecycleObserver, CastService { + playbackProgressDao: PlaybackProgressDao, + scope: CoroutineScope +) : LifecycleObserver, CastService(playbackProgressDao, scope) { private var currentEvent: Event? = null