Yureka LogoDocs

Music Player

The Music Player provides audio playback with playlist management, shuffle, repeat, and volume control. Music persists across window closes because playback lives in the USoundSubsystem.

Core Features

  • Playlist Scanning: Automatically discovers .mp3, .wav, .ogg, and .flac files in the VFS.
  • Transport Controls: Play, pause, skip forward/backward, and seek.
  • Shuffle & Repeat: Toggle shuffle mode and repeat (loop) mode.
  • Volume Control: Adjustable music volume via the USoundSubsystem.
  • Persistent Playback: Music continues playing even after the Music Player window is closed.
  • Now Playing Display: Shows current track name and playback progress.

Technical Details

  • Controller Class: UMusicPlayerApp (Inherits from UAppBase)
  • Widget Class: UMusicPlayerWidget (Hybrid — UMG BindWidgetOptional + embedded SMusicPlayer Slate)
  • Window Specs:
    • Initial Size: 300x500
    • Resizable: true
    • Maximizable: true
  • Category: "Media"

Key Controller Methods

  • ScanPlaylist() — Discovers audio tracks from the VFS.
  • PlayTrack(Index) / PlayNext() / PlayPrevious()
  • ToggleShuffle() / ToggleRepeat()
  • GetCurrentTrackIndex() / GetPlaylist()

Delegates

  • OnPlaylistChanged() (dynamic/BP)
  • OnCurrentTrackChanged(int32 Index, FOSSIMMusicTrack Track) (BP event)

Sound Integration

The Music Player is a user-facing controller for the USoundSubsystem, which handles the actual audio playback:

  • USoundSubsystem::PlayTrack(Track) — Loads audio via StaticLoadObject and polls for 0.25s completion.
  • USoundSubsystem::GetPlaybackProgress() — Returns normalized playback position (0.0–1.0).
  • USoundSubsystem::SeekToNormalized(Position) — Scrubs to a specific position.

Audio Track Data

FOSSIMMusicTrack: TrackName, VFSPath, AssetPath, DurationSeconds.

Default volumes: MasterVolume=0.75, MusicVolume=0.75, bIsLooping=false.