public interface MetadataCacheListener
The listener interface for receiving updates when the set of attached metadata caches changes.
Classes that are interested displaying up-to-date information about attached metadata caches can implement this
interface, and then pass the implementing instance to MetadataFinder.addCacheListener(MetadataCacheListener).
Then, when a new metadata cache is attached, cacheAttached(SlotReference, ZipFile) will be called,
identifying the slot for which a cache is now available, and the cache file itself. When a cache is detached,
cacheDetached(SlotReference) will be called to report that the cache will no longer be used for that slot.
| Modifier and Type | Method and Description |
|---|---|
void |
cacheAttached(SlotReference slot,
ZipFile cache)
Invoked whenever a metadata cache is attached, so the player does not need to be queried when metadata
is desired for tracks in that slot.
|
void |
cacheDetached(SlotReference slot)
Invoked whenever a metadata cache is detached, so metadata must be obtained by querying the player.
|
void cacheAttached(SlotReference slot, ZipFile cache)
Invoked whenever a metadata cache is attached, so the player does not need to be queried when metadata is desired for tracks in that slot.
To reduce latency, updates are delivered to listeners directly on the thread that is receiving packets
from the network, so if you want to interact with user interface objects in this method, you need to use
javax.swing.SwingUtilities.invokeLater(Runnable)
to do so on the Event Dispatch Thread.
Even if you are not interacting with user interface objects, any code in this method must finish quickly, or it will add latency for other listeners, and device updates will back up. If you want to perform lengthy processing of any sort, do so on another thread.
slot - uniquely identifies a media slot on the network from which metadata can be requestedcache - the cache file which has just been attached to provide metadata for the slotvoid cacheDetached(SlotReference slot)
Invoked whenever a metadata cache is detached, so metadata must be obtained by querying the player.
To reduce latency, updates are delivered to listeners directly on the thread that is receiving packets
from the network, so if you want to interact with user interface objects in this method, you need to use
javax.swing.SwingUtilities.invokeLater(Runnable)
to do so on the Event Dispatch Thread.
Even if you are not interacting with user interface objects, any code in this method must finish quickly, or it will add latency for other listeners, and device updates will back up. If you want to perform lengthy processing of any sort, do so on another thread.
slot - uniquely identifies a media slot on the network from which metadata can be requestedCopyright © 2016–2018 Deep Symmetry, LLC. All rights reserved.