Show / Hide Table of Contents

Class MusicManager

The main class for music playback and bank management.

Inheritance
System.Object
MusicManager
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Stem
Assembly: Stem.dll
Syntax
public static class MusicManager

Properties

| Improve this Doc View Source

Banks

The collection of all registered music banks.

Declaration
public static ReadOnlyCollection<MusicBank> Banks { get; }
Property Value
Type Description
System.Collections.ObjectModel.ReadOnlyCollection<MusicBank>

A reference to a read-only collection of music banks.

| Improve this Doc View Source

PrimaryBank

The primary music bank that will be searched first in case of name collisions.

Declaration
public static MusicBank PrimaryBank { get; set; }
Property Value
Type Description
MusicBank

A reference to a primary music bank.

Methods

| Improve this Doc View Source

DeregisterBank(MusicBank)

Deregisters existing music bank.

Declaration
public static bool DeregisterBank(MusicBank bank)
Parameters
Type Name Description
MusicBank bank

A reference to a music bank to deregister.

Returns
Type Description
System.Boolean

True, if music bank was succesfully deregistered. False otherwise.

| Improve this Doc View Source

GetMusicPlayer(ID)

Searches for the specified music player with a matching ID.

Declaration
public static MusicPlayer GetMusicPlayer(ID id)
Parameters
Type Name Description
ID id

ID referring to the music player.

Returns
Type Description
MusicPlayer

A reference to a music player, if found. Null reference otherwise.

| Improve this Doc View Source

GetMusicPlayer(String)

Searches for the specified music player with a matching name.

Declaration
public static MusicPlayer GetMusicPlayer(string name)
Parameters
Type Name Description
System.String name

Name of the music player.

Returns
Type Description
MusicPlayer

A reference to a music player, if found. Null reference otherwise.

Remarks

If multiple banks have music players with a matching name, the primary music bank will be checked first. Within a bank, the first occurrence of found music player will be used.

| Improve this Doc View Source

GetPlaylist(ID)

Searches for the specified playlist with a matching ID.

Declaration
public static Playlist GetPlaylist(ID id)
Parameters
Type Name Description
ID id

ID referring to the playlist.

Returns
Type Description
Playlist

A reference to a playlist, if found. Null reference otherwise.

| Improve this Doc View Source

GetPlaylist(String)

Searches for the specified playlist with a matching name.

Declaration
public static Playlist GetPlaylist(string name)
Parameters
Type Name Description
System.String name

Name of the playlist.

Returns
Type Description
Playlist

A reference to a playlist, if found. Null reference otherwise.

Remarks

If multiple banks have playlists with a matching name, the primary music bank will be checked first. Within a bank, the first occurrence of found playlist will be used.

| Improve this Doc View Source

IsPlaying(ID)

Checks whether or not specified music player with a matching ID is playing.

Declaration
public static bool IsPlaying(ID playerID)
Parameters
Type Name Description
ID playerID

ID referring to the music player.

Returns
Type Description
System.Boolean

True, if the found music player is playing. False otherwise.

| Improve this Doc View Source

IsPlaying(String)

Checks whether or not specified music player with a matching name is playing.

Declaration
public static bool IsPlaying(string playerName)
Parameters
Type Name Description
System.String playerName

Name of the music player.

Returns
Type Description
System.Boolean

True, if the found music player is playing. False otherwise.

Remarks

If multiple banks have music players with a matching name, the primary music bank will be checked first. Within a bank, the first occurrence of found music player will be used.

| Improve this Doc View Source

Next(ID)

Advances music player to next track.

Declaration
public static void Next(ID playerID)
Parameters
Type Name Description
ID playerID

ID referring to the music player.

Remarks

This method does nothing if no playlist was assigned to the music player. Use SetPlaylist(String, String) or SetPlaylist(String, String, Single) to assign a playlist.

| Improve this Doc View Source

Next(ID, Single)

Advances music player to next track.

Declaration
public static void Next(ID playerID, float fade)
Parameters
Type Name Description
ID playerID

