FXMusicLibrary

JavaFX-compatible entry point for managing an observable audio library, playlist hierarchy, and waveform repository. Exposes JavaFX properties for direct binding to UI components.

Composes ObservableAudioLibrary, ObservablePlaylistHierarchy, and an AudioWaveformRepository and wires their event subscriptions so that audio item changes propagate to dependent components automatically.

Construct via builder:

val library = FXMusicLibrary.builder()
.audioLibraryJsonFile(audioFile)
.playlistHierarchyJsonFile(playlistFile)
.build()

Types

Link copied to clipboard
class Builder

Builder for FXMusicLibrary.

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val albumCountProperty: ReadOnlyIntegerProperty

Observable count of distinct albums in the library.

Link copied to clipboard
val albumsProperty: ReadOnlySetProperty<Album>

Observable set of all albums across all artists in the library.

Link copied to clipboard
val artistCatalogPublisher: LirpEventPublisher<CrudEvent.Type, CrudEvent<Artist, ObservableArtistCatalog>>

Publisher that emits artist catalog CrudEvent notifications.

Link copied to clipboard

Observable set of all artist catalogs, each grouping albums and items by artist.

Link copied to clipboard
val artistsProperty: ReadOnlySetProperty<Artist>

Observable set of all distinct artists in the library.

Link copied to clipboard
val audioItemsProperty: ReadOnlyListProperty<ObservableAudioItem>

Observable list of all audio items in the library, suitable for direct JavaFX binding.

Link copied to clipboard
val emptyLibraryProperty: ReadOnlyBooleanProperty

Boolean property that is true when the library contains no audio items.

Link copied to clipboard
val playerSubscriber: PlayedEventSubscriber

Subscriber that receives AudioItemPlayerEvent notifications.

Link copied to clipboard
val playlistsProperty: ReadOnlySetProperty<ObservablePlaylist>

Observable set of all playlists in the hierarchy.

Functions

Link copied to clipboard
open override fun audioItemFromFile(path: Path): ObservableAudioItem

Creates an ObservableAudioItem from the audio file at path and adds it to the library.

Link copied to clipboard

Returns the underlying observable audio library for advanced operations.

Link copied to clipboard
open override fun close()
Link copied to clipboard
open override fun createPlaylist(name: String): ObservablePlaylist
@JvmName(name = "createPlaylistWithIds")
open override fun createPlaylist(name: String, audioItemIds: List<Int>): ObservablePlaylist

Creates a new playlist with name pre-populated with audioItems.

Link copied to clipboard
Link copied to clipboard
open override fun findPlaylistByName(name: String): Optional<out ObservablePlaylist>
Link copied to clipboard
open override fun movePlaylist(playlistNameToMove: String, destinationPlaylistName: String)
Link copied to clipboard

Returns the underlying observable playlist hierarchy for advanced operations.

Link copied to clipboard
fun waveformRepository(): AudioWaveformRepository<AudioWaveform, ObservableAudioItem>

Returns the underlying waveform repository for advanced operations.