Class Playlist
The persistent collection of playlist tracks.
Inheritance
Inherited Members
Namespace: Stem
Assembly: Stem.dll
Syntax
[Serializable]
public class Playlist : IAudioClipContainer, ISerializationCallbackReceiver
Properties
| Improve this Doc View SourceAudioClipManagementMode
The audio clip management mode of the playlist.
Declaration
public AudioClipManagementMode AudioClipManagementMode { get; set; }
Property Value
Type | Description |
---|---|
AudioClipManagementMode | An enum value. |
Remarks
This value is used only if OverrideAudioClipManagement flag is true.
AudioClipUnloadInterval
The audio clip unload interval of the playlist.
Declaration
public float AudioClipUnloadInterval { get; set; }
Property Value
Type | Description |
---|---|
System.Single | A time interval in seconds. |
Remarks
This value is used only if OverrideAudioClipManagement flag is true and GetAudioClipManagementMode() return value is UnloadUnused.
Bank
The music bank the playlist belongs to.
Declaration
public MusicBank Bank { get; set; }
Property Value
Type | Description |
---|---|
MusicBank | A reference to a music bank. |
ID
The unique identifier for fast access to the playlist.
Declaration
public int ID { get; }
Property Value
Type | Description |
---|---|
System.Int32 | A unique identifier value of the playlist. |
Name
The name of the playlist. Used for fast search in corresponding music bank.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String | Name of the playlist. |
OverrideAudioClipManagement
The flag indicating whether the playlist should use its own audio clip management mode and unload interval.
Declaration
public bool OverrideAudioClipManagement { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True, if the playlist has overridden audio clip management and unload interval. False otherwise. |
Remarks
This flag defines the behaviour of GetAudioClipManagementMode() and GetAudioClipUnloadInterval() methods.
If true, the playlist will use its own AudioClipManagementMode and AudioClipUnloadInterval properties. Otherwise, PlaylistManagementMode and PlaylistUnloadInterval properties of the containing bank will be used.
Tracks
The collection of playlist tracks.
Declaration
public ReadOnlyCollection<PlaylistTrack> Tracks { get; }
Property Value
Type | Description |
---|---|
System.Collections.ObjectModel.ReadOnlyCollection<PlaylistTrack> | A reference to a read-only collection of playlist tracks. |
Unfolded
The flag indicating whether the music bank inspector should show advanced settings for the playlist.
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.
Methods
| Improve this Doc View SourceAddTrack(AudioClip)
Adds a single music track to the playlist.
Declaration
public PlaylistTrack AddTrack(AudioClip clip)
Parameters
Type | Name | Description |
---|---|---|
AudioClip | clip | A reference to the audio clip with music data. |
Returns
Type | Description |
---|---|
PlaylistTrack | A reference to a newly created playlist track. |
AddTracks(AudioClip[])
Adds multiple music tracks (one per audio clip) to the playlist.
Declaration
public void AddTracks(AudioClip[] clips)
Parameters
Type | Name | Description |
---|---|---|
AudioClip[] | clips | An array of audio clips with music data. |
GetAudioClip(Int32)
Gets the audio clip at the specified index.
Declaration
public AudioClip GetAudioClip(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The zero-based index of the audio clip to get. |
Returns
Type | Description |
---|---|
AudioClip | A reference to an audio clip. |
GetAudioClipManagementMode()
Gets the audio clip management mode of the playlist.
Declaration
public AudioClipManagementMode GetAudioClipManagementMode()
Returns
Type | Description |
---|---|
AudioClipManagementMode | An enum value. |
Remarks
If OverrideAudioClipManagement value is true, AudioClipManagementMode will be used. Otherwise, PlaylistManagementMode value of the containing bank will be used.
GetAudioClipUnloadInterval()
Gets the audio clip unload interval of the playlist.
Declaration
public float GetAudioClipUnloadInterval()
Returns
Type | Description |
---|---|
System.Single | The time interval in seconds. |
Remarks
This value is only used if GetAudioClipManagementMode() return value is UnloadUnused
If OverrideAudioClipManagement value is true, AudioClipUnloadInterval will be used. Otherwise, PlaylistUnloadInterval value of the containing bank will be used.
GetNumAudioClips()
Gets the number of audio clips in the playlist.
Declaration
public int GetNumAudioClips()
Returns
Type | Description |
---|---|
System.Int32 | The number of audio clips. |
OnAfterDeserialize()
Prepares playlist 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.
OnBeforeSerialize()
Prepares playlist for serialization.
Declaration
public void OnBeforeSerialize()
Remarks
This method is automatically called by Unity during serialization process. Don't call it manually.