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

java.lang.Object
  extended by com.blackledge.david.tivo.multitasker.plugins.LocalAudio
All Implemented Interfaces:
Audio, LocalOptionProvider, TickerTape

public class LocalAudio
extends Object
implements Audio, TickerTape, LocalOptionProvider

non-smart implementation of getting local music URLs for everything in "My Music"

Version:
$Revision: 1.1 $

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.blackledge.david.tivo.multitasker.TickerTape
TickerTape.TickerTapeSegment, TickerTape.TickerTapeSegmentDefault
 
Field Summary
static String OPTION_LOCAL_MUSIC_FOLDER
           
 
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
LocalAudio()
           
 
Method Summary
 String getLocalOptionDefault(String key)
          defaults for each of the local option keys.
 Collection getLocalOptionNames()
          just the keySet of getLocalOptionPreferences()
 Map getLocalOptionPreferences()
          Add support for OPTION_LOCAL_MUSIC_FOLDER map of your option keys where the value is "Type[+],text [range]" per the MultiTaskerPreferences class.
 String getNextAudioStream()
          Provides the next Audio Stream to play.
 TickerTape.TickerTapeSegment getNextContent()
           
 void init(MultiTaskerApplication app)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OPTION_LOCAL_MUSIC_FOLDER

public static final String OPTION_LOCAL_MUSIC_FOLDER
See Also:
Constant Field Values
Constructor Detail

LocalAudio

public LocalAudio()
Method Detail

getNextAudioStream

public String getNextAudioStream()
Description copied from interface: Audio
Provides the next Audio Stream to play. Use a URL of the form app.getContext().getBaseURI().toString()+"local/"+myFilePath To play a file local to the current computer, where myFilePath is relative to the local file root defined in options.

Specified by:
getNextAudioStream in interface Audio
Returns:
a URL string that will provide an mp3 stream.

init

public void init(MultiTaskerApplication app)
Specified by:
init in interface Audio
Specified by:
init in interface TickerTape

getNextContent

public TickerTape.TickerTapeSegment getNextContent()
Specified by:
getNextContent in interface TickerTape

getLocalOptionNames

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

Specified by:
getLocalOptionNames in interface LocalOptionProvider
Returns:

getLocalOptionPreferences

public Map getLocalOptionPreferences()
Add support for OPTION_LOCAL_MUSIC_FOLDER 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()

getLocalOptionDefault

public String getLocalOptionDefault(String key)
Description copied from interface: LocalOptionProvider
defaults for each of the local option keys. Could just return null if there is no provided default. If the local option default starts with a +, it is appended (delimeted by a comma) to the getOptionDefault value, if any.

Specified by:
getLocalOptionDefault in interface LocalOptionProvider
Returns:
Option value to use if none is set or overridden.