ID referring to the music player.

System.Single fade

Crossfade duration in seconds.

Remarks

This method does nothing if no playlist was assigned to the music player. Use SetPlaylist(String, String) or SetPlaylist(String, String, Single) to assign a playlist.

Crossfade parameter value will override MusicPlayer.Fade value.

| Improve this Doc View Source

Next(String)

Advances music player to next track.

Declaration
public static void Next(string playerName)
Parameters
Type Name Description
System.String playerName

Name of the music player.

Remarks

If multiple banks have music players with a matching name, the primary music bank will be checked first. Within a bank, the first occurrence of found music player will be used.

This method does nothing if no playlist was assigned to the music player. Use SetPlaylist(String, String) or SetPlaylist(String, String, Single) to assign a playlist.

| Improve this Doc View Source

Next(String, Single)

Advances music player to next track.

Declaration
public static void Next(string playerName, float fade)
Parameters
Type Name Description
System.String playerName

Name of the music player.

System.Single fade

Crossfade duration in seconds.

Remarks

If multiple banks have music players with a matching name, the primary music bank will be checked first. Within a bank, the first occurrence of found music player will be used.

This method does nothing if no playlist was assigned to the music player. Use SetPlaylist(String, String) or SetPlaylist(String, String, Single) to assign a playlist.

Crossfade parameter value will override MusicPlayer.Fade value.

| Improve this Doc View Source

Pause(ID)

Pauses music player.

Declaration
public static void Pause(ID playerID)
Parameters
Type Name Description
ID playerID

ID referring to the music player.

Remarks

This method does nothing if no playlist was assigned to the music player. Use SetPlaylist(String, String) or SetPlaylist(String, String, Single) to assign a playlist.

| Improve this Doc View Source

Pause(ID, Single)

Pauses music player.

Declaration
public static void Pause(ID playerID, float fade)
Parameters
Type Name Description
ID playerID

ID referring to the music player.

System.Single fade

Crossfade duration in seconds.

Remarks

This method does nothing if no playlist was assigned to the music player. Use SetPlaylist(String, String) or SetPlaylist(String, String, Single) to assign a playlist.

Crossfade parameter value will override MusicPlayer.Fade value.

| Improve this Doc View Source

Pause(String)

Pauses music player.

Declaration
public static void Pause(string playerName)
Parameters
Type Name Description
System.String playerName

Name of the music player.

Remarks

If multiple banks have music players with a matching name, the primary music bank will be checked first. Within a bank, the first occurrence of found music player will be used.

This method does nothing if no playlist was assigned to the music player. Use SetPlaylist(String, String) or SetPlaylist(String, String, Single) to assign a playlist.

| Improve this Doc View Source

Pause(String, Single)

Pauses music player.

Declaration
public static void Pause(string playerName, float fade)
Parameters
Type Name Description
System.String playerName

Name of the music player.

System.Single fade

Crossfade duration in seconds.

Remarks

If multiple banks have music players with a matching name, the primary music bank will be checked first. Within a bank, the first occurrence of found music player will be used.

This method does nothing if no playlist was assigned to the music player. Use SetPlaylist(String, String) or SetPlaylist(String, String, Single) to assign a playlist.

Crossfade parameter value will override MusicPlayer.Fade value.

| Improve this Doc View Source

Play(ID)

Plays music player.

Declaration
public static void Play(ID playerID)
Parameters
Type Name Description
ID playerID

ID referring to the music player.

Remarks

This method does nothing if no playlist was assigned to the music player. Use SetPlaylist(String, String) or SetPlaylist(String, String, Single) to assign a playlist.

| Improve this Doc View Source

Play(ID, Single)

Plays music player.

Declaration
public static void Play(ID playerID, float fade)
Parameters
Type Name Description
ID playerID

ID referring to the music player.

System.Single fade

Crossfade duration in seconds.

Remarks

This method does nothing if no playlist was assigned to the music player. Use SetPlaylist(String, String) or SetPlaylist(String, String, Single) to assign a playlist.

