com.blackledge.david.tivo.multitasker.plugins
Class AudioArtBackgroundImage

java.lang.Object
  extended by com.blackledge.david.tivo.multitasker.plugins.AudioArtBackgroundImage
All Implemented Interfaces:
BackgroundImage, Brand, LocalOptionProvider

public class AudioArtBackgroundImage
extends Object
implements BackgroundImage, Brand, LocalOptionProvider

BackgroundImage that attempts to get album art for and related to the currently playing Audio source via http://www.albumartexchange.com/search.php?q=.

Version:
$Revision: 1.1 $

Field Summary
static String OPTION_RELATED_IMAGES
          Option supported - should the art include related images? otherwise it's only the cover art of the current album, and returns null on further requests until the song changes.
 
Fields inherited from interface com.blackledge.david.tivo.multitasker.LocalOptionProvider
TYPE_BOOLEAN, TYPE_CLASS, TYPE_COLOR, TYPE_FILE, TYPE_FLOAT, TYPE_FOLDER, TYPE_IMAGE, TYPE_INTEGER, TYPE_STRING, TYPE_URL
 
Constructor Summary
AudioArtBackgroundImage()
           
 
Method Summary
 String getLocalOptionDefault(String key)
          default for related images is false.
 Collection getLocalOptionNames()
          just the keySet of getLocalOptionPreferences()
 Map getLocalOptionPreferences()
          Add support for OPTION_RELATED_IMAGES map of your option keys where the value is "Type[+],text [range]" per the MultiTaskerPreferences class.
 String getNextImage()
           
 com.tivo.hme.bananas.BView getUpdatedBrand(com.tivo.hme.bananas.BView brandParent)
          Simple impl of brand - just sets brand's resource to result of getNextImage() Not going to work nicely with simultaneous use of background image for non-shuffle mode.
 void init(MultiTaskerApplication app)
          initialize the plugin with the current application context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OPTION_RELATED_IMAGES

public static String OPTION_RELATED_IMAGES
Option supported - should the art include related images? otherwise it's only the cover art of the current album, and returns null on further requests until the song changes.

Constructor Detail

AudioArtBackgroundImage

public AudioArtBackgroundImage()
Method Detail

getNextImage

public String getNextImage()
Specified by:
getNextImage in interface BackgroundImage

init

public void init(MultiTaskerApplication app)
Description copied from interface: Brand
initialize the plugin with the current application context. Called once before Brand.getUpdatedBrand(BView) is ever called.

Specified by:
init in interface BackgroundImage
Specified by:
init in interface Brand

getLocalOptionDefault

public String getLocalOptionDefault(String key)
default for related images is false.

Specified by:
getLocalOptionDefault in interface LocalOptionProvider
Parameters:
key -
Returns:

getLocalOptionNames

public Collection getLocalOptionNames()
just the keySet of getLocalOptionPreferences()

Specified by:
getLocalOptionNames in interface LocalOptionProvider
Returns:

getLocalOptionPreferences

public Map getLocalOptionPreferences()
Add support for OPTION_RELATED_IMAGES map of your option keys where the value is "Type[+],text [range]" per the MultiTaskerPreferences class. Use a LinkedHashMap to maintain the order of your options.

Specified by:
getLocalOptionPreferences in interface LocalOptionProvider
Returns:
See Also:
LocalOptionProvider.getLocalOptionPreferences()

getUpdatedBrand

public com.tivo.hme.bananas.BView getUpdatedBrand(com.tivo.hme.bananas.BView brandParent)
Simple impl of brand - just sets brand's resource to result of getNextImage() Not going to work nicely with simultaneous use of background image for non-shuffle mode. Gets called to create the brand and any time the multitasker thinks it should be updated. Implementors are responsible for cleaning up your old View if creating a new one!

Specified by:
getUpdatedBrand in interface Brand
Parameters:
brandParent - the parent to use for the brand's view - constrains height/width/position
Returns:
View that contains the brand. Will be set visible or invisible as needed by multitasker. If null is returned, the Brand will be unchanged this "round."
See Also:
Brand.getUpdatedBrand(com.tivo.hme.bananas.BView)