Master Audio Multiplayer
1.3.8
The ONLY audio framework with extensive turnkey multiplayer features!
|
This class is used to host and play Playlists. Contains cross-fading, ducking and more! More...
Public Member Functions | |
delegate void | SongChangedEventHandler (string newSongName, MusicSetting song) |
Used for the SongChanged event you can subscribe to More... | |
delegate void | SongEndedEventHandler (string songName) |
Used for the SongEnded event you can subscribe to More... | |
delegate void | SongLoopedEventHandler (string songName) |
Used for the SongLooped event you can subscribe to More... | |
delegate void | PlaylistEndedEventHandler () |
Used for the PlaylistEnded event you can subscribe to More... | |
bool | IsSongPlaying (string songName) |
This method will tell you if the song you specify by name is playing or not. If it's the current song and paused, this will still return true. More... | |
void | ClearQueue () |
Call this method to clear all songs out of the queued songs list. More... | |
void | ToggleMutePlaylist () |
This method mutes the Playlist if it's not muted, and vice versa. More... | |
void | MutePlaylist () |
This method mutes the Playlist. More... | |
void | UnmutePlaylist () |
This method unmutes the Playlist. More... | |
void | PausePlaylist () |
This method will pause the Playlist. More... | |
bool | UnpausePlaylist () |
This method will unpause the Playlist. More... | |
void | StopPlaylist (bool onlyFadingClip=false) |
This method will Stop the Playlist. More... | |
void | FadeToVolume (float targetVolume, float fadeTime, System.Action callback=null) |
This method allows you to fade the Playlist to a specified volume over X seconds. More... | |
void | PlayRandomSong () |
This method will play a random song in the current Playlist. More... | |
void | PlayNextSong () |
This method will play the next song in the current Playlist. More... | |
void | StopPlaylistAfterCurrentSong () |
This method will end the looping of the current song and cancel any scheduled / queued songs. Also turns off auto-advance if it's on to accomplish this. More... | |
void | StopLoopingCurrentSong () |
This method will end the looping of the current song so the next can play when it's done. More... | |
void | QueuePlaylistClip (string clipName, bool scheduleNow=true) |
This method will play the song in the current Playlist whose name you specify as soon as the currently playing song is done. The current song, if looping, will have loop turned off by this call. This requires auto-advance to work. More... | |
bool | TriggerPlaylistClip (string clipName) |
This method will play the song in the current Playlist whose name you specify. More... | |
void | UpdateMasterVolume () |
This method is used to update state based on the Playlist Master Volume. More... | |
void | StartPlaylist (string playlistName, string clipName=null) |
This method is used to start a Playlist whether it's already loaded and playing or not. More... | |
void | ChangePlaylist (string playlistName, bool playFirstClip=true, string clipName=null) |
This method is used to change the current Playlist to a new one, and optionally start it playing. More... | |
void | RestartPlaylist (string clipName=null) |
This method can be called to restart the current Playlist More... | |
Static Public Member Functions | |
static PlaylistController | InstanceByName (string playlistControllerName, bool errorIfNotFound=true) |
This method returns a reference to the PlaylistController whose name you specify. This is necessary when you have more than one. More... | |
Properties | |
bool | ControllerIsReady [get] |
This property returns true if the Playlist Controller has already run its Awake method. You should not call any PlaylistController method until it has done so. More... | |
FadeStatus | CurrentFadeStatus [get] |
This returns the current fade status of a FadeToVolume call, if any is running. More... | |
PlaylistStates | PlaylistState [get] |
This property returns the current state of the Playlist. Choices are: NotInScene, Stopped, Playing, Paused, Crossfading More... | |
AudioSource | ActiveAudioSource [get] |
This property returns the active audio source for the PlaylistControllers in the Scene. During cross-fading, the one fading in is returned, not the one fading out. More... | |
static List< PlaylistController > | Instances [get, set] |
This property returns all the PlaylistControllers in the Scene. More... | |
GameObject | PlaylistControllerGameObject [get] |
This property returns the GameObject for the PlaylistController's GameObject. More... | |
AudioSource | CurrentPlaylistSource [get] |
This property returns the current Audio Source for the current Playlist song that is playing. More... | |
AudioClip | CurrentPlaylistClip [get] |
This property returns the current Audio Clip for the current Playlist song that is playing. More... | |
AudioClip | FadingPlaylistClip [get] |
This property returns the currently fading out Audio Clip for the Playlist (null if not during cross-fading). More... | |
AudioSource | FadingSource [get] |
This property returns the currently fading out Audio Source for the Playlist (null if not during cross-fading). More... | |
bool | IsCrossFading [get] |
This property returns whether or not the Playlist is currently cross-fading. More... | |
bool | IsFading [get] |
This property returns whether or not the Playlist is currently cross-fading or doing another fade. More... | |
float | PlaylistVolume [get, set] |
This property gets and sets the volume of the Playlist Controller with Master Playlist Volume taken into account. More... | |
MasterAudio.Playlist | CurrentPlaylist [get] |
This property returns the current Playlist More... | |
bool | HasPlaylist [get] |
This property returns whether you have a Playlist assigned to this controller or not. More... | |
string | PlaylistName [get] |
This property returns the name of the current Playlist More... | |
MusicSetting | CurrentSong [get] |
This returns the currently playing song. Do not set any fields on the MusicSetting returned. Consider them read-only. More... | |
int | ClipsRemainingInCurrentPlaylist [get] |
This tells you how many clips still haven't been played in the Playlist. More... | |
Events | |
SongChangedEventHandler | SongChanged |
This event will notify you when the Playlist song changes. More... | |
SongEndedEventHandler | SongEnded |
This event will notify you when the Playlist song ends. More... | |
SongLoopedEventHandler | SongLooped |
This event will notify you when a song loops (ends a loop and starts the same clip again via looping). More... | |
PlaylistEndedEventHandler | PlaylistEnded |
This event will notify you when a Playlist stops after the last song plays. More... | |
This class is used to host and play Playlists. Contains cross-fading, ducking and more!
void DarkTonic.MasterAudio.PlaylistController.ChangePlaylist | ( | string | playlistName, |
bool | playFirstClip = true , |
||
string | clipName = null |
||
) |
This method is used to change the current Playlist to a new one, and optionally start it playing.
playlistName | The name of the Playlist to start |
playFirstClip | Defaults to true. Whether to start the first song or not. |
clipName | Optional - Name of the specific clip to play. |
void DarkTonic.MasterAudio.PlaylistController.ClearQueue | ( | ) |
Call this method to clear all songs out of the queued songs list.
void DarkTonic.MasterAudio.PlaylistController.FadeToVolume | ( | float | targetVolume, |
float | fadeTime, | ||
System.Action | callback = null |
||
) |
This method allows you to fade the Playlist to a specified volume over X seconds.
targetVolume | The volume to fade to. |
fadeTime | The amount of time to fully fade to the target volume. |
callback | Optional callback method |
|
static |
This method returns a reference to the PlaylistController whose name you specify. This is necessary when you have more than one.
playlistControllerName | Name of Playlist Controller |
errorIfNotFound | Defaults to true. Pass false if you don't want an error in the console when not found. |
bool DarkTonic.MasterAudio.PlaylistController.IsSongPlaying | ( | string | songName | ) |
This method will tell you if the song you specify by name is playing or not. If it's the current song and paused, this will still return true.
true
if this instance is song playing the specified songName; otherwise, false
.songName | Song name or alias. Here you pass the name of the clip or its alias to check. |
void DarkTonic.MasterAudio.PlaylistController.MutePlaylist | ( | ) |
This method mutes the Playlist.
void DarkTonic.MasterAudio.PlaylistController.PausePlaylist | ( | ) |
This method will pause the Playlist.
delegate void DarkTonic.MasterAudio.PlaylistController.PlaylistEndedEventHandler | ( | ) |
Used for the PlaylistEnded event you can subscribe to
void DarkTonic.MasterAudio.PlaylistController.PlayNextSong | ( | ) |
This method will play the next song in the current Playlist.
void DarkTonic.MasterAudio.PlaylistController.PlayRandomSong | ( | ) |
This method will play a random song in the current Playlist.
void DarkTonic.MasterAudio.PlaylistController.QueuePlaylistClip | ( | string | clipName, |
bool | scheduleNow = true |
||
) |
This method will play the song in the current Playlist whose name you specify as soon as the currently playing song is done. The current song, if looping, will have loop turned off by this call. This requires auto-advance to work.
clipName | The name or alias of the song to play. |
scheduleNow | Whether the song should immediately be scheduled to play (when Gapless song transitions is enabled) |
void DarkTonic.MasterAudio.PlaylistController.RestartPlaylist | ( | string | clipName = null | ) |
This method can be called to restart the current Playlist
clipName | Optional - The clip name to play |
delegate void DarkTonic.MasterAudio.PlaylistController.SongChangedEventHandler | ( | string | newSongName, |
MusicSetting | song | ||
) |
Used for the SongChanged event you can subscribe to
delegate void DarkTonic.MasterAudio.PlaylistController.SongEndedEventHandler | ( | string | songName | ) |
Used for the SongEnded event you can subscribe to
delegate void DarkTonic.MasterAudio.PlaylistController.SongLoopedEventHandler | ( | string | songName | ) |
Used for the SongLooped event you can subscribe to
void DarkTonic.MasterAudio.PlaylistController.StartPlaylist | ( | string | playlistName, |
string | clipName = null |
||
) |
This method is used to start a Playlist whether it's already loaded and playing or not.
playlistName | The name of the Playlist to start |
clipName | Optional - The name of the specific clip to play. |
void DarkTonic.MasterAudio.PlaylistController.StopLoopingCurrentSong | ( | ) |
This method will end the looping of the current song so the next can play when it's done.
void DarkTonic.MasterAudio.PlaylistController.StopPlaylist | ( | bool | onlyFadingClip = false | ) |
This method will Stop the Playlist.
void DarkTonic.MasterAudio.PlaylistController.StopPlaylistAfterCurrentSong | ( | ) |
This method will end the looping of the current song and cancel any scheduled / queued songs. Also turns off auto-advance if it's on to accomplish this.
void DarkTonic.MasterAudio.PlaylistController.ToggleMutePlaylist | ( | ) |
This method mutes the Playlist if it's not muted, and vice versa.
bool DarkTonic.MasterAudio.PlaylistController.TriggerPlaylistClip | ( | string | clipName | ) |
This method will play the song in the current Playlist whose name you specify.
clipName | The name of the song to play. |
void DarkTonic.MasterAudio.PlaylistController.UnmutePlaylist | ( | ) |
This method unmutes the Playlist.
bool DarkTonic.MasterAudio.PlaylistController.UnpausePlaylist | ( | ) |
This method will unpause the Playlist.
void DarkTonic.MasterAudio.PlaylistController.UpdateMasterVolume | ( | ) |
This method is used to update state based on the Playlist Master Volume.
|
get |
This property returns the active audio source for the PlaylistControllers in the Scene. During cross-fading, the one fading in is returned, not the one fading out.
|
get |
This tells you how many clips still haven't been played in the Playlist.
|
get |
This property returns true if the Playlist Controller has already run its Awake method. You should not call any PlaylistController method until it has done so.
|
get |
This returns the current fade status of a FadeToVolume call, if any is running.
|
get |
This property returns the current Playlist
|
get |
This property returns the current Audio Clip for the current Playlist song that is playing.
|
get |
This property returns the current Audio Source for the current Playlist song that is playing.
|
get |
This returns the currently playing song. Do not set any fields on the MusicSetting returned. Consider them read-only.
|
get |
This property returns the currently fading out Audio Clip for the Playlist (null if not during cross-fading).
|
get |
This property returns the currently fading out Audio Source for the Playlist (null if not during cross-fading).
|
get |
This property returns whether you have a Playlist assigned to this controller or not.
|
staticgetset |
This property returns all the PlaylistControllers in the Scene.
|
get |
This property returns whether or not the Playlist is currently cross-fading.
|
get |
This property returns whether or not the Playlist is currently cross-fading or doing another fade.
|
get |
This property returns the GameObject for the PlaylistController's GameObject.
|
get |
This property returns the name of the current Playlist
|
get |
This property returns the current state of the Playlist. Choices are: NotInScene, Stopped, Playing, Paused, Crossfading
|
getset |
This property gets and sets the volume of the Playlist Controller with Master Playlist Volume taken into account.
PlaylistEndedEventHandler DarkTonic.MasterAudio.PlaylistController.PlaylistEnded |
This event will notify you when a Playlist stops after the last song plays.
SongChangedEventHandler DarkTonic.MasterAudio.PlaylistController.SongChanged |
This event will notify you when the Playlist song changes.
SongEndedEventHandler DarkTonic.MasterAudio.PlaylistController.SongEnded |
This event will notify you when the Playlist song ends.
SongLoopedEventHandler DarkTonic.MasterAudio.PlaylistController.SongLooped |
This event will notify you when a song loops (ends a loop and starts the same clip again via looping).