Use this class to play audiosources (usually background music but feel free to use that for anything) in sequence, with optional crossfade between songs
More...
|
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 | ChangePlaylistState (PlaylistStates newState) |
|
virtual void | PlayFirstSong () |
| Picks and plays the first song More...
|
|
virtual IEnumerator | PlaySong (int index) |
| Plays a new song in the playlist, and stops / fades the previous one More...
|
|
virtual IEnumerator | Fade (int index, float duration, float initialVolume, float endVolume, bool stopAtTheEnd) |
| Fades an audiosource in or out, optionnally stopping it at the end More...
|
|
virtual int | PickNextIndex () |
| Picks the next song to play More...
|
|
virtual int | PickPreviousIndex () |
| Picks the previous song to play More...
|
|
virtual void | PlayTargetSong () |
|
virtual void | QueueTargetSong () |
|
virtual void | SetLoopTargetSong () |
|
virtual void | StopLoopTargetSong () |
|
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 | OnEnable () |
| On enable, starts listening for playlist events More...
|
|
virtual void | OnDisable () |
| On disable, stops listening for playlist events More...
|
|
virtual void | OnValidate () |
| On Validate, we check if our array has changed and if yes we initialize our new elements More...
|
|
virtual void | OnApplicationPause (bool pauseStatus) |
| On ApplicationPause, we pause the playlist and resume it afterwards More...
|
|
Use this class to play audiosources (usually background music but feel free to use that for anything) in sequence, with optional crossfade between songs
◆ PlaylistStates
the possible states this playlist can be in
Enumerator |
---|
Idle | |
Playing | |
Paused | |
◆ Awake()
virtual void MoreMountains.Tools.MMPlaylist.Awake |
( |
| ) |
|
|
protectedvirtual |
On awake, we check if there's already a copy of the object in the scene. If there's one, we destroy it.
◆ ChangePlaylistState()
virtual void MoreMountains.Tools.MMPlaylist.ChangePlaylistState |
( |
PlaylistStates |
newState | ) |
|
|
protectedvirtual |
◆ Fade()
virtual IEnumerator MoreMountains.Tools.MMPlaylist.Fade |
( |
int |
index, |
|
|
float |
duration, |
|
|
float |
initialVolume, |
|
|
float |
endVolume, |
|
|
bool |
stopAtTheEnd |
|
) |
| |
|
protectedvirtual |
Fades an audiosource in or out, optionnally stopping it at the end
- Parameters
-
source | |
duration | |
initialVolume | |
endVolume | |
stopAtTheEnd | |
- Returns
◆ Initialization()
virtual void MoreMountains.Tools.MMPlaylist.Initialization |
( |
| ) |
|
|
protectedvirtual |
On init we initialize our state machine and start playing if needed
◆ InitializeSingleton()
virtual void MoreMountains.Tools.MMPlaylist.InitializeSingleton |
( |
| ) |
|
|
protectedvirtual |
Initializes the singleton.
◆ OnApplicationPause()
virtual void MoreMountains.Tools.MMPlaylist.OnApplicationPause |
( |
bool |
pauseStatus | ) |
|
|
protectedvirtual |
On ApplicationPause, we pause the playlist and resume it afterwards
- Parameters
-
◆ OnDisable()
virtual void MoreMountains.Tools.MMPlaylist.OnDisable |
( |
| ) |
|
|
protectedvirtual |
On disable, stops listening for playlist events
◆ OnEnable()
virtual void MoreMountains.Tools.MMPlaylist.OnEnable |
( |
| ) |
|
|
protectedvirtual |
On enable, starts listening for playlist events
◆ OnMMPlaylistVolumeMultiplierEvent()
virtual void MoreMountains.Tools.MMPlaylist.OnMMPlaylistVolumeMultiplierEvent |
( |
int |
channel, |
|
|
float |
newVolumeMultiplier, |
|
|
bool |
applyVolumeMultiplierInstantly = false |
|
) |
| |
|
protectedvirtual |
◆ OnPauseEvent()
virtual void MoreMountains.Tools.MMPlaylist.OnPauseEvent |
( |
int |
channel | ) |
|
|
protectedvirtual |
◆ OnPlayEvent()
virtual void MoreMountains.Tools.MMPlaylist.OnPlayEvent |
( |
int |
channel | ) |
|
|
protectedvirtual |
◆ OnPlayIndexEvent()
virtual void MoreMountains.Tools.MMPlaylist.OnPlayIndexEvent |
( |
int |
channel, |
|
|
int |
index |
|
) |
| |
|
protectedvirtual |
◆ OnPlayNextEvent()
virtual void MoreMountains.Tools.MMPlaylist.OnPlayNextEvent |
( |
int |
channel | ) |
|
|
protectedvirtual |
◆ OnPlayPreviousEvent()
virtual void MoreMountains.Tools.MMPlaylist.OnPlayPreviousEvent |
( |
int |
channel | ) |
|
|
protectedvirtual |
◆ OnStopEvent()
virtual void MoreMountains.Tools.MMPlaylist.OnStopEvent |
( |
int |
channel | ) |
|
|
protectedvirtual |
◆ OnValidate()
virtual void MoreMountains.Tools.MMPlaylist.OnValidate |
( |
| ) |
|
|
protectedvirtual |
On Validate, we check if our array has changed and if yes we initialize our new elements
◆ Pause()
virtual void MoreMountains.Tools.MMPlaylist.Pause |
( |
| ) |
|
|
virtual |
◆ PickNextIndex()
virtual int MoreMountains.Tools.MMPlaylist.PickNextIndex |
( |
| ) |
|
|
protectedvirtual |
Picks the next song to play
- Returns
◆ PickPreviousIndex()
virtual int MoreMountains.Tools.MMPlaylist.PickPreviousIndex |
( |
| ) |
|
|
protectedvirtual |
Picks the previous song to play
- Returns
◆ Play()
virtual void MoreMountains.Tools.MMPlaylist.Play |
( |
| ) |
|
|
virtual |
Plays either the first song or resumes playing a paused one
◆ PlayAtIndex()
virtual void MoreMountains.Tools.MMPlaylist.PlayAtIndex |
( |
int |
songIndex | ) |
|
|
virtual |
◆ PlayFirstSong()
virtual void MoreMountains.Tools.MMPlaylist.PlayFirstSong |
( |
| ) |
|
|
protectedvirtual |
Picks and plays the first song
◆ PlayNextSong()
virtual void MoreMountains.Tools.MMPlaylist.PlayNextSong |
( |
| ) |
|
|
virtual |
Plays the next song in the playlist
◆ PlayPreviousSong()
virtual void MoreMountains.Tools.MMPlaylist.PlayPreviousSong |
( |
| ) |
|
|
virtual |
Plays the previous song in the playlist
◆ PlaySong()
virtual IEnumerator MoreMountains.Tools.MMPlaylist.PlaySong |
( |
int |
index | ) |
|
|
protectedvirtual |
Plays a new song in the playlist, and stops / fades the previous one
- Parameters
-
- Returns
◆ PlayTargetSong()
virtual void MoreMountains.Tools.MMPlaylist.PlayTargetSong |
( |
| ) |
|
|
protectedvirtual |
◆ QueueSongAtIndex()
virtual void MoreMountains.Tools.MMPlaylist.QueueSongAtIndex |
( |
int |
songIndex | ) |
|
|
virtual |
◆ QueueTargetSong()
virtual void MoreMountains.Tools.MMPlaylist.QueueTargetSong |
( |
| ) |
|
|
protectedvirtual |
◆ SetLoop()
virtual void MoreMountains.Tools.MMPlaylist.SetLoop |
( |
bool |
loop | ) |
|
|
virtual |
Will change the current track loop status
◆ SetLoopTargetSong()
virtual void MoreMountains.Tools.MMPlaylist.SetLoopTargetSong |
( |
| ) |
|
|
protectedvirtual |
◆ Start()
virtual void MoreMountains.Tools.MMPlaylist.Start |
( |
| ) |
|
|
protectedvirtual |
On Start we initialize our playlist
◆ Stop()
virtual void MoreMountains.Tools.MMPlaylist.Stop |
( |
| ) |
|
|
virtual |
◆ StopLoopTargetSong()
virtual void MoreMountains.Tools.MMPlaylist.StopLoopTargetSong |
( |
| ) |
|
|
protectedvirtual |
◆ _coroutine
Coroutine MoreMountains.Tools.MMPlaylist._coroutine |
|
protected |
◆ _enabled
bool MoreMountains.Tools.MMPlaylist._enabled |
|
protected |
◆ _firstDeserialization
bool MoreMountains.Tools.MMPlaylist._firstDeserialization = true |
|
protected |
◆ _instance
MMPlaylist MoreMountains.Tools.MMPlaylist._instance |
|
staticprotected |
◆ _listCount
int MoreMountains.Tools.MMPlaylist._listCount = 0 |
|
protected |
◆ _queuedSong
int MoreMountains.Tools.MMPlaylist._queuedSong = -1 |
|
protected |
◆ _shouldResumeOnApplicationPause
bool MoreMountains.Tools.MMPlaylist._shouldResumeOnApplicationPause = false |
|
protected |
◆ _songsPlayedSoFar
int MoreMountains.Tools.MMPlaylist._songsPlayedSoFar = 0 |
|
protected |
◆ _songsPlayedThisCycle
int MoreMountains.Tools.MMPlaylist._songsPlayedThisCycle = 0 |
|
protected |
◆ AutoHandleApplicationPause
bool MoreMountains.Tools.MMPlaylist.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
◆ AutomaticallyUnparentOnAwake
bool MoreMountains.Tools.MMPlaylist.AutomaticallyUnparentOnAwake = true |
if this is true, this singleton will auto detach if it finds itself parented on awake
◆ Channel
int MoreMountains.Tools.MMPlaylist.Channel = 0 |
the channel on which to broadcast orders for this playlist
◆ Current
◆ CurrentlyPlayingIndex
int MoreMountains.Tools.MMPlaylist.CurrentlyPlayingIndex = -1 |
the index we're currently playing
◆ CurrentSongName
string MoreMountains.Tools.MMPlaylist.CurrentSongName |
the name of the song that is currently playing
◆ DebugCurrentState
the current state of the playlist, debug display only
◆ Endless
bool MoreMountains.Tools.MMPlaylist.Endless = true |
whether this playlist should play and loop as a whole forever or not
◆ HasInstance
bool MoreMountains.Tools.MMPlaylist.HasInstance => _instance != null |
|
static |
◆ NextButton
bool MoreMountains.Tools.MMPlaylist.NextButton |
◆ PauseButton
bool MoreMountains.Tools.MMPlaylist.PauseButton |
◆ Persistent
bool MoreMountains.Tools.MMPlaylist.Persistent = false |
if this is true, this playlist will persist from scene to scene
◆ PlayButton
bool MoreMountains.Tools.MMPlaylist.PlayButton |
◆ PlaylistState
the current state of this playlist
◆ PlayOnStart
bool MoreMountains.Tools.MMPlaylist.PlayOnStart = true |
whether this playlist should auto play on start or not
◆ QueueTargetSongButton
bool MoreMountains.Tools.MMPlaylist.QueueTargetSongButton |
◆ RandomizeOrderSeed
bool MoreMountains.Tools.MMPlaylist.RandomizeOrderSeed = true |
if this is true, random seed will be randomized by the system clock
◆ RandomOrder
bool MoreMountains.Tools.MMPlaylist.RandomOrder = false |
whether this should play in random order or not
◆ SetLoopTargetSongButton
bool MoreMountains.Tools.MMPlaylist.SetLoopTargetSongButton |
◆ Songs
the songs that this playlist will play
◆ StopButton
bool MoreMountains.Tools.MMPlaylist.StopButton |
◆ StopLoopTargetSongButton
bool MoreMountains.Tools.MMPlaylist.StopLoopTargetSongButton |
◆ TargetSongButton
bool MoreMountains.Tools.MMPlaylist.TargetSongButton |
◆ TargetSongIndex
int MoreMountains.Tools.MMPlaylist.TargetSongIndex = 0 |
the index of the song to play when pressing the PlayTargetSong button
◆ VolumeMultiplier
float MoreMountains.Tools.MMPlaylist.VolumeMultiplier = 1f |
a global volume multiplier to apply when playing a song
◆ Instance
MMPlaylist MoreMountains.Tools.MMPlaylist.Instance |
|
staticget |
Singleton design pattern
The instance.
The documentation for this class was generated from the following file:
- F:/Github/Store/Feel/Assets/Feel/MMTools/Core/MMAudio/MMPlaylist/MMPlaylist.cs