Interface MetadataProvider


  • public interface MetadataProvider
    A class that is able to provide metadata for a loaded track without the need to query the source player can implement this interface and register itself with the MetadataFinder.addMetadataProvider(MetadataProvider). Examples include cue lists that store their own copies of the metadata.
    Since:
    0.5.0
    • Method Detail

      • supportedMedia

        List<MediaDetails> supportedMedia()
        Get the list of media devices for which metadata can be offered by this provider. If the provider can offer metadata for all media, return an empty list, and it will always be consulted. Otherwise, it will only be consulted for media that were listed in response to this call when it was registered using MetadataFinder.addMetadataProvider(MetadataProvider).
        Returns:
        the media device descriptors for which we have at least one available metadata item.
      • getTrackMetadata

        TrackMetadata getTrackMetadata​(MediaDetails sourceMedia,
                                       DataReference track)
        Get metadata for a particular track, if it is available.
        Parameters:
        sourceMedia - the media to which the track belongs, for use by providers which store metadata from multiple sources
        track - identifies the track whose metadata is desired; since track metadata always has a player and slot associated with it, those are needed as well as the rekordbox ID in order to create it
        Returns:
        the metadata corresponding to that track, or null if it is not a track for which we have metadata
      • getAlbumArt

        AlbumArt getAlbumArt​(MediaDetails sourceMedia,
                             DataReference art)
        Get a particular album art image, if it is available.
        Parameters:
        sourceMedia - the media to which the art belongs, for use by providers which store metadata from multiple sources
        art - identifies the album art whose metadata is desired; since art always has a player and slot associated with it, those are needed as well as the rekordbox ID in order to create it
        Returns:
        the art with the specified id, or null if we don't have it to offer
      • getBeatGrid

        BeatGrid getBeatGrid​(MediaDetails sourceMedia,
                             DataReference track)
        Get the beat grid for a particular track, if it is available.
        Parameters:
        sourceMedia - the media to which the track belongs, for use by providers which store metadata from multiple sources
        track - identifies the track whose beat grid is desired; since beat grids always have a player and slot associated with them, those are needed as well as the rekordbox ID in order to create one
        Returns:
        the beat grid corresponding to that track, or null if we don't have one to offer
      • getCueList

        CueList getCueList​(MediaDetails sourceMedia,
                           DataReference track)
        Get the cue list for a particular track, if it is available.
        Parameters:
        sourceMedia - the media to which the track belongs, for use by providers which store metadata from multiple sources
        track - identifies the track whose cue list is desired
        Returns:
        the cue list corresponding to that track, or null if we don't have one to offer
      • getWaveformPreview

        WaveformPreview getWaveformPreview​(MediaDetails sourceMedia,
                                           DataReference track)
        Get the waveform preview for a particular track, if it is available.
        Parameters:
        sourceMedia - the media to which the track belongs, for use by providers which store metadata from multiple sources
        track - identifies the track whose waveform preview is desired; since beat grids always have a player and slot associated with them, those are needed as well as the rekordbox ID in order to create one
        Returns:
        the waveform preview corresponding to that track, or null if we don't have one to offer
      • getWaveformDetail

        WaveformDetail getWaveformDetail​(MediaDetails sourceMedia,
                                         DataReference track)
        Get the waveform detail for a particular track, if it is available.
        Parameters:
        sourceMedia - the media to which the track belongs, for use by providers which store metadata from multiple sources
        track - identifies the track whose waveform detail is desired; since beat grids always have a player and slot associated with them, those are needed as well as the rekordbox ID in order to create one
        Returns:
        the waveform detail corresponding to that track, or null if we don't have one to offer
      • getAnalysisSection

        RekordboxAnlz.TaggedSection getAnalysisSection​(MediaDetails sourceMedia,
                                                       DataReference track,
                                                       String fileExtension,
                                                       String typeTag)
        Get an arbitrary analysis file element, given its file extension and type tag.
        Parameters:
        sourceMedia - the media to which the track belongs, for use by providers which store metadata from multiple sources
        track - identifies the track whose waveform detail is desired; since beat grids always have a player and slot associated with them, those are needed as well as the rekordbox ID in order to create one
        fileExtension - identifies which analysis file contains the desired data (we currently understand elements in the ".DAT" and ".EXT" files).
        typeTag - the four-character code identifying the specific section of the analysis file desired.
        Returns:
        the Kaitai Struct object representing the parsed matching section of the file, if one is found.