Class MusicPlayerExtensions
Inherited Members
Namespace: Doozy.Runtime.Soundy
Assembly: cs.temp.dll.dll
Syntax
public static class MusicPlayerExtensions
Methods
AddToPlaylist<T>(T, MusicId)
Add a music to the playlist. If the provided music is already in the playlist, it will be added again. If the provided music is null, nothing happens.
Declaration
public static T AddToPlaylist<T>(this T musicPlayer, MusicId musicId)
where T : MusicPlayer
Parameters
Type | Name | Description |
---|---|---|
T | musicPlayer | Target MusicPlayer |
MusicId | musicId | Music to add to the playlist |
Returns
Type | Description |
---|---|
T | This MusicPlayer (useful for chaining) |
Type Parameters
Name | Description |
---|---|
T |
AddToPlaylist<T>(T, String, String)
Add a music with the given library name and music name to the playlist. If the provided music is already in the playlist, a new music with the same library name and music name will be added.
Declaration
public static T AddToPlaylist<T>(this T musicPlayer, string libraryName, string musicName)
where T : MusicPlayer
Parameters
Type | Name | Description |
---|---|---|
T | musicPlayer | Target MusicPlayer |
String | libraryName | Name of the library containing the music to add to the playlist |
String | musicName | Name of the music to add to the playlist |
Returns
Type | Description |
---|---|
T | This MusicPlayer (useful for chaining) |
Type Parameters
Name | Description |
---|---|
T |
InsertIntoPlaylist<T>(T, Int32, MusicId)
Insert a music to the playlist at the given index. If the index is out of range, the music will be added at the beginning or at the end of the playlist (depending on the provided index).
Declaration
public static T InsertIntoPlaylist<T>(this T musicPlayer, int index, MusicId musicId)
where T : MusicPlayer
Parameters
Type | Name | Description |
---|---|---|
T | musicPlayer | Target MusicPlayer |
Int32 | index | Index at which the music should be inserted |
MusicId | musicId | Music to insert into the playlist |
Returns
Type | Description |
---|---|
T | This MusicPlayer (useful for chaining) |
Type Parameters
Name | Description |
---|---|
T |
InsertIntoPlaylist<T>(T, Int32, String, String)
Insert a music with the given library name and music name to the playlist at the given index. If the index is out of range, the music will be added at the beginning or at the end of the playlist (depending on the provided index).
Declaration
public static T InsertIntoPlaylist<T>(this T musicPlayer, int index, string libraryName, string musicName)
where T : MusicPlayer
Parameters
Type | Name | Description |
---|---|---|
T | musicPlayer | Target MusicPlayer |
Int32 | index | Index at which the music should be inserted |
String | libraryName | Name of the library containing the music to insert into the playlist |
String | musicName | Name of the music to insert into the playlist |
Returns
Type | Description |
---|---|
T | This MusicPlayer (useful for chaining) |
Type Parameters
Name | Description |
---|---|
T |
RemoveAtFromPlaylist<T>(T, Int32)
Remove the music at the given index from the playlist. If the index is out of range, nothing will happen.
Declaration
public static T RemoveAtFromPlaylist<T>(this T musicPlayer, int index)
where T : MusicPlayer
Parameters
Type | Name | Description |
---|---|---|
T | musicPlayer | Target MusicPlayer |
Int32 | index | Index of the music to remove from the playlist |
Returns
Type | Description |
---|---|
T | This MusicPlayer (useful for chaining) |
Type Parameters
Name | Description |
---|---|
T |
RemoveFromPlaylist<T>(T, MusicId)
Remove the music id from the playlist. If the music id is not in the playlist, nothing happens.
Declaration
public static T RemoveFromPlaylist<T>(this T musicPlayer, MusicId musicId)
where T : MusicPlayer
Parameters
Type | Name | Description |
---|---|---|
T | musicPlayer | Target MusicPlayer |
MusicId | musicId | Music to remove from the playlist |
Returns
Type | Description |
---|---|
T | This MusicPlayer (useful for chaining) |
Type Parameters
Name | Description |
---|---|
T |
RemoveFromPlaylist<T>(T, String, String)
Remove the first music with the given library name and music name from the playlist. If one does not exist, nothing happens.
Declaration
public static T RemoveFromPlaylist<T>(this T musicPlayer, string libraryName, string musicName)
where T : MusicPlayer
Parameters
Type | Name | Description |
---|---|---|
T | musicPlayer | Target MusicPlayer |
String | libraryName | Name of the library containing the music to remove from the playlist |
String | musicName | Name of the music to remove from the playlist |
Returns
Type | Description |
---|---|
T | This MusicPlayer (useful for chaining) |
Type Parameters
Name | Description |
---|---|
T |
ResetPlaylist<T>(T)
Reset the playlist to its initial state (first song). This does not stop the music if it is playing.
Declaration
public static T ResetPlaylist<T>(this T musicPlayer)
where T : MusicPlayer
Parameters
Type | Name | Description |
---|---|---|
T | musicPlayer | Target MusicPlayer |
Returns
Type | Description |
---|---|
T | This MusicPlayer (useful for chaining) |
Type Parameters
Name | Description |
---|---|
T |
SetAutoAdvance<T>(T, Boolean)
Set the music player to automatically advance to the next music track when the current one finishes playing.
Declaration
public static T SetAutoAdvance<T>(this T musicPlayer, bool value)
where T : MusicPlayer
Parameters
Type | Name | Description |
---|---|---|
T | musicPlayer | Target MusicPlayer |
Boolean | value | True to automatically advance to the next music track, false otherwise |
Returns
Type | Description |
---|---|
T | This music player (useful for chaining) |
Type Parameters
Name | Description |
---|---|
T |
SetCrossFade<T>(T, Boolean)
Set the music player to cross fade between music tracks when auto advance is enabled and fade in and fade out durations are greater than 0.
Note: Cross fading is not supported when the music player is playing a single music track
Declaration
public static T SetCrossFade<T>(this T musicPlayer, bool value)
where T : MusicPlayer
Parameters
Type | Name | Description |
---|---|---|
T | musicPlayer | Target MusicPlayer |
Boolean | value | True to cross fade between music tracks, false otherwise |
Returns
Type | Description |
---|---|
T | This music player (useful for chaining) |
Type Parameters
Name | Description |
---|---|
T |
SetCrossFadeDuration<T>(T, Single)
Set the cross fade duration (in seconds) for the music player.
Note: Cross fade duration must be greater than 0 for cross fading to work
Declaration
public static T SetCrossFadeDuration<T>(this T musicPlayer, float value)
where T : MusicPlayer
Parameters
Type | Name | Description |
---|---|---|
T | musicPlayer | Target MusicPlayer |
Single | value | Cross fade duration (in seconds) |
Returns
Type | Description |
---|---|
T | This music player (useful for chaining) |
Type Parameters
Name | Description |
---|---|
T |
SetDonDestroyOnSceneChange<T>(T, Boolean)
Set the music player to not destroy on scene change. This allows the music player to persist between scene changes. This method also calls DontDestroyOnLoad(gameObject).
Declaration
public static T SetDonDestroyOnSceneChange<T>(this T musicPlayer, bool value)
where T : MusicPlayer
Parameters
Type | Name | Description |
---|---|---|
T | musicPlayer | Target MusicPlayer |
Boolean | value | True to not destroy on scene change, false otherwise |
Returns
Type | Description |
---|---|
T | This music player (useful for chaining) |
Type Parameters
Name | Description |
---|---|
T |
SetFollowTarget<T>(T, Transform)
Set a target that the music will follow while playing
Declaration
public static T SetFollowTarget<T>(this T musicPlayer, Transform value)
where T : MusicPlayer
Parameters
Type | Name | Description |
---|---|---|
T | musicPlayer | Target MusicPlayer |
Transform | value | Target transform |
Returns
Type | Description |
---|---|
T | This music player (useful for chaining) |
Type Parameters
Name | Description |
---|---|
T |
SetPauseOnDisable<T>(T, Boolean)
Set the music player to pause playing music when the music player is disabled.
Declaration
public static T SetPauseOnDisable<T>(this T musicPlayer, bool value)
where T : MusicPlayer
Parameters
Type | Name | Description |
---|---|---|
T | musicPlayer | Target MusicPlayer |
Boolean | value | True to pause playing music, false otherwise |
Returns
Type | Description |
---|---|
T | This music player (useful for chaining) |
Type Parameters
Name | Description |
---|---|
T |
SetPlayOnDisable<T>(T, Boolean)
Set the music player to play the first music track in the playlist when the music player is disabled.
Declaration
public static T SetPlayOnDisable<T>(this T musicPlayer, bool value)
where T : MusicPlayer
Parameters
Type | Name | Description |
---|---|---|
T | musicPlayer | Target MusicPlayer |
Boolean | value | True to play the first music track in the playlist, false otherwise |
Returns
Type | Description |
---|---|
T | This music player (useful for chaining) |
Type Parameters
Name | Description |
---|---|
T |
SetPlayOnEnable<T>(T, Boolean)
Set the music player to play the first music track in the playlist when the music player is enabled.
Declaration
public static T SetPlayOnEnable<T>(this T musicPlayer, bool value)
where T : MusicPlayer
Parameters
Type | Name | Description |
---|---|---|
T | musicPlayer | Target MusicPlayer |
Boolean | value | True to play the first music track in the playlist, false otherwise |
Returns
Type | Description |
---|---|
T | This music player (useful for chaining) |
Type Parameters
Name | Description |
---|---|
T |
SetPlayOnStart<T>(T, Boolean)
Set the music player to play the first music track in the playlist when the music player starts.
Declaration
public static T SetPlayOnStart<T>(this T musicPlayer, bool value)
where T : MusicPlayer
Parameters
Type | Name | Description |
---|---|---|
T | musicPlayer | Target MusicPlayer |
Boolean | value | True to play the first music track in the playlist, false otherwise |
Returns
Type | Description |
---|---|
T | This music player (useful for chaining) |
Type Parameters
Name | Description |
---|---|
T |
SetResetPlaylistOnDisable<T>(T, Boolean)
Set the music player to reset the playlist when the music player is disabled.
Declaration
public static T SetResetPlaylistOnDisable<T>(this T musicPlayer, bool value)
where T : MusicPlayer
Parameters
Type | Name | Description |
---|---|---|
T | musicPlayer | Target MusicPlayer |
Boolean | value | True to reset the playlist, false otherwise |
Returns
Type | Description |
---|---|
T | This music player (useful for chaining) |
Type Parameters
Name | Description |
---|---|
T |
SetResetPlaylistOnEnable<T>(T, Boolean)
Set the music player to reset the playlist when the music player is enabled.
Declaration
public static T SetResetPlaylistOnEnable<T>(this T musicPlayer, bool value)
where T : MusicPlayer
Parameters
Type | Name | Description |
---|---|---|
T | musicPlayer | Target MusicPlayer |
Boolean | value | True to reset the playlist, false otherwise |
Returns
Type | Description |
---|---|
T | This music player (useful for chaining) |
Type Parameters
Name | Description |
---|---|
T |
SetResumeOnEnable<T>(T, Boolean)
Set the music player to resume playing music when the music player is enabled.
Declaration
public static T SetResumeOnEnable<T>(this T musicPlayer, bool value)
where T : MusicPlayer
Parameters
Type | Name | Description |
---|---|---|
T | musicPlayer | Target MusicPlayer |
Boolean | value | True to resume playing music, false otherwise |
Returns
Type | Description |
---|---|
T | This music player (useful for chaining) |
Type Parameters
Name | Description |
---|---|
T |
SetStopOnDestroy<T>(T, Boolean)
Set the music player to stop playing music when the music player is destroyed.
Declaration
public static T SetStopOnDestroy<T>(this T musicPlayer, bool value)
where T : MusicPlayer
Parameters
Type | Name | Description |
---|---|---|
T | musicPlayer | Target MusicPlayer |
Boolean | value | True to stop playing music, false otherwise |
Returns
Type | Description |
---|---|
T | This music player (useful for chaining) |
Type Parameters
Name | Description |
---|---|
T |
SetStopOnDisable<T>(T, Boolean)
Set the music player to stop playing music when the music player is disabled.
Declaration
public static T SetStopOnDisable<T>(this T musicPlayer, bool value)
where T : MusicPlayer
Parameters
Type | Name | Description |
---|---|---|
T | musicPlayer | Target MusicPlayer |
Boolean | value | True to stop playing music, false otherwise |
Returns
Type | Description |
---|---|
T | This music player (useful for chaining) |
Type Parameters
Name | Description |
---|---|
T |