Crossfade parameter value will override MusicPlayer.Fade value.

| Improve this Doc View Source

Play(String)

Plays music player.

Declaration
public static void Play(string playerName)
Parameters
Type Name Description
System.String playerName

Name of the music player.

Remarks

If multiple banks have music players with a matching name, the primary music bank will be checked first. Within a bank, the first occurrence of found music player will be used.

This method does nothing if no playlist was assigned to the music player. Use SetPlaylist(String, String) or SetPlaylist(String, String, Single) to assign a playlist.

| Improve this Doc View Source

Play(String, Single)

Plays music player.

Declaration
public static void Play(string playerName, float fade)
Parameters
Type Name Description
System.String playerName

Name of the music player.

System.Single fade

Crossfade duration in seconds.

Remarks

If multiple banks have music players with a matching name, the primary music bank will be checked first. Within a bank, the first occurrence of found music player will be used.

This method does nothing if no playlist was assigned to the music player. Use SetPlaylist(String, String) or SetPlaylist(String, String, Single) to assign a playlist.

Crossfade parameter value will override MusicPlayer.Fade value.

| Improve this Doc View Source

Prev(ID)

Advances music player to previous track.

Declaration
public static void Prev(ID playerID)
Parameters
Type Name Description
ID playerID

ID referring to the music player.

Remarks

This method does nothing if no playlist was assigned to the music player. Use SetPlaylist(String, String) or SetPlaylist(String, String, Single) to assign a playlist.

| Improve this Doc View Source

Prev(ID, Single)

Advances music player to previous track.

Declaration
public static void Prev(ID playerID, float fade)
Parameters
Type Name Description
ID playerID

ID referring to the music player.

System.Single fade

Crossfade duration in seconds.

Remarks

This method does nothing if no playlist was assigned to the music player. Use SetPlaylist(String, String) or SetPlaylist(String, String, Single) to assign a playlist.

Crossfade parameter value will override MusicPlayer.Fade value.

| Improve this Doc View Source

Prev(String)

Advances music player to previous track.

Declaration
public static void Prev(string playerName)
Parameters
Type Name Description
System.String playerName

Name of the music player.

Remarks

If multiple banks have music players with a matching name, the primary music bank will be checked first. Within a bank, the first occurrence of found music player will be used.

This method does nothing if no playlist was assigned to the music player. Use SetPlaylist(String, String) or SetPlaylist(String, String, Single) to assign a playlist.

| Improve this Doc View Source

Prev(String, Single)

Advances music player to previous track.

Declaration
public static void Prev(string playerName, float fade)
Parameters
Type Name Description
System.String playerName

Name of the music player.

System.Single fade

Crossfade duration in seconds.

Remarks

If multiple banks have music players with a matching name, the primary music bank will be checked first. Within a bank, the first occurrence of found music player will be used.

This method does nothing if no playlist was assigned to the music player. Use SetPlaylist(String, String) or SetPlaylist(String, String, Single) to assign a playlist.

Crossfade parameter value will override MusicPlayer.Fade value.

| Improve this Doc View Source

RegisterBank(MusicBank)

Registers new music bank.

Declaration
public static bool RegisterBank(MusicBank bank)
Parameters
Type Name Description
MusicBank bank

A reference to a music bank to register.

Returns
Type Description
System.Boolean

True, if music bank was succesfully registered. False otherwise.

| Improve this Doc View Source

Seek(ID, Int32)

Advances music player to a track by index.

Declaration
public static void Seek(ID playerID, int track)
Parameters
Type Name Description
ID playerID

ID referring to the music player.

System.Int32 track

Zero-based index of the track in the current playlist.

Remarks

Target track must be one of current playlist tracks.

The index value represents track order as they appear in the playlist (e.g. setting index to one will seek to the second playlist track and so on). Shuffle order is ignored.

This method does nothing if no playlist was assigned to the music player. Use SetPlaylist(String, String) or SetPlaylist(String, String, Single) to assign a playlist.

