Interface MetadataCacheListener
-
public interface MetadataCacheListenerThe 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, MetadataCache)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.- Author:
- James Elliott
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcacheAttached(SlotReference slot, MetadataCache 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.voidcacheDetached(SlotReference slot)Invoked whenever a metadata cache is detached, so metadata must be obtained by querying the player.
-
-
-
Method Detail
-
cacheAttached
void cacheAttached(SlotReference slot, MetadataCache 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.
- Parameters:
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 slot
-
cacheDetached
void 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.
- Parameters:
slot- uniquely identifies a media slot on the network from which metadata can be requested
-
-