Rename none state to idle.

This commit is contained in:
Ryan Heise 2020-12-16 18:52:21 +11:00
parent 9b27508c7b
commit 768fde91aa
3 changed files with 7 additions and 7 deletions

View File

@ -636,7 +636,7 @@ class AudioPlayer {
/// timestamps. If [start] is null, it will be reset to the start of the /// timestamps. If [start] is null, it will be reset to the start of the
/// original [AudioSource]. If [end] is null, it will be reset to the end of /// original [AudioSource]. If [end] is null, it will be reset to the end of
/// the original [AudioSource]. This method cannot be called from the /// the original [AudioSource]. This method cannot be called from the
/// [AudioPlaybackState.none] state. /// [ProcessingState.idle] state.
Future<Duration> setClip({Duration start, Duration end}) async { Future<Duration> setClip({Duration start, Duration end}) async {
if (_disposed) return null; if (_disposed) return null;
_setPlatformActive(true); _setPlatformActive(true);
@ -1037,7 +1037,7 @@ class PlaybackEvent {
final int androidAudioSessionId; final int androidAudioSessionId;
PlaybackEvent({ PlaybackEvent({
this.processingState = ProcessingState.none, this.processingState = ProcessingState.idle,
DateTime updateTime, DateTime updateTime,
this.updatePosition = Duration.zero, this.updatePosition = Duration.zero,
this.bufferedPosition = Duration.zero, this.bufferedPosition = Duration.zero,
@ -1078,7 +1078,7 @@ class PlaybackEvent {
/// Enumerates the different processing states of a player. /// Enumerates the different processing states of a player.
enum ProcessingState { enum ProcessingState {
/// The player has not loaded an [AudioSource]. /// The player has not loaded an [AudioSource].
none, idle,
/// The player is loading an [AudioSource]. /// The player is loading an [AudioSource].
loading, loading,
@ -1949,7 +1949,7 @@ class _IdleAudioPlayer extends AudioPlayerPlatform {
_broadcastPlaybackEvent() { _broadcastPlaybackEvent() {
var updateTime = DateTime.now(); var updateTime = DateTime.now();
_eventSubject.add(PlaybackEventMessage( _eventSubject.add(PlaybackEventMessage(
processingState: ProcessingStateMessage.none, processingState: ProcessingStateMessage.idle,
updatePosition: _position, updatePosition: _position,
updateTime: updateTime, updateTime: updateTime,
bufferedPosition: Duration.zero, bufferedPosition: Duration.zero,

View File

@ -201,7 +201,7 @@ class PlaybackEventMessage {
/// A processing state communicated from the platform implementation. /// A processing state communicated from the platform implementation.
enum ProcessingStateMessage { enum ProcessingStateMessage {
none, idle,
loading, loading,
buffering, buffering,
ready, ready,

View File

@ -37,7 +37,7 @@ class JustAudioPlugin extends JustAudioPlatform {
abstract class JustAudioPlayer extends AudioPlayerPlatform { abstract class JustAudioPlayer extends AudioPlayerPlatform {
final eventController = StreamController<PlaybackEventMessage>(); final eventController = StreamController<PlaybackEventMessage>();
ProcessingStateMessage _processingState = ProcessingStateMessage.none; ProcessingStateMessage _processingState = ProcessingStateMessage.idle;
bool _playing = false; bool _playing = false;
int _index; int _index;
@ -393,7 +393,7 @@ class Html5AudioPlayer extends JustAudioPlayer {
_currentAudioSourcePlayer?.pause(); _currentAudioSourcePlayer?.pause();
_audioElement.removeAttribute('src'); _audioElement.removeAttribute('src');
_audioElement.load(); _audioElement.load();
transition(ProcessingStateMessage.none); transition(ProcessingStateMessage.idle);
return await super.release(); return await super.release();
} }