| Improve this Doc View Source

Seek(ID, Int32, Single)

Advances music player to a track by index.

Declaration
public static void Seek(ID playerID, int track, float fade)
Parameters
Type Name Description
ID playerID

ID referring to the music player.

System.Int32 track

Zero-based index of the track in the current playlist.

System.Single fade

Crossfade duration in seconds.

Remarks

Target track must be one of current playlist tracks.

The index value represents track order as they appear in the playlist (e.g. setting index to one will seek to the second playlist track and so on). Shuffle order is ignored.

This method does nothing if no playlist was assigned to the music player. Use SetPlaylist(String, String) or SetPlaylist(String, String, Single) to assign a playlist.

Crossfade parameter value will override MusicPlayer.Fade value.

| Improve this Doc View Source

Seek(ID, String)

Advances music player to a track with a matching name.

Declaration
public static void Seek(ID playerID, string track)
Parameters
Type Name Description
ID playerID

ID referring to the music player.

System.String track

Name of the track in the current playlist.

Remarks

Target track must be one of current playlist tracks.

This method does nothing if no playlist was assigned to the music player. Use SetPlaylist(String, String) or SetPlaylist(String, String, Single) to assign a playlist.

| Improve this Doc View Source

Seek(ID, String, Single)

Advances music player to a track with a matching name.

Declaration
public static void Seek(ID playerID, string track, float fade)
Parameters
Type Name Description
ID playerID

ID referring to the music player.

System.String track

Name of the track in the current playlist.

System.Single fade

Crossfade duration in seconds.

Remarks

Target track must be one of current playlist tracks.

This method does nothing if no playlist was assigned to the music player. Use SetPlaylist(String, String) or SetPlaylist(String, String, Single) to assign a playlist.

Crossfade parameter value will override MusicPlayer.Fade value.

| Improve this Doc View Source

Seek(String, Int32)

Advances music player to a track by index.

Declaration
public static void Seek(string playerName, int track)
Parameters
Type Name Description
System.String playerName

Name of the music player.

System.Int32 track

Zero-based index of the track in the current playlist.

Remarks

Target track must be one of current playlist tracks.

The index value represents track order as they appear in the playlist (e.g. setting index to one will seek to the second playlist track and so on). Shuffle order is ignored.

If multiple banks have music players with a matching name, the primary music bank will be checked first. Within a bank, the first occurrence of found music player will be used.

This method does nothing if no playlist was assigned to the music player. Use SetPlaylist(String, String) or SetPlaylist(String, String, Single) to assign a playlist.

| Improve this Doc View Source

Seek(String, Int32, Single)

Advances music player to a track by index.

Declaration
public static void Seek(string playerName, int track, float fade)
Parameters
Type Name Description
System.String playerName

Name of the music player.

System.Int32 track

Zero-based index of the track in the current playlist.

System.Single fade

Crossfade duration in seconds.

Remarks

Target track must be one of current playlist tracks.

The index value represents track order as they appear in the playlist (e.g. setting index to one will seek to the second playlist track and so on). Shuffle order is ignored.

If multiple banks have music players with a matching name, the primary music bank will be checked first. Within a bank, the first occurrence of found music player will be used.

This method does nothing if no playlist was assigned to the music player. Use SetPlaylist(String, String) or SetPlaylist(String, String, Single) to assign a playlist.

Crossfade parameter value will override MusicPlayer.Fade value.

| Improve this Doc View Source

Seek(String, String)

Advances music player to a track with a matching name.

Declaration
public static void Seek(string playerName, string track)
Parameters
Type Name Description
System.String playerName

Name of the music player.

System.String track

Name of the track in the current playlist.

Remarks

Target track must be one of current playlist tracks.

If multiple banks have music players with a matching name, the primary music bank will be checked first. Within a bank, the first occurrence of found music player will be used.

This method does nothing if no playlist was assigned to the music player. Use SetPlaylist(String, String) or SetPlaylist(String, String, Single) to assign a playlist.

