Search in sources :

Example 1 with PlaybackReporter

use of com.doctoror.fuckoffmusicplayer.domain.reporter.PlaybackReporter in project PainlessMusicPlayer by Doctoror.

the class MediaSessionHolderImpl method reportMediaAndState.

@WorkerThread
private void reportMediaAndState(@NonNull final MediaSessionCompat mediaSession) {
    final PlaybackReporter playbackReporter = playbackReporterFactory.newMediaSessionReporter(mediaSession);
    final int position = playbackData.getQueuePosition();
    final Media current = CollectionUtils.getItemSafe(playbackData.getQueue(), position);
    if (current != null) {
        playbackReporter.reportTrackChanged(current, position);
    }
    playbackReporter.reportPlaybackStateChanged(playbackData.getPlaybackState(), null);
}
Also used : PlaybackReporter(com.doctoror.fuckoffmusicplayer.domain.reporter.PlaybackReporter) Media(com.doctoror.fuckoffmusicplayer.domain.queue.Media) WorkerThread(android.support.annotation.WorkerThread)

Aggregations

WorkerThread (android.support.annotation.WorkerThread)1 Media (com.doctoror.fuckoffmusicplayer.domain.queue.Media)1 PlaybackReporter (com.doctoror.fuckoffmusicplayer.domain.reporter.PlaybackReporter)1