![]() |
Corgi Engine v9.3
|
Public Types | |
enum | PlaylistManagerStates { Idle , Playing , Paused } |
the possible states this playlist can be in More... | |
Public Member Functions | |
delegate void | PlaylistEvent () |
a delegate used to trigger events along the lifecycle of the playlist manager More... | |
virtual void | Play () |
Use this method to either play the first song of the playlist, or resume after a pause More... | |
virtual void | PlaySongAt (int songIndex) |
Plays the song at the specified index More... | |
virtual void | Pause () |
Pauses the current song More... | |
virtual void | Stop () |
Stops the song currently playing More... | |
virtual void | StopWithFade (bool withFade=true) |
Stops the current song, lets you specify whether or not to fade it out More... | |
virtual void | SetCurrentSongLoop (bool loop) |
Will change the current song's loop status More... | |
virtual void | PlayNextSong () |
Plays the next song in the playlist More... | |
virtual void | PlayPreviousSong () |
Plays the previous song in the playlist More... | |
virtual void | QueueSongAtIndex (int songIndex) |
Queues the song at the specified index to play once the currently playing song finishes More... | |
virtual void | ChangePlaylist (MMSMPlaylist newPlaylist) |
Changes the playlist for the specified one, doesn't play a song there, it'll play once the song currently playing ends More... | |
virtual void | ChangePlaylistAndPlay (MMSMPlaylist newPlaylist) |
Changes the playlist for the specified one, and plays its first song More... | |
virtual void | ResetPlayCount () |
resets all play counts (playlist and songs) More... | |
virtual void | SetVolumeMultiplier (float newVolumeMultiplier) |
Sets a new volume multiplier More... | |
virtual void | SetPitchMultiplier (float newPitchMultiplier) |
Sets a new pitch multiplier More... | |
virtual void | StartListening () |
Starts listening for events More... | |
virtual void | StopListening () |
Stops listening for events More... | |
Public Attributes | |
int | Channel = 0 |
the channel used to target this playlist manager by playlist remote or playlist feedbacks More... | |
MMSMPlaylist | Playlist |
the current playlist this manager will play More... | |
bool | PlayOnStart = false |
whether this playlist manager should auto play on start or not More... | |
float | VolumeMultiplier = 1f |
a global volume multiplier to apply when playing a song More... | |
float | PitchMultiplier = 1f |
a pitch multiplier to apply to all songs when playing them More... | |
bool | Persistent = false |
if this is true, this playlist manager will persist from scene to scene and will keep playing More... | |
bool | AutomaticallyUnparentOnAwake = true |
if this is true, this singleton will auto detach if it finds itself parented on awake More... | |
bool | AutoHandleApplicationPause = true |
if this is true, this playlist will automatically pause/resume OnApplicationPause, useful if you've prevented your game from running in the background More... | |
bool | FadeIn |
whether or not sounds should fade in when they start playing More... | |
bool | FadeOut |
whether or not sounds should fade out when they stop playing More... | |
float | FadeDuration = 1f |
the duration of the fade, in seconds More... | |
MMTweenType | FadeTween = new MMTweenType(MMTween.MMTweenCurve.EaseInCubic) |
the tween to use when fading the sound More... | |
bool | BindPitchToTimeScale = false |
whether or not the playlist manager should have its pitch multiplier value driven by the current timescale. If set to true, songs would appear to slow down when time is slowed down, and to speed up when time scale is higher than normal More... | |
Vector2 | TimescaleRemapFrom = new Vector2(0f,2f) |
the values to remap timescale from (min and max) - when timescale is equal to TimescaleRemapFrom.x, the pitch multiplier will be TimescaleRemapTo.x More... | |
Vector2 | TimescaleRemapTo = new Vector2(0.8f,1.2f) |
the values to remap timescale to (min and max) - when timescale is equal to TimescaleRemapFrom.x, the pitch multiplier will be TimescaleRemapTo.x More... | |
PlaylistManagerStates | DebugCurrentManagerState = PlaylistManagerStates.Idle |
the current state of the playlist, debug display only More... | |
int | CurrentSongIndex = -1 |
the index we're currently playing More... | |
string | CurrentSongName |
the name of the song that is currently playing More... | |
MMStateMachine< PlaylistManagerStates > | PlaylistManagerState |
the current state of this playlist More... | |
float | CurrentTime |
the time of the currently playing song More... | |
float | CurrentTimeLeft |
the time (in seconds) left on the song currently playing More... | |
float | CurrentClipDuration |
the total duration of the song currently playing More... | |
float | CurrentProgress = 0 |
the current normalized progress of the song currently playing More... | |
bool | PlayButton |
a play test button More... | |
bool | StopButton |
a stop test button More... | |
bool | PauseButton |
a pause test button More... | |
bool | PreviousButton |
a next song test button More... | |
bool | NextButton |
a next song test button More... | |
int | TargetSongIndex = 0 |
the index of the song to play when pressing the PlayTargetSong button More... | |
bool | TargetSongButton |
a next song test button More... | |
bool | QueueTargetSongButton |
a next song test button More... | |
bool | SetLoopTargetSongButton |
a next song test button More... | |
bool | StopLoopTargetSongButton |
a next song test button More... | |
MMSMPlaylist | TestPlaylist |
a playlist you can set to use with the SetTargetPlaylist and PlayTargetPlaylist buttons More... | |
bool | SetTargetPlaylistButton |
a test button used to set a new playlist More... | |
bool | PlayTargetPlaylistButton |
a test button used to play the target playlist More... | |
bool | ResetPlayCountButton |
a test button used to reset the play count More... | |
float | TestVolumeControl = 1f |
a slider used to test volume control More... | |
float | TestPlaybackSpeedControl = 1f |
a slider used to test speed control More... | |
PlaylistEvent | OnSongStart |
an event that gets triggered when a song starts More... | |
PlaylistEvent | OnSongEnd |
an event that gets triggered when a song ends More... | |
PlaylistEvent | OnPause |
an event that gets triggered when the playlist gets paused More... | |
PlaylistEvent | OnStop |
an event that gets triggered when the playlist gets stopped More... | |
PlaylistEvent | OnPlaylistChange |
an event that gets triggered when the playlist gets changed for another one More... | |
PlaylistEvent | OnPlaylistEnd |
an event that gets triggered when a playlist ends More... | |
Protected Member Functions | |
virtual void | Awake () |
On awake, we check if there's already a copy of the object in the scene. If there's one, we destroy it. More... | |
virtual void | InitializeSingleton () |
Initializes the singleton. More... | |
virtual void | Start () |
On Start we initialize our playlist More... | |
virtual void | Initialization () |
On init we initialize our state machine and start playing if needed More... | |
virtual void | InitializeRandomSeed () |
Initializes the random seed if needed More... | |
virtual void | InitializePlaylistManagerState () |
Inits the state machine More... | |
virtual void | ChangePlaylistManagerState (PlaylistManagerStates newManagerState) |
a method used to update the state machine More... | |
virtual void | Update () |
on update, self disables if needed, More... | |
virtual void | HandleTimescale () |
On update, we update our pitch multiplier to match our timescale if necessary More... | |
virtual void | UpdateTimeAndProgress () |
Updates the various time counters More... | |
virtual void | PlayFirstSong () |
Picks and plays the first song More... | |
virtual void | HandleEndOfSong () |
Detects end of song and moves on to the next one More... | |
virtual void | HandleNextSong (int direction, bool bypassLoop) |
Determines the next song to play and triggers the play More... | |
virtual void | HandleEndOfPlaylist () |
Handles the end of playlist, triggers a new one if needed More... | |
virtual void | SetTargetPlaylist () |
a debug method used by the inspector to set the target playlist More... | |
virtual void | PlayTargetPlaylist () |
a debug method used by the inspector to play the target playlist More... | |
virtual void | QueueTargetSong () |
a debug method used by the inspector to queue the specified song More... | |
virtual void | PlayTargetSong () |
a debug method used by the inspector to play the specified song More... | |
virtual void | SetCurrentSongToLoop () |
a test method used by the inspector debug button to force the current song from looping More... | |
virtual void | StopCurrentSongFromLooping () |
a test method used by the inspector debug button to prevent the current song from looping More... | |
virtual void | OnPlayEvent (int channel) |
virtual void | OnPauseEvent (int channel) |
virtual void | OnStopEvent (int channel) |
virtual void | OnPlayNextEvent (int channel) |
virtual void | OnPlayPreviousEvent (int channel) |
virtual void | OnPlayIndexEvent (int channel, int index) |
virtual void | OnMMPlaylistVolumeMultiplierEvent (int channel, float newVolumeMultiplier, bool applyVolumeMultiplierInstantly=false) |
virtual void | OnMMPlaylistPitchMultiplierEvent (int channel, float newPitchMultiplier, bool applyPitchMultiplierInstantly=false) |
virtual void | OnMMPlaylistChangeEvent (int channel, MMSMPlaylist newPlaylist, bool andPlay) |
virtual void | OnDestroy () |
on destroy we stop listening for events More... | |
virtual void | OnApplicationPause (bool pauseStatus) |
On ApplicationPause, we pause the playlist and resume it afterwards More... | |
Protected Attributes | |
bool | _shouldResumeOnApplicationPause = false |
int | _queuedSongIndex = -1 |
AudioSource | _currentlyPlayingAudioSource |
MMSoundManagerPlayOptions | _options |
float | _lastTestVolumeControl = 1f |
float | _lastTestPlaybackSpeedControl = 1f |
Static Protected Attributes | |
static MMSMPlaylistManager | _instance |
Properties | |
virtual bool | IsPlaying [get] |
whether or not this playlist manager is currently playing More... | |
static bool | HasInstance [get] |
static MMSMPlaylistManager | Current [get] |
static MMSMPlaylistManager | Instance [get] |
Singleton design pattern More... | |
|
protectedvirtual |
On awake, we check if there's already a copy of the object in the scene. If there's one, we destroy it.
|
virtual |
Changes the playlist for the specified one, doesn't play a song there, it'll play once the song currently playing ends
newPlaylist |
|
virtual |
Changes the playlist for the specified one, and plays its first song
newPlaylist |
|
protectedvirtual |
a method used to update the state machine
newManagerState |
|
protectedvirtual |
Handles the end of playlist, triggers a new one if needed
|
protectedvirtual |
Detects end of song and moves on to the next one
|
protectedvirtual |
Determines the next song to play and triggers the play
direction |
|
protectedvirtual |
On update, we update our pitch multiplier to match our timescale if necessary
|
protectedvirtual |
On init we initialize our state machine and start playing if needed
|
protectedvirtual |
Inits the state machine
|
protectedvirtual |
Initializes the random seed if needed
|
protectedvirtual |
Initializes the singleton.
|
protectedvirtual |
On ApplicationPause, we pause the playlist and resume it afterwards
pauseStatus |
|
protectedvirtual |
on destroy we stop listening for events
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
virtual |
Pauses the current song
|
virtual |
Use this method to either play the first song of the playlist, or resume after a pause
|
protectedvirtual |
Picks and plays the first song
delegate void MoreMountains.Tools.MMSMPlaylistManager.PlaylistEvent | ( | ) |
a delegate used to trigger events along the lifecycle of the playlist manager
|
virtual |
Plays the next song in the playlist
|
virtual |
Plays the previous song in the playlist
|
virtual |
Plays the song at the specified index
index |
|
protectedvirtual |
a debug method used by the inspector to play the target playlist
|
protectedvirtual |
a debug method used by the inspector to play the specified song
|
virtual |
Queues the song at the specified index to play once the currently playing song finishes
songIndex |
|
protectedvirtual |
a debug method used by the inspector to queue the specified song
|
virtual |
resets all play counts (playlist and songs)
|
virtual |
Will change the current song's loop status
|
protectedvirtual |
a test method used by the inspector debug button to force the current song from looping
|
virtual |
Sets a new pitch multiplier
newPitchMultiplier |
|
protectedvirtual |
a debug method used by the inspector to set the target playlist
|
virtual |
Sets a new volume multiplier
newVolumeMultiplier |
|
protectedvirtual |
On Start we initialize our playlist
|
virtual |
Starts listening for events
|
virtual |
Stops the song currently playing
|
protectedvirtual |
a test method used by the inspector debug button to prevent the current song from looping
|
virtual |
Stops listening for events
|
virtual |
Stops the current song, lets you specify whether or not to fade it out
|
protectedvirtual |
on update, self disables if needed,
|
protectedvirtual |
Updates the various time counters
|
protected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
bool MoreMountains.Tools.MMSMPlaylistManager.AutoHandleApplicationPause = true |
if this is true, this playlist will automatically pause/resume OnApplicationPause, useful if you've prevented your game from running in the background
bool MoreMountains.Tools.MMSMPlaylistManager.AutomaticallyUnparentOnAwake = true |
if this is true, this singleton will auto detach if it finds itself parented on awake
bool MoreMountains.Tools.MMSMPlaylistManager.BindPitchToTimeScale = false |
whether or not the playlist manager should have its pitch multiplier value driven by the current timescale. If set to true, songs would appear to slow down when time is slowed down, and to speed up when time scale is higher than normal
int MoreMountains.Tools.MMSMPlaylistManager.Channel = 0 |
the channel used to target this playlist manager by playlist remote or playlist feedbacks
float MoreMountains.Tools.MMSMPlaylistManager.CurrentClipDuration |
the total duration of the song currently playing
float MoreMountains.Tools.MMSMPlaylistManager.CurrentProgress = 0 |
the current normalized progress of the song currently playing
int MoreMountains.Tools.MMSMPlaylistManager.CurrentSongIndex = -1 |
the index we're currently playing
string MoreMountains.Tools.MMSMPlaylistManager.CurrentSongName |
the name of the song that is currently playing
float MoreMountains.Tools.MMSMPlaylistManager.CurrentTime |
the time of the currently playing song
float MoreMountains.Tools.MMSMPlaylistManager.CurrentTimeLeft |
the time (in seconds) left on the song currently playing
PlaylistManagerStates MoreMountains.Tools.MMSMPlaylistManager.DebugCurrentManagerState = PlaylistManagerStates.Idle |
the current state of the playlist, debug display only
float MoreMountains.Tools.MMSMPlaylistManager.FadeDuration = 1f |
the duration of the fade, in seconds
bool MoreMountains.Tools.MMSMPlaylistManager.FadeIn |
whether or not sounds should fade in when they start playing
bool MoreMountains.Tools.MMSMPlaylistManager.FadeOut |
whether or not sounds should fade out when they stop playing
MMTweenType MoreMountains.Tools.MMSMPlaylistManager.FadeTween = new MMTweenType(MMTween.MMTweenCurve.EaseInCubic) |
the tween to use when fading the sound
bool MoreMountains.Tools.MMSMPlaylistManager.NextButton |
a next song test button
PlaylistEvent MoreMountains.Tools.MMSMPlaylistManager.OnPause |
an event that gets triggered when the playlist gets paused
PlaylistEvent MoreMountains.Tools.MMSMPlaylistManager.OnPlaylistChange |
an event that gets triggered when the playlist gets changed for another one
PlaylistEvent MoreMountains.Tools.MMSMPlaylistManager.OnPlaylistEnd |
an event that gets triggered when a playlist ends
PlaylistEvent MoreMountains.Tools.MMSMPlaylistManager.OnSongEnd |
an event that gets triggered when a song ends
PlaylistEvent MoreMountains.Tools.MMSMPlaylistManager.OnSongStart |
an event that gets triggered when a song starts
PlaylistEvent MoreMountains.Tools.MMSMPlaylistManager.OnStop |
an event that gets triggered when the playlist gets stopped
bool MoreMountains.Tools.MMSMPlaylistManager.PauseButton |
a pause test button
bool MoreMountains.Tools.MMSMPlaylistManager.Persistent = false |
if this is true, this playlist manager will persist from scene to scene and will keep playing
float MoreMountains.Tools.MMSMPlaylistManager.PitchMultiplier = 1f |
a pitch multiplier to apply to all songs when playing them
bool MoreMountains.Tools.MMSMPlaylistManager.PlayButton |
a play test button
MMSMPlaylist MoreMountains.Tools.MMSMPlaylistManager.Playlist |
the current playlist this manager will play
MMStateMachine<PlaylistManagerStates> MoreMountains.Tools.MMSMPlaylistManager.PlaylistManagerState |
the current state of this playlist
bool MoreMountains.Tools.MMSMPlaylistManager.PlayOnStart = false |
whether this playlist manager should auto play on start or not
bool MoreMountains.Tools.MMSMPlaylistManager.PlayTargetPlaylistButton |
a test button used to play the target playlist
bool MoreMountains.Tools.MMSMPlaylistManager.PreviousButton |
a next song test button
bool MoreMountains.Tools.MMSMPlaylistManager.QueueTargetSongButton |
a next song test button
bool MoreMountains.Tools.MMSMPlaylistManager.ResetPlayCountButton |
a test button used to reset the play count
bool MoreMountains.Tools.MMSMPlaylistManager.SetLoopTargetSongButton |
a next song test button
bool MoreMountains.Tools.MMSMPlaylistManager.SetTargetPlaylistButton |
a test button used to set a new playlist
bool MoreMountains.Tools.MMSMPlaylistManager.StopButton |
a stop test button
bool MoreMountains.Tools.MMSMPlaylistManager.StopLoopTargetSongButton |
a next song test button
bool MoreMountains.Tools.MMSMPlaylistManager.TargetSongButton |
a next song test button
int MoreMountains.Tools.MMSMPlaylistManager.TargetSongIndex = 0 |
the index of the song to play when pressing the PlayTargetSong button
float MoreMountains.Tools.MMSMPlaylistManager.TestPlaybackSpeedControl = 1f |
a slider used to test speed control
MMSMPlaylist MoreMountains.Tools.MMSMPlaylistManager.TestPlaylist |
a playlist you can set to use with the SetTargetPlaylist and PlayTargetPlaylist buttons
float MoreMountains.Tools.MMSMPlaylistManager.TestVolumeControl = 1f |
a slider used to test volume control
Vector2 MoreMountains.Tools.MMSMPlaylistManager.TimescaleRemapFrom = new Vector2(0f,2f) |
the values to remap timescale from (min and max) - when timescale is equal to TimescaleRemapFrom.x, the pitch multiplier will be TimescaleRemapTo.x
Vector2 MoreMountains.Tools.MMSMPlaylistManager.TimescaleRemapTo = new Vector2(0.8f,1.2f) |
the values to remap timescale to (min and max) - when timescale is equal to TimescaleRemapFrom.x, the pitch multiplier will be TimescaleRemapTo.x
float MoreMountains.Tools.MMSMPlaylistManager.VolumeMultiplier = 1f |
a global volume multiplier to apply when playing a song
|
staticget |
|
staticget |
|
staticget |
Singleton design pattern
The instance.
|
get |
whether or not this playlist manager is currently playing