| Improve this Doc View Source

Seek(String, String, Single)

Advances music player to a track with a matching name.

Declaration
public static void Seek(string playerName, string track, float fade)
Parameters
Type Name Description
System.String playerName

Name of the music player.

System.String track

Name of the track in the current playlist.

System.Single fade

Crossfade duration in seconds.

Remarks

Target track must be one of current playlist tracks.

If multiple banks have music players with a matching name, the primary music bank will be checked first. Within a bank, the first occurrence of found music player will be used.

This method does nothing if no playlist was assigned to the music player. Use SetPlaylist(String, String) or SetPlaylist(String, String, Single) to assign a playlist.

Crossfade parameter value will override MusicPlayer.Fade value.

| Improve this Doc View Source

SetPlaylist(ID, ID)

Sets a playlist to a music player.

Declaration
public static void SetPlaylist(ID playerID, ID playlistID)
Parameters
Type Name Description
ID playerID

ID referring to the music player.

ID playlistID

ID referring to the playlist.

Remarks

If music player was playing another track it'll automatically crossfade to first track of the new playlist.

| Improve this Doc View Source

SetPlaylist(ID, ID, Single)

Sets a playlist to a music player.

Declaration
public static void SetPlaylist(ID playerID, ID playlistID, float fade)
Parameters
Type Name Description
ID playerID

ID referring to the music player.

ID playlistID

ID referring to the playlist.

System.Single fade

Crossfade duration in seconds.

Remarks

If music player was playing another track it'll automatically crossfade to first track of the new playlist.

Crossfade parameter value will override MusicPlayer.Fade value.

| Improve this Doc View Source

SetPlaylist(ID, String)

Sets a playlist to a music player.

Declaration
public static void SetPlaylist(ID playerID, string playlistName)
Parameters
Type Name Description
ID playerID

ID referring to the music player.

System.String playlistName

Name of the playlist.

Remarks

If multiple banks have playlists with a matching name, the primary music bank will be checked first. Within a bank, the first occurrence of found playlist will be used.

If music player was playing another track it'll automatically crossfade to first track of the new playlist.

| Improve this Doc View Source

SetPlaylist(ID, String, Single)

Sets a playlist to a music player.

Declaration
public static void SetPlaylist(ID playerID, string playlistName, float fade)
Parameters
Type Name Description
ID playerID

ID referring to the music player.

System.String playlistName

Name of the playlist.

System.Single fade

Crossfade duration in seconds.

Remarks

If multiple banks have playlists with a matching name, the primary music bank will be checked first. Within a bank, the first occurrence of found playlist will be used.

If music player was playing another track it'll automatically crossfade to first track of the new playlist.

Crossfade parameter value will override MusicPlayer.Fade value.

| Improve this Doc View Source

SetPlaylist(String, ID)

Sets a playlist to a music player.

Declaration
public static void SetPlaylist(string playerName, ID playlistID)
Parameters
Type Name Description
System.String playerName

Name of the music player.

ID playlistID

ID referring to the playlist.

Remarks

If multiple banks have music players with a matching name, the primary music bank will be checked first. Within a bank, the first occurrence of found music player will be used.

If music player was playing another track it'll automatically crossfade to first track of the new playlist.

| Improve this Doc View Source

SetPlaylist(String, ID, Single)

Sets a playlist to a music player.

Declaration
public static void SetPlaylist(string playerName, ID playlistID, float fade)
Parameters
Type Name Description
System.String playerName

Name of the music player.

ID playlistID

ID referring to the playlist.

System.Single fade

Crossfade duration in seconds.

Remarks

If multiple banks have music players with a matching name, the primary music bank will be checked first. Within a bank, the first occurrence of found music player will be used.

If music player was playing another track it'll automatically crossfade to first track of the new playlist.

Crossfade parameter value will override MusicPlayer.Fade value.

| Improve this Doc View Source

SetPlaylist(String, String)

Sets a playlist to a music player.

Declaration
public static void SetPlaylist(string playerName, string playlistName)
Parameters
Type Name Description
System.String playerName

