/// <summary> /// On disable, stops listening for playlist events /// </summary> protected virtual void OnDisable() { MMPlaylistPauseEvent.Unregister(OnPauseEvent); MMPlaylistPlayEvent.Unregister(OnPlayEvent); MMPlaylistPlayNextEvent.Unregister(OnPlayNextEvent); MMPlaylistStopEvent.Unregister(OnStopEvent); MMPlaylistPlayIndexEvent.Unregister(OnPlayIndexEvent); }
/// <summary> /// On enable, starts listening for playlist events /// </summary> protected virtual void OnEnable() { MMPlaylistPauseEvent.Register(OnPauseEvent); MMPlaylistPlayEvent.Register(OnPlayEvent); MMPlaylistPlayNextEvent.Register(OnPlayNextEvent); MMPlaylistPlayPreviousEvent.Register(OnPlayPreviousEvent); MMPlaylistStopEvent.Register(OnStopEvent); MMPlaylistPlayIndexEvent.Register(OnPlayIndexEvent); }
/// <summary> /// Plays the next track in the playlist /// </summary> public virtual void PlayNextTrack() { MMPlaylistPlayNextEvent.Trigger(); }