Show / Hide Table of Contents

Class MusicPlayer

The persistent storage for playback rules of a particular playlist.

Inheritance
System.Object
MusicPlayer
Namespace: Stem
Assembly: Stem.dll
Syntax
[Serializable]
public class MusicPlayer : ISerializationCallbackReceiver

Properties

| Improve this Doc View Source

Audible

The flag indicating if the music player can be heard.

Declaration
public bool Audible { get; }
Property Value
Type Description
System.Boolean

True, if the music player can be heard. False otherwise.

| Improve this Doc View Source

Bank

The music bank the music player belongs to.

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

A reference to a music bank.

| Improve this Doc View Source

Fade

The crossfade parameter that is used when the music player transitions between tracks or playback states.

Declaration
public float Fade { get; set; }
Property Value
Type Description
System.Single

Crossfade duration in seconds.

| Improve this Doc View Source

ID

The unique identifier for fast access to the music player.

Declaration
public int ID { get; }
Property Value
Type Description
System.Int32

A unique identifier value of the music player.

| Improve this Doc View Source

Loop

The flag indicating whether the music player should repeat playlist tracks after they finish.

Declaration
public bool Loop { get; set; }
Property Value
Type Description
System.Boolean

True, if the music player is looping playlist tracks. False otherwise.

Remarks

If PlaybackMode value is AutoAdvance then this flag is indicating whether the music player should repeat the whole playlist instead of individual playlist track.

| Improve this Doc View Source

MixerGroup

The reference to an audio mixer group. Please refer to Unity Scripting Reference for details.

Declaration
public AudioMixerGroup MixerGroup { get; set; }
Property Value
Type Description
AudioMixerGroup

A reference to a mixer group.

| Improve this Doc View Source

Muted

The flag indicating if the music player is muted and can't be heard.

Declaration
public bool Muted { get; set; }
Property Value
Type Description
System.Boolean

True, if the music player is muted. False otherwise.

Remarks

This flag may be overridden by the Soloed flag, i.e. if the music player is simultaneously muted and soloed it'll be audible.

| Improve this Doc View Source

Name

The name of the music player. Used for fast search in corresponding music bank.

Declaration
public string Name { get; set; }
Property Value
Type Description
System.String

Name of the music player.

| Improve this Doc View Source

PlaybackMode

The playback mode defining how music player should play its tracks.

Declaration
public MusicPlayerPlaybackMode PlaybackMode { get; set; }
Property Value
Type Description
MusicPlayerPlaybackMode

An enum value.

| Improve this Doc View Source

Playlist

The reference to a playlist which will be played.

Declaration
public Playlist Playlist { get; set; }
Property Value
Type Description
Playlist

A reference to a playlist.

| Improve this Doc View Source

PlayOnStart

The flag indicating whether the music player should start playing once the game started.

Declaration
public bool PlayOnStart { get; set; }
Property Value
Type Description
System.Boolean

True, if the music player should play on start. False otherwise.

| Improve this Doc View Source

Shuffle

The flag indicating whether the music player should play tracks in random order.

Declaration
public bool Shuffle { get; set; }
Property Value
Type Description
System.Boolean

True, if the music player is playing playlist tracks in random order. False if it's playing sequentially.

Remarks

Note that tracks will be reshuffled again after the player will finish playing all the tracks.

| Improve this Doc View Source

Soloed

The flag indicating if the music player is soloed. If set to true, all other non-solo music players won't be audible.

Declaration
public bool Soloed { get; set; }
Property Value
Type Description
System.Boolean

True, if the music player is soloed. False otherwise.

Remarks

This flag may override the Muted flag, i.e. if the music player is simultaneously muted and soloed it'll be audible.

| Improve this Doc View Source

SyncGroup

The sync group of the music player. Music players with the same sync group will share playback time.

Declaration
public byte SyncGroup { get; set; }
Property Value
Type Description
System.Byte

Sync group of the music player.

Remarks

Sync groups work only if PlaybackMode value is Synced.

| Improve this Doc View Source

Unfolded

The flag indicating whether the music bank inspector should show advanced settings for the music player.

Declaration
public bool Unfolded { get; set; }
Property Value
Type Description
System.Boolean

True, if advanced settings are shown. False otherwise.

Remarks

This property is used only by the music bank inspector and does nothing during runtime.

| Improve this Doc View Source

Volume

The volume of the music player.

Declaration
public float Volume { get; set; }
Property Value
Type Description
System.Single

Volume of the music player. Value must be in [0;1] range.

Methods

| Improve this Doc View Source

OnAfterDeserialize()

Prepares sound for runtime use after deserialization.

Declaration
public void OnAfterDeserialize()
Remarks

This method is automatically called by Unity during deserialization process. Don't call it manually.

| Improve this Doc View Source

OnBeforeSerialize()

Prepares sound for serialization.

Declaration
public void OnBeforeSerialize()
Remarks

This method is automatically called by Unity during serialization process. Don't call it manually.

Events

| Improve this Doc View Source

OnPlaybackPaused

The delegate informing about playback pause in the music player.

Declaration
public 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 the music player.

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

OnPlaybackStopped

The delegate informing about playback stop in the music player.

Declaration
public 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 the music player.

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