Name of the music player.

System.String playlistName

Name of the playlist.

Remarks

If multiple banks have music players/playlists with a matching name, the primary music bank will be checked first. Within a bank, the first occurrence of found music player/playlist will be used.

If music player was playing another track it'll automatically crossfade to the first track of the new playlist.

| Improve this Doc View Source

SetPlaylist(String, String, Single)

Sets a playlist to a music player.

Declaration
public static void SetPlaylist(string playerName, string playlistName, float fade)
Parameters
Type Name Description
System.String playerName

Name of the music player.

System.String playlistName

Name of the playlist.

System.Single fade

Crossfade duration in seconds.

Remarks

If multiple banks have music players/playlists with a matching name, the primary music bank will be checked first. Within a bank, the first occurrence of found music player/playlist will be used.

If music player was playing another track it'll automatically crossfade to first track of the new playlist.

Crossfade parameter value will override MusicPlayer.Fade value.

| Improve this Doc View Source

Stop(ID)

Stops music player.

Declaration
public static void Stop(ID playerID)
Parameters
Type Name Description
ID playerID

ID referring to the music player.

Remarks

This method does nothing if no playlist was assigned to the music player. Use SetPlaylist(String, String) or SetPlaylist(String, String, Single) to assign a playlist.

| Improve this Doc View Source

Stop(ID, Single)

Stops music player.

Declaration
public static void Stop(ID playerID, float fade)
Parameters
Type Name Description
ID playerID

ID referring to the music player.

System.Single fade

Crossfade duration in seconds.

Remarks

This method does nothing if no playlist was assigned to the music player. Use SetPlaylist(String, String) or SetPlaylist(String, String, Single) to assign a playlist.

Crossfade parameter value will override MusicPlayer.Fade value.

| Improve this Doc View Source

Stop(String)

Stops music player.

Declaration
public static void Stop(string playerName)
Parameters
Type Name Description
System.String playerName

Name of the music player.

Remarks

If multiple banks have music players with a matching name, the primary music bank will be checked first. Within a bank, the first occurrence of found music player will be used.

This method does nothing if no playlist was assigned to the music player. Use SetPlaylist(String, String) or SetPlaylist(String, String, Single) to assign a playlist.

| Improve this Doc View Source

Stop(String, Single)

Stops music player.

Declaration
public static void Stop(string playerName, float fade)
Parameters
Type Name Description
System.String playerName

Name of the music player.

System.Single fade

Crossfade duration in seconds.

Remarks

If multiple banks have music players with a matching name, the primary music bank will be checked first. Within a bank, the first occurrence of found music player will be used.

This method does nothing if no playlist was assigned to the music player. Use SetPlaylist(String, String) or SetPlaylist(String, String, Single) to assign a playlist.

Crossfade parameter value will override MusicPlayer.Fade value.

Events

| Improve this Doc View Source

OnPlaybackPaused

The delegate informing about playback pause in any of the music players.

Declaration
public static event PlaybackChangedDelegate OnPlaybackPaused
Event Type
Type Description
PlaybackChangedDelegate
Remarks

This delegate will only be called after the music player fades out.

| Improve this Doc View Source

OnPlaybackStarted

The delegate informing about playback start in any of the music players.

Declaration
public static event PlaybackChangedDelegate OnPlaybackStarted
Event Type
Type Description
PlaybackChangedDelegate
| Improve this Doc View Source

OnPlaybackStopped

The delegate informing about playback stop in any of the music players.

Declaration
public static event PlaybackChangedDelegate OnPlaybackStopped
Event Type
Type Description
PlaybackChangedDelegate
Remarks

This delegate will only be called after the music player fades out.

| Improve this Doc View Source

OnTrackChanged

The delegate informing about tracks changes in any of the music players.

Declaration
public static event TrackChangedDelegate OnTrackChanged
Event Type
Type Description
TrackChangedDelegate
  • Improve this Doc
  • View Source
Back to top Generated by DocFX