Skip to content

Commit

Permalink
document RepeatMode and get NewpPlayer to compile again
Browse files Browse the repository at this point in the history
  • Loading branch information
theScrabi committed Oct 18, 2024
1 parent 28e8799 commit 2cfd931
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ import net.newpipe.newplayer.logic.ActionResponse
import net.newpipe.newplayer.data.Chapter
import net.newpipe.newplayer.logic.MediaSourceBuilder
import net.newpipe.newplayer.data.NewPlayerException
import net.newpipe.newplayer.data.PlayMode
import net.newpipe.newplayer.data.RepeatMode
import net.newpipe.newplayer.logic.NoResponse
import net.newpipe.newplayer.logic.StreamExceptionResponse
import net.newpipe.newplayer.data.StreamSelection
Expand Down
17 changes: 17 additions & 0 deletions new-player/src/main/java/net/newpipe/newplayer/data/RepeatMode.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,25 @@

package net.newpipe.newplayer.data


import net.newpipe.newplayer.data.PlayMode.IDLE
/**
* The playlist repeat mode.
*/
enum class RepeatMode {
/**
* Don't repeat. Quit playback and switch to [IDLE] mode after being done playing the active
* playlist.
*/
DO_NOT_REPEAT,

/**
* Repeats the currently active playlist after playing the last item of the playlist.
*/
REPEAT_ALL,

/**
* Keeps repeating the current item of a playlist.
*/
REPEAT_ONE
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.launch
import net.newpipe.newplayer.NewPlayer
import net.newpipe.newplayer.PlayMode
import net.newpipe.newplayer.data.PlayMode
import javax.inject.Inject

private const val TAG = "NewPlayerService"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.res.stringResource
import androidx.media3.common.util.UnstableApi
import net.newpipe.newplayer.R
import net.newpipe.newplayer.RepeatMode
import net.newpipe.newplayer.data.RepeatMode

import net.newpipe.newplayer.uiModel.NewPlayerUIState
import net.newpipe.newplayer.uiModel.InternalNewPlayerViewModel

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import androidx.media3.common.MediaItem
import androidx.media3.common.MediaMetadata
import androidx.media3.common.util.UnstableApi
import net.newpipe.newplayer.data.Chapter
import net.newpipe.newplayer.RepeatMode
import net.newpipe.newplayer.ui.ContentScale
import net.newpipe.newplayer.data.AudioStreamTrack
import net.newpipe.newplayer.data.RepeatMode
import net.newpipe.newplayer.data.StreamTrack
import net.newpipe.newplayer.data.VideoStreamTrack

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ import kotlinx.coroutines.launch
import net.newpipe.newplayer.data.VideoSize
import net.newpipe.newplayer.NewPlayer
import net.newpipe.newplayer.data.NewPlayerException
import net.newpipe.newplayer.PlayMode
import net.newpipe.newplayer.RepeatMode
import net.newpipe.newplayer.data.PlayMode
import net.newpipe.newplayer.data.RepeatMode
import net.newpipe.newplayer.ui.ContentScale
import java.util.LinkedList
import kotlin.math.abs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

package net.newpipe.newplayer.uiModel

import net.newpipe.newplayer.PlayMode
import net.newpipe.newplayer.data.PlayMode

enum class UIModeState {
PLACEHOLDER,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import kotlinx.coroutines.flow.update
import kotlinx.coroutines.launch
import net.newpipe.newplayer.ActivityBrainSlug
import net.newpipe.newplayer.NewPlayer
import net.newpipe.newplayer.PlayMode
import net.newpipe.newplayer.data.PlayMode
import net.newpipe.newplayer.uiModel.NewPlayerViewModel
import net.newpipe.newplayer.uiModel.NewPlayerViewModelImpl
import net.newpipe.newplayer.uiModel.UIModeState
Expand Down

0 comments on commit 2cfd931

Please sign in to comment.