Interface IMusicPlayerService
Interface representing a music player service.
Namespace: Serenity.MusicPlayer.Application.Interfaces
Assembly: Serenity.MusicPlayer.Application.dll
Syntax
public interface IMusicPlayerService : IService, IFoundationSettings
Properties
IsEnabled
Gets or sets a value indicating whether the music player is enabled.
Declaration
bool IsEnabled { get; set; }
Property Value
| Type | Description |
|---|---|
| bool | True if the music player is enabled; otherwise, false. |
Methods
AddMusicTrack(MusicTrack)
Adds a music track for playback.
Declaration
void AddMusicTrack(MusicTrack musicTrack)
Parameters
| Type | Name | Description |
|---|---|---|
| MusicTrack | musicTrack | The music track to add. |
Enable()
Enables the music player service.
Declaration
void Enable()
Initialize(IGameSettingsService, IAudioPlayerSettings, object, IEventDispatcherService, ILogService)
Initializes the music player service.
Declaration
void Initialize(IGameSettingsService gameSettingsService, IAudioPlayerSettings settings, object audioSourceList, IEventDispatcherService eventDispatcherService, ILogService logService)
Parameters
| Type | Name | Description |
|---|---|---|
| IGameSettingsService | gameSettingsService | The game settings service. |
| IAudioPlayerSettings | settings | The audio player settings. |
| object | audioSourceList | The list of audio sources. |
| IEventDispatcherService | eventDispatcherService | The event dispatcher service. |
| ILogService | logService | The log service. |
Remarks
This method must be called before using the music player service.
PauseSong()
Pauses the currently playing song.
Declaration
void PauseSong()
PlayNextSong()
Plays the next song in the playlist.
Declaration
void PlayNextSong()
PlayPreviousSong()
Plays the previous song in the playlist.
Declaration
void PlayPreviousSong()
PlaySong()
Plays selected song.
Declaration
void PlaySong()
ResumeSong()
Resumes the currently paused song.
Declaration
void ResumeSong()
SetMusicTracks(List<MusicTrack>)
Sets the music tracks for playback.
Declaration
void SetMusicTracks(List<MusicTrack> musicTracks)
Parameters
| Type | Name | Description |
|---|---|---|
| List<MusicTrack> | musicTracks | The list of music tracks to set. |
StopSong()
Stops the currently playing song.
Declaration
void StopSong()