Interface MetadataCacheCreationListener


  • public interface MetadataCacheCreationListener

    The listener interface for receiving updates on the progress of creating a metadata cache file.

    Classes that are interested in displaying a progress bar during the (potentially lengthy) process, and allowing the user to cancel it, can implement this interface.

    The listener object created from that class is then passed to MetadataCache.createMetadataCache(SlotReference, int, File, MetadataCacheCreationListener) in order to be able to display progress during the process of creating the cache file. As each track is added to the cache, cacheCreationContinuing(TrackMetadata, int, int) is called, with the most recent track added, the number of tracks that have been added so far, and the total that need to be added. If it returns false, the creation of the cache file will be canceled.
    Author:
    James Elliott
    • Method Detail

      • cacheCreationContinuing

        boolean cacheCreationContinuing​(TrackMetadata lastTrackAdded,
                                        int tracksAdded,
                                        int totalTracksToAdd)
        Called to inform the listener that another track has been added to the metadata cache file being created. Allows the progress to be displayed, and for the process to be canceled if so desired.
        Parameters:
        lastTrackAdded - the most recent track that has been added to the metadata cache file
        tracksAdded - the number of tracks that have been added to the cache so far
        totalTracksToAdd - the total number of tracks that need to be added to the cache
        Returns:
        true if creation of the cache should continue, false if it should be aborted