Move everything to playback package
This commit is contained in:
parent
88b0b1aba4
commit
45da77bd07
22 changed files with 35 additions and 35 deletions
|
@ -160,7 +160,7 @@
|
|||
android:parentActivityName=".activities.TrackActivity" />
|
||||
|
||||
<service
|
||||
android:name=".services.playback.PlaybackService"
|
||||
android:name=".playback.PlaybackService"
|
||||
android:exported="true"
|
||||
android:foregroundServiceType="mediaPlayback">
|
||||
<intent-filter>
|
||||
|
|
|
@ -15,7 +15,7 @@ import com.simplemobiletools.commons.views.MySeekBar
|
|||
import com.simplemobiletools.musicplayer.R
|
||||
import com.simplemobiletools.musicplayer.extensions.config
|
||||
import com.simplemobiletools.musicplayer.helpers.EQUALIZER_PRESET_CUSTOM
|
||||
import com.simplemobiletools.musicplayer.services.playback.SimpleEqualizer
|
||||
import com.simplemobiletools.musicplayer.playback.SimpleEqualizer
|
||||
import kotlinx.android.synthetic.main.activity_equalizer.*
|
||||
import kotlinx.android.synthetic.main.equalizer_band.view.*
|
||||
import java.text.DecimalFormat
|
||||
|
|
|
@ -31,7 +31,7 @@ import com.simplemobiletools.musicplayer.fragments.MyViewPagerFragment
|
|||
import com.simplemobiletools.musicplayer.helpers.*
|
||||
import com.simplemobiletools.musicplayer.helpers.M3uImporter.ImportResult
|
||||
import com.simplemobiletools.musicplayer.models.Events
|
||||
import com.simplemobiletools.musicplayer.services.playback.CustomCommands
|
||||
import com.simplemobiletools.musicplayer.playback.CustomCommands
|
||||
import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.fragment_albums.albums_fragment_holder
|
||||
import kotlinx.android.synthetic.main.fragment_artists.artists_fragment_holder
|
||||
|
|
|
@ -15,7 +15,7 @@ import com.simplemobiletools.musicplayer.extensions.sendCommand
|
|||
import com.simplemobiletools.musicplayer.helpers.SHOW_FILENAME_ALWAYS
|
||||
import com.simplemobiletools.musicplayer.helpers.SHOW_FILENAME_IF_UNAVAILABLE
|
||||
import com.simplemobiletools.musicplayer.helpers.SHOW_FILENAME_NEVER
|
||||
import com.simplemobiletools.musicplayer.services.playback.CustomCommands
|
||||
import com.simplemobiletools.musicplayer.playback.CustomCommands
|
||||
import kotlinx.android.synthetic.main.activity_settings.*
|
||||
import java.util.Locale
|
||||
import kotlin.system.exitProcess
|
||||
|
|
|
@ -16,8 +16,8 @@ import com.simplemobiletools.musicplayer.helpers.SimpleMediaController
|
|||
import com.simplemobiletools.musicplayer.models.Events
|
||||
import com.simplemobiletools.musicplayer.models.Track
|
||||
import com.simplemobiletools.musicplayer.models.toMediaItems
|
||||
import com.simplemobiletools.musicplayer.services.playback.CustomCommands
|
||||
import com.simplemobiletools.musicplayer.services.playback.PlaybackService.Companion.updatePlaybackInfo
|
||||
import com.simplemobiletools.musicplayer.playback.CustomCommands
|
||||
import com.simplemobiletools.musicplayer.playback.PlaybackService.Companion.updatePlaybackInfo
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
import java.io.File
|
||||
|
||||
|
|
|
@ -30,8 +30,8 @@ import com.simplemobiletools.musicplayer.fragments.PlaybackSpeedFragment
|
|||
import com.simplemobiletools.musicplayer.helpers.*
|
||||
import com.simplemobiletools.musicplayer.interfaces.PlaybackSpeedListener
|
||||
import com.simplemobiletools.musicplayer.models.Track
|
||||
import com.simplemobiletools.musicplayer.services.playback.CustomCommands
|
||||
import com.simplemobiletools.musicplayer.services.playback.PlaybackService
|
||||
import com.simplemobiletools.musicplayer.playback.CustomCommands
|
||||
import com.simplemobiletools.musicplayer.playback.PlaybackService
|
||||
import kotlinx.android.synthetic.main.activity_track.*
|
||||
import java.text.DecimalFormat
|
||||
import kotlin.math.min
|
||||
|
|
|
@ -14,7 +14,7 @@ import com.simplemobiletools.commons.helpers.IS_CUSTOMIZING_COLORS
|
|||
import com.simplemobiletools.musicplayer.R
|
||||
import com.simplemobiletools.musicplayer.extensions.config
|
||||
import com.simplemobiletools.musicplayer.helpers.MyWidgetProvider
|
||||
import com.simplemobiletools.musicplayer.services.playback.PlaybackService
|
||||
import com.simplemobiletools.musicplayer.playback.PlaybackService
|
||||
import kotlinx.android.synthetic.main.widget.song_info_artist
|
||||
import kotlinx.android.synthetic.main.widget.song_info_title
|
||||
import kotlinx.android.synthetic.main.widget.view.widget_background
|
||||
|
|
|
@ -16,7 +16,7 @@ import com.simplemobiletools.musicplayer.activities.SimpleControllerActivity
|
|||
import com.simplemobiletools.musicplayer.extensions.*
|
||||
import com.simplemobiletools.musicplayer.helpers.TagHelper
|
||||
import com.simplemobiletools.musicplayer.models.Track
|
||||
import com.simplemobiletools.musicplayer.services.playback.PlaybackService
|
||||
import com.simplemobiletools.musicplayer.playback.PlaybackService
|
||||
|
||||
abstract class BaseMusicAdapter<Type>(
|
||||
var items: ArrayList<Type>,
|
||||
|
|
|
@ -17,7 +17,7 @@ import com.simplemobiletools.musicplayer.R
|
|||
import com.simplemobiletools.musicplayer.activities.SimpleActivity
|
||||
import com.simplemobiletools.musicplayer.extensions.*
|
||||
import com.simplemobiletools.musicplayer.models.Track
|
||||
import com.simplemobiletools.musicplayer.services.playback.PlaybackService
|
||||
import com.simplemobiletools.musicplayer.playback.PlaybackService
|
||||
import kotlinx.android.synthetic.main.item_track_queue.view.track_queue_drag_handle
|
||||
import kotlinx.android.synthetic.main.item_track_queue.view.track_queue_duration
|
||||
import kotlinx.android.synthetic.main.item_track_queue.view.track_queue_frame
|
||||
|
|
|
@ -3,7 +3,7 @@ package com.simplemobiletools.musicplayer.extensions
|
|||
import androidx.media3.common.MediaItem
|
||||
import androidx.media3.common.Player
|
||||
import com.simplemobiletools.musicplayer.helpers.PlaybackSetting
|
||||
import com.simplemobiletools.musicplayer.services.playback.player.PlayerListener
|
||||
import com.simplemobiletools.musicplayer.playback.player.PlayerListener
|
||||
|
||||
val Player.isReallyPlaying: Boolean
|
||||
get() = when (playbackState) {
|
||||
|
|
|
@ -22,7 +22,7 @@ import com.simplemobiletools.musicplayer.extensions.broadcastUpdateWidgetState
|
|||
import com.simplemobiletools.musicplayer.extensions.config
|
||||
import com.simplemobiletools.musicplayer.extensions.queueDAO
|
||||
import com.simplemobiletools.musicplayer.extensions.togglePlayback
|
||||
import com.simplemobiletools.musicplayer.services.playback.PlaybackService
|
||||
import com.simplemobiletools.musicplayer.playback.PlaybackService
|
||||
|
||||
class MyWidgetProvider : AppWidgetProvider() {
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ import com.google.common.util.concurrent.ListenableFuture
|
|||
import com.google.common.util.concurrent.MoreExecutors
|
||||
import com.simplemobiletools.musicplayer.extensions.getOrNull
|
||||
import com.simplemobiletools.musicplayer.extensions.runOnPlayerThread
|
||||
import com.simplemobiletools.musicplayer.services.playback.PlaybackService
|
||||
import com.simplemobiletools.musicplayer.playback.PlaybackService
|
||||
import java.util.concurrent.Executors
|
||||
|
||||
class SimpleMediaController(val context: Context, val listener: Listener? = null) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package com.simplemobiletools.musicplayer.services.playback
|
||||
package com.simplemobiletools.musicplayer.playback
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
|
@ -1,4 +1,4 @@
|
|||
package com.simplemobiletools.musicplayer.services.playback
|
||||
package com.simplemobiletools.musicplayer.playback
|
||||
|
||||
import android.os.Bundle
|
||||
import android.os.ConditionVariable
|
|
@ -1,4 +1,4 @@
|
|||
package com.simplemobiletools.musicplayer.services.playback
|
||||
package com.simplemobiletools.musicplayer.playback
|
||||
|
||||
import android.os.Handler
|
||||
import android.os.HandlerThread
|
||||
|
@ -14,10 +14,10 @@ import com.simplemobiletools.musicplayer.extensions.isReallyPlaying
|
|||
import com.simplemobiletools.musicplayer.extensions.nextMediaItem
|
||||
import com.simplemobiletools.musicplayer.helpers.NotificationHelper
|
||||
import com.simplemobiletools.musicplayer.helpers.getPermissionToRequest
|
||||
import com.simplemobiletools.musicplayer.services.playback.library.MediaItemProvider
|
||||
import com.simplemobiletools.musicplayer.services.playback.player.PlayerListener
|
||||
import com.simplemobiletools.musicplayer.services.playback.player.SimpleMusicPlayer
|
||||
import com.simplemobiletools.musicplayer.services.playback.player.initializeSessionAndPlayer
|
||||
import com.simplemobiletools.musicplayer.playback.library.MediaItemProvider
|
||||
import com.simplemobiletools.musicplayer.playback.player.PlayerListener
|
||||
import com.simplemobiletools.musicplayer.playback.player.SimpleMusicPlayer
|
||||
import com.simplemobiletools.musicplayer.playback.player.initializeSessionAndPlayer
|
||||
|
||||
@OptIn(UnstableApi::class)
|
||||
class PlaybackService : MediaLibraryService() {
|
|
@ -1,4 +1,4 @@
|
|||
package com.simplemobiletools.musicplayer.services.playback
|
||||
package com.simplemobiletools.musicplayer.playback
|
||||
|
||||
import android.content.Context
|
||||
import android.media.audiofx.Equalizer
|
||||
|
@ -9,7 +9,7 @@ import com.simplemobiletools.commons.extensions.toast
|
|||
import com.simplemobiletools.musicplayer.R
|
||||
import com.simplemobiletools.musicplayer.extensions.config
|
||||
import com.simplemobiletools.musicplayer.helpers.EQUALIZER_PRESET_CUSTOM
|
||||
import com.simplemobiletools.musicplayer.services.playback.player.SimpleMusicPlayer
|
||||
import com.simplemobiletools.musicplayer.playback.player.SimpleMusicPlayer
|
||||
|
||||
@UnstableApi
|
||||
object SimpleEqualizer {
|
|
@ -1,4 +1,4 @@
|
|||
package com.simplemobiletools.musicplayer.services.playback
|
||||
package com.simplemobiletools.musicplayer.playback
|
||||
|
||||
import android.os.CountDownTimer
|
||||
import com.simplemobiletools.musicplayer.extensions.config
|
|
@ -1,4 +1,4 @@
|
|||
package com.simplemobiletools.musicplayer.services.playback.library
|
||||
package com.simplemobiletools.musicplayer.playback.library
|
||||
|
||||
import android.content.ContentResolver
|
||||
import android.content.Context
|
|
@ -1,4 +1,4 @@
|
|||
package com.simplemobiletools.musicplayer.services.playback.player
|
||||
package com.simplemobiletools.musicplayer.playback.player
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Handler
|
|
@ -1,6 +1,6 @@
|
|||
@file:UnstableApi
|
||||
|
||||
package com.simplemobiletools.musicplayer.services.playback.player
|
||||
package com.simplemobiletools.musicplayer.playback.player
|
||||
|
||||
import android.app.PendingIntent
|
||||
import android.content.Context
|
||||
|
@ -16,10 +16,10 @@ import com.simplemobiletools.musicplayer.activities.MainActivity
|
|||
import com.simplemobiletools.musicplayer.extensions.config
|
||||
import com.simplemobiletools.musicplayer.extensions.setRepeatMode
|
||||
import com.simplemobiletools.musicplayer.helpers.SEEK_INTERVAL_MS
|
||||
import com.simplemobiletools.musicplayer.services.playback.PlaybackService
|
||||
import com.simplemobiletools.musicplayer.services.playback.SimpleEqualizer
|
||||
import com.simplemobiletools.musicplayer.services.playback.getCustomLayout
|
||||
import com.simplemobiletools.musicplayer.services.playback.getMediaSessionCallback
|
||||
import com.simplemobiletools.musicplayer.playback.PlaybackService
|
||||
import com.simplemobiletools.musicplayer.playback.SimpleEqualizer
|
||||
import com.simplemobiletools.musicplayer.playback.getCustomLayout
|
||||
import com.simplemobiletools.musicplayer.playback.getMediaSessionCallback
|
||||
|
||||
private const val PLAYER_THREAD = "PlayerThread"
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.simplemobiletools.musicplayer.services.playback.player
|
||||
package com.simplemobiletools.musicplayer.playback.player
|
||||
|
||||
import android.widget.Toast
|
||||
import androidx.media3.common.MediaItem
|
||||
|
@ -11,8 +11,8 @@ import com.simplemobiletools.musicplayer.extensions.broadcastUpdateWidgetState
|
|||
import com.simplemobiletools.musicplayer.extensions.config
|
||||
import com.simplemobiletools.musicplayer.extensions.currentMediaItems
|
||||
import com.simplemobiletools.musicplayer.helpers.PlaybackSetting
|
||||
import com.simplemobiletools.musicplayer.services.playback.PlaybackService
|
||||
import com.simplemobiletools.musicplayer.services.playback.PlaybackService.Companion.updatePlaybackInfo
|
||||
import com.simplemobiletools.musicplayer.playback.PlaybackService
|
||||
import com.simplemobiletools.musicplayer.playback.PlaybackService.Companion.updatePlaybackInfo
|
||||
|
||||
@UnstableApi
|
||||
class PlayerListener(private val context: PlaybackService) : Player.Listener {
|
|
@ -1,4 +1,4 @@
|
|||
package com.simplemobiletools.musicplayer.services.playback.player
|
||||
package com.simplemobiletools.musicplayer.playback.player
|
||||
|
||||
import androidx.media3.common.ForwardingPlayer
|
||||
import androidx.media3.common.Player
|
Loading…
Reference in a new issue