public class CommandHandler extends Object
Constructor and Description |
---|
CommandHandler(MusicHelper musicHelper,
MusicProvider musicProvider,
Runnable stopCallback,
Capabilities capabilities)
creates a new CommandHandler
|
Modifier and Type | Method and Description |
---|---|
void |
broadcastAvailablePlaylists(java.util.function.Supplier<List<String>> availablePlaylist,
java.util.function.Function<String,Playlist> playlistForNameFunction)
adds the ability to return the available playlists on request.
|
void |
handleCommandResources(EventModel eventModel)
this method gets called when a new Command was found.
|
void |
setJumpProgressController(java.util.function.Consumer<Progress> controller)
adds the ability to jump to a specified position of the current track
|
void |
setNextPreviousController(java.util.function.Consumer<String> controller)
adds the ability to select the next/previous track
|
void |
setPlaybackChangeableController(java.util.function.Consumer<String> controller)
adds the ability to change the playback
|
void |
setPlayPauseController(java.util.function.Consumer<String> controller)
adds the ability for the Play/Pause requests
|
void |
setTrackSelectorController(java.util.function.Consumer<TrackInfo> controller)
adds the ability to select tracks
|
void |
setVolumeChangeableController(java.util.function.Consumer<Volume> controller)
adds the ability to change the volume from outside the player
|
public CommandHandler(MusicHelper musicHelper, MusicProvider musicProvider, Runnable stopCallback, Capabilities capabilities)
musicHelper
- the musicHelpermusicProvider
- the musicProviderstopCallback
- the callback for the stop-commandcapabilities
- the capabilitiespublic void setPlayPauseController(java.util.function.Consumer<String> controller)
controller
- the controller for callbackpublic void setTrackSelectorController(java.util.function.Consumer<TrackInfo> controller)
controller
- the controller for callbackpublic void setNextPreviousController(java.util.function.Consumer<String> controller)
controller
- the controller for callbackpublic void setJumpProgressController(java.util.function.Consumer<Progress> controller)
controller
- the controller for callbackpublic void setPlaybackChangeableController(java.util.function.Consumer<String> controller)
controller
- the controller for callbackpublic void setVolumeChangeableController(java.util.function.Consumer<Volume> controller)
controller
- the controller for callbackpublic void broadcastAvailablePlaylists(java.util.function.Supplier<List<String>> availablePlaylist, java.util.function.Function<String,Playlist> playlistForNameFunction)
availablePlaylist
- retruns a List of Strings which represent the PlaylistsplaylistForNameFunction
- takes a String from the List and returns the Playlistpublic void handleCommandResources(EventModel eventModel)
eventModel
- the event with the CommandsCopyright © 2016. All rights reserved.