Class MusicManager
- Namespace
- OmegaEngine.Audio
- Assembly
- OmegaEngine.dll
Manages the playback of Song in the background controlled by themes.
public sealed class MusicManager : IDisposable
- Inheritance
-
MusicManager
- Implements
- Inherited Members
- Extension Methods
Properties
Playing
Is music currently being played?
public bool Playing { get; }
Property Value
Methods
AddSong(string, params string[])
Adds a new song to the list
public void AddSong(string id, params string[] themes)
Parameters
id
stringThe file name of the song
themes
string[]The names of all themes the song is associated to
Exceptions
- InvalidOperationException
This song was already loaded.
- IOException
There was a problem loading the song.
Dispose()
Disposes all Songs maintained by this MusicManager
public void Dispose()
~MusicManager()
protected ~MusicManager()
LoadLibrary(string)
Populates the music manager with songs listed in a library file
public void LoadLibrary(string id)
Parameters
id
stringThe ID of the library file to load
PlaySong(string)
Plays a specific song
public void PlaySong(string id)
Parameters
id
stringThe name of the song to play
PlayTheme(string)
Starts playing random songs from a certain theme
public void PlayTheme(string theme)
Parameters
theme
stringThe name of the new theme - must not be
null
Stop(bool)
Stops the currently playing song
public void Stop(bool fade)
Parameters
fade
boolTrue to fade out the music instead of immediately cutting it off
SwitchTheme(string?)
Switches to a new theme, but doesn't interrupt the current song
public void SwitchTheme(string? theme)
Parameters
theme
stringThe name of the new theme; may be
null
Update()
Plays the next song from the current theme (if any) if the last one stopped
public void Update()