Package org.deepsymmetry.beatlink.data
Class MenuLoader
- java.lang.Object
-
- org.deepsymmetry.beatlink.data.MenuLoader
-
public class MenuLoader extends Object
Provides support for navigating the menu hierarchy offered by the dbserver on a player for a particular media slot. Note that for historical reasons, loading track metadata, playlists, and the full track list are performed by theMetadataFinder
, even though those are technically menu operations.- Since:
- 0.4.0
- Author:
- James Elliott
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MenuLoader
getInstance()
Get the singleton instance of this class.List<Message>
requestAlbumMenuFrom(SlotReference slotReference, int sortOrder)
Ask the specified player for an Album menu.List<Message>
requestAlbumTrackMenuFrom(SlotReference slotReference, int sortOrder, int albumId)
Ask the specified player for an Album Track menu.List<Message>
requestArtistAlbumMenuFrom(SlotReference slotReference, int sortOrder, int artistId)
Ask the specified player for an Artist Album menu.List<Message>
requestArtistAlbumTrackMenuFrom(SlotReference slotReference, int sortOrder, int artistId, int albumId)
Ask the specified player for an Artist Album Tracks menu.List<Message>
requestArtistMenuFrom(SlotReference slotReference, int sortOrder)
Ask the specified player for an Artist menu.List<Message>
requestBitRateMenuFrom(SlotReference slotReference, int sortOrder)
Ask the specified player for a Bit Rate menu.List<Message>
requestBpmMenuFrom(SlotReference slotReference, int sortOrder)
Ask the specified player for a BPM menu.List<Message>
requestBpmRangeMenuFrom(SlotReference slotReference, int sortOrder, int bpm)
Ask the specified player for a tempo range menu for a given BPM.List<Message>
requestColorMenuFrom(SlotReference slotReference, int sortOrder)
Ask the specified player for a Color menu.List<Message>
requestFilenameMenuFrom(SlotReference slotReference, int sortOrder)
Ask the specified player for a Filename menu.List<Message>
requestFolderMenuFrom(SlotReference slotReference, int sortOrder, int folderId)
Ask the specified player for a Folder menu for exploring its raw filesystem.List<Message>
requestGenreArtistAlbumMenuFrom(SlotReference slotReference, int sortOrder, int genreId, int artistId)
Ask the specified player for a Genre Artist Albums menu.List<Message>
requestGenreArtistAlbumTrackMenuFrom(SlotReference slotReference, int sortOrder, int genreId, int artistId, int albumId)
Ask the specified player for a Genre Artist Album Tracks menu.List<Message>
requestGenreArtistMenuFrom(SlotReference slotReference, int sortOrder, int genreId)
Ask the specified player for a Genre Artists menu.List<Message>
requestGenreMenuFrom(SlotReference slotReference, int sortOrder)
Ask the specified player for a Genre menu.List<Message>
requestHistoryMenuFrom(SlotReference slotReference, int sortOrder)
Ask the specified player for a History menu.List<Message>
requestHistoryPlaylistFrom(SlotReference slotReference, int sortOrder, int historyId)
Ask the specified player a History playlist.List<Message>
requestKeyMenuFrom(SlotReference slotReference, int sortOrder)
Ask the specified player for a Key menu.List<Message>
requestKeyNeighborMenuFrom(SlotReference slotReference, int sortOrder, int keyId)
Ask the specified player for a key neighbor menu for a given key.List<Message>
requestLabelArtistAlbumMenuFrom(SlotReference slotReference, int sortOrder, int labelId, int artistId)
Ask the specified player for a Label Artist Albums menu.List<Message>
requestLabelArtistAlbumTrackMenuFrom(SlotReference slotReference, int sortOrder, int labelId, int artistId, int albumId)
Ask the specified player for a Label Artist Album Tracks menu.List<Message>
requestLabelArtistMenuFrom(SlotReference slotReference, int sortOrder, int labelId)
Ask the specified player for a Label Artists menu.List<Message>
requestLabelMenuFrom(SlotReference slotReference, int sortOrder)
Ask the specified player for a Label menu.List<Message>
requestMoreSearchResultsFrom(int player, CdjStatus.TrackSourceSlot slot, int sortOrder, String text, int offset, int count)
Ask the specified player for more database records whose names containtext
.List<Message>
requestOriginalArtistAlbumMenuFrom(SlotReference slotReference, int sortOrder, int artistId)
Ask the specified player for an Original Artist Album menu.List<Message>
requestOriginalArtistAlbumTrackMenuFrom(SlotReference slotReference, int sortOrder, int artistId, int albumId)
Ask the specified player for an Original Artist Album Tracks menu.List<Message>
requestOriginalArtistMenuFrom(SlotReference slotReference, int sortOrder)
Ask the specified player for an Original Artist menu.List<Message>
requestPlaylistMenuFrom(SlotReference slotReference, int sortOrder)
Ask the specified player for a Playlist menu.List<Message>
requestRatingMenuFrom(SlotReference slotReference, int sortOrder)
Ask the specified player for a Rating menu.List<Message>
requestRemixerAlbumMenuFrom(SlotReference slotReference, int sortOrder, int artistId)
Ask the specified player for a Remixer Album menu.List<Message>
requestRemixerAlbumTrackMenuFrom(SlotReference slotReference, int sortOrder, int artistId, int albumId)
Ask the specified player for a Remixer Album Tracks menu.List<Message>
requestRemixerMenuFrom(SlotReference slotReference, int sortOrder)
Ask the specified player for a Remixer menu.List<Message>
requestRootMenuFrom(SlotReference slotReference, int sortOrder)
Ask the specified player for its top-level menu of menus.List<Message>
requestSearchResultsFrom(int player, CdjStatus.TrackSourceSlot slot, int sortOrder, String text, AtomicInteger count)
Ask the specified player for database records whose names containtext
.List<Message>
requestTimeMenuFrom(SlotReference slotReference, int sortOrder)
Ask the specified player for a Time menu, grouping tracks by their length in minutes.List<Message>
requestTrackMenuFrom(SlotReference slotReference, int sortOrder)
Ask the specified player for a Track menu.List<Message>
requestTracksByBitRateFrom(SlotReference slotReference, int sortOrder, int bitRate)
Ask the specified player for a track menu for a given track bit rate (in Kbps).List<Message>
requestTracksByBpmRangeFrom(SlotReference slotReference, int sortOrder, int bpm, int range)
Ask the specified player for tracks whose tempo falls within a specific percentage of a given BPM.List<Message>
requestTracksByColorFrom(SlotReference slotReference, int sortOrder, int color)
Ask the specified player for a track menu for a given color.List<Message>
requestTracksByDecadeAndYear(SlotReference slotReference, int sortOrder, int decade, int year)
Ask the specified player for a track menu for a decade and year.List<Message>
requestTracksByKeyAndDistanceFrom(SlotReference slotReference, int sortOrder, int keyId, int distance)
Ask the specified player for a track menu for an allowed distance from a given key.List<Message>
requestTracksByRatingFrom(SlotReference slotReference, int sortOrder, int rating)
Ask the specified player for a track menu for a given rating.List<Message>
requestTracksByTimeFrom(SlotReference slotReference, int sortOrder, int time)
Ask the specified player for a track menu for a given time (track length in minutes).List<Message>
requestYearMenuFrom(SlotReference slotReference, int sortOrder)
Ask the specified player for a Year menu, grouping years by decade.List<Message>
requestYearsByDecadeFrom(SlotReference slotReference, int sortOrder, int decade)
Ask the specified player for a year menu for a given decade.
-
-
-
Method Detail
-
requestRootMenuFrom
public List<Message> requestRootMenuFrom(SlotReference slotReference, int sortOrder) throws Exception
Ask the specified player for its top-level menu of menus. TheMetadataFinder
must be running for us to know the right kind of message to send, because it depends on whether the slot holds a rekordbox database or not. If we can't tell (because it's not running), we will just guess that there is one, and perhaps get back nothing.- Parameters:
slotReference
- the player and slot for which the menu is desiredsortOrder
- the order in which responses should be sorted, 0 for default, see the Packet Analysis document for details, although it does not seem to have an effect on the root menu- Returns:
- the entries in the top level menu
- Throws:
Exception
- if there is a problem obtaining the menu
-
requestPlaylistMenuFrom
public List<Message> requestPlaylistMenuFrom(SlotReference slotReference, int sortOrder) throws Exception
Ask the specified player for a Playlist menu. This boils down to a call toMetadataFinder.requestPlaylistItemsFrom(int, CdjStatus.TrackSourceSlot, int, int, boolean)
asking for the playlist folder with ID 0, but it is also made available here since this is likely where people will be looking for the capability. To get the contents of individual playlists or sub-folders, pass the playlist or folder ID obtained by calling this to that function.- Parameters:
slotReference
- the player and slot for which the menu is desiredsortOrder
- the order in which responses should be sorted, 0 for default, see the Packet Analysis document for details- Returns:
- the playlists and folders in the playlist menu
- Throws:
Exception
- if there is a problem obtaining the menu- See Also:
MetadataFinder.requestPlaylistItemsFrom(int, CdjStatus.TrackSourceSlot, int, int, boolean)
-
requestHistoryMenuFrom
public List<Message> requestHistoryMenuFrom(SlotReference slotReference, int sortOrder) throws Exception
Ask the specified player for a History menu.- Parameters:
slotReference
- the player and slot for which the menu is desiredsortOrder
- the order in which responses should be sorted, 0 for default, see the Packet Analysis document for details, although it does not seem to have an effect on the history menu- Returns:
- the entries in the history menu
- Throws:
Exception
- if there is a problem obtaining the menu
-
requestHistoryPlaylistFrom
public List<Message> requestHistoryPlaylistFrom(SlotReference slotReference, int sortOrder, int historyId) throws Exception
Ask the specified player a History playlist.- Parameters:
slotReference
- the player and slot for which the playlist is desiredsortOrder
- the order in which responses should be sorted, 0 for default, see the Packet Analysis document for detailshistoryId
- identifies which history session's playlist is desired- Returns:
- the entries in the history playlist
- Throws:
Exception
- if there is a problem obtaining the playlist
-
requestTrackMenuFrom
public List<Message> requestTrackMenuFrom(SlotReference slotReference, int sortOrder) throws Exception
Ask the specified player for a Track menu.- Parameters:
slotReference
- the player and slot for which the menu is desiredsortOrder
- the order in which responses should be sorted, 0 for default, see the Packet Analysis document for details- Returns:
- the entries in the track menu
- Throws:
Exception
- if there is a problem obtaining the menu
-
requestArtistMenuFrom
public List<Message> requestArtistMenuFrom(SlotReference slotReference, int sortOrder) throws Exception
Ask the specified player for an Artist menu.- Parameters:
slotReference
- the player and slot for which the menu is desiredsortOrder
- the order in which responses should be sorted, 0 for default, see the Packet Analysis document for details- Returns:
- the entries in the artist menu
- Throws:
Exception
- if there is a problem obtaining the menu
-
requestArtistAlbumMenuFrom
public List<Message> requestArtistAlbumMenuFrom(SlotReference slotReference, int sortOrder, int artistId) throws Exception
Ask the specified player for an Artist Album menu.- Parameters:
slotReference
- the player and slot for which the menu is desiredsortOrder
- the order in which responses should be sorted, 0 for default, see the Packet Analysis document for detailsartistId
- the artist whose album menu is desired- Returns:
- the entries in the artist album menu
- Throws:
Exception
- if there is a problem obtaining the menu
-
requestArtistAlbumTrackMenuFrom
public List<Message> requestArtistAlbumTrackMenuFrom(SlotReference slotReference, int sortOrder, int artistId, int albumId) throws Exception
Ask the specified player for an Artist Album Tracks menu.- Parameters:
slotReference
- the player and slot for which the menu is desiredsortOrder
- the order in which responses should be sorted, 0 for default, see the Packet Analysis document for detailsartistId
- the artist whose album track menu is desiredalbumId
- the album whose track menu is desired, or -1 for all albums- Returns:
- the entries in the artist album tracks menu
- Throws:
Exception
- if there is a problem obtaining the menu
-
requestOriginalArtistMenuFrom
public List<Message> requestOriginalArtistMenuFrom(SlotReference slotReference, int sortOrder) throws Exception
Ask the specified player for an Original Artist menu.- Parameters:
slotReference
- the player and slot for which the menu is desiredsortOrder
- the order in which responses should be sorted, 0 for default, see the Packet Analysis document for details- Returns:
- the entries in the original artist menu
- Throws:
Exception
- if there is a problem obtaining the menu
-
requestOriginalArtistAlbumMenuFrom
public List<Message> requestOriginalArtistAlbumMenuFrom(SlotReference slotReference, int sortOrder, int artistId) throws Exception
Ask the specified player for an Original Artist Album menu.- Parameters:
slotReference
- the player and slot for which the menu is desiredsortOrder
- the order in which responses should be sorted, 0 for default, see the Packet Analysis document for detailsartistId
- the original artist whose album menu is desired- Returns:
- the entries in the original artist album menu
- Throws:
Exception
- if there is a problem obtaining the menu
-
requestOriginalArtistAlbumTrackMenuFrom
public List<Message> requestOriginalArtistAlbumTrackMenuFrom(SlotReference slotReference, int sortOrder, int artistId, int albumId) throws Exception
Ask the specified player for an Original Artist Album Tracks menu.- Parameters:
slotReference
- the player and slot for which the menu is desiredsortOrder
- the order in which responses should be sorted, 0 for default, see the Packet Analysis document for detailsartistId
- the original artist whose album track menu is desiredalbumId
- the album whose track menu is desired, or -1 for all albums- Returns:
- the entries in the original artist album tracks menu
- Throws:
Exception
- if there is a problem obtaining the menu
-
requestRemixerMenuFrom
public List<Message> requestRemixerMenuFrom(SlotReference slotReference, int sortOrder) throws Exception
Ask the specified player for a Remixer menu.- Parameters:
slotReference
- the player and slot for which the menu is desiredsortOrder
- the order in which responses should be sorted, 0 for default, see the Packet Analysis document for details- Returns:
- the entries in the remixer menu
- Throws:
Exception
- if there is a problem obtaining the menu
-
requestRemixerAlbumMenuFrom
public List<Message> requestRemixerAlbumMenuFrom(SlotReference slotReference, int sortOrder, int artistId) throws Exception
Ask the specified player for a Remixer Album menu.- Parameters:
slotReference
- the player and slot for which the menu is desiredsortOrder
- the order in which responses should be sorted, 0 for default, see the Packet Analysis document for detailsartistId
- the remixer whose album menu is desired- Returns:
- the entries in the remixer album menu
- Throws:
Exception
- if there is a problem obtaining the menu
-
requestRemixerAlbumTrackMenuFrom
public List<Message> requestRemixerAlbumTrackMenuFrom(SlotReference slotReference, int sortOrder, int artistId, int albumId) throws Exception
Ask the specified player for a Remixer Album Tracks menu.- Parameters:
slotReference
- the player and slot for which the menu is desiredsortOrder
- the order in which responses should be sorted, 0 for default, see of the Packet Analysis document for detailsartistId
- the remixer whose album track menu is desiredalbumId
- the album whose track menu is desired, or -1 for all albums- Returns:
- the entries in the remixer album tracks menu
- Throws:
Exception
- if there is a problem obtaining the menu
-
requestAlbumTrackMenuFrom
public List<Message> requestAlbumTrackMenuFrom(SlotReference slotReference, int sortOrder, int albumId) throws Exception
Ask the specified player for an Album Track menu.- Parameters:
slotReference
- the player and slot for which the menu is desiredsortOrder
- the order in which responses should be sorted, 0 for default, see the Packet Analysis document for detailsalbumId
- the album whose track menu is desired- Returns:
- the entries in the album track menu
- Throws:
Exception
- if there is a problem obtaining the menu
-
requestGenreMenuFrom
public List<Message> requestGenreMenuFrom(SlotReference slotReference, int sortOrder) throws Exception
Ask the specified player for a Genre menu.- Parameters:
slotReference
- the player and slot for which the menu is desiredsortOrder
- the order in which responses should be sorted, 0 for default, see the Packet Analysis document for details- Returns:
- the entries in the genre menu
- Throws:
Exception
- if there is a problem obtaining the menu
-
requestGenreArtistMenuFrom
public List<Message> requestGenreArtistMenuFrom(SlotReference slotReference, int sortOrder, int genreId) throws Exception
Ask the specified player for a Genre Artists menu.- Parameters:
slotReference
- the player and slot for which the menu is desiredsortOrder
- the order in which responses should be sorted, 0 for default, see the Packet Analysis document for detailsgenreId
- the genre whose artist menu is desired- Returns:
- the entries in the genre artists menu
- Throws:
Exception
- if there is a problem obtaining the menu
-
requestGenreArtistAlbumMenuFrom
public List<Message> requestGenreArtistAlbumMenuFrom(SlotReference slotReference, int sortOrder, int genreId, int artistId) throws Exception
Ask the specified player for a Genre Artist Albums menu.- Parameters:
slotReference
- the player and slot for which the menu is desiredsortOrder
- the order in which responses should be sorted, 0 for default, see the Packet Analysis document for detailsgenreId
- the genre whose artist album menu is desiredartistId
- the artist whose album menu is desired, or -1 for all artists- Returns:
- the entries in the genre artist albums menu
- Throws:
Exception
- if there is a problem obtaining the menu
-
requestGenreArtistAlbumTrackMenuFrom
public List<Message> requestGenreArtistAlbumTrackMenuFrom(SlotReference slotReference, int sortOrder, int genreId, int artistId, int albumId) throws Exception
Ask the specified player for a Genre Artist Album Tracks menu.- Parameters:
slotReference
- the player and slot for which the menu is desiredsortOrder
- the order in which responses should be sorted, 0 for default, see the Packet Analysis document for detailsgenreId
- the genre whose artist album track menu is desiredartistId
- the artist whose album track menu is desired, or -1 for all artistsalbumId
- the album whose track menu is desired, or -1 for all albums- Returns:
- the entries in the genre artist album tracks menu
- Throws:
Exception
- if there is a problem obtaining the menu
-
requestLabelMenuFrom
public List<Message> requestLabelMenuFrom(SlotReference slotReference, int sortOrder) throws Exception
Ask the specified player for a Label menu.- Parameters:
slotReference
- the player and slot for which the menu is desiredsortOrder
- the order in which responses should be sorted, 0 for default, see the Packet Analysis document for details- Returns:
- the entries in the label menu
- Throws:
Exception
- if there is a problem obtaining the menu
-
requestLabelArtistMenuFrom
public List<Message> requestLabelArtistMenuFrom(SlotReference slotReference, int sortOrder, int labelId) throws Exception
Ask the specified player for a Label Artists menu.- Parameters:
slotReference
- the player and slot for which the menu is desiredsortOrder
- the order in which responses should be sorted, 0 for default, see the Packet Analysis document for detailslabelId
- the label whose artist menu is desired- Returns:
- the entries in the label artists menu
- Throws:
Exception
- if there is a problem obtaining the menu
-
requestLabelArtistAlbumMenuFrom
public List<Message> requestLabelArtistAlbumMenuFrom(SlotReference slotReference, int sortOrder, int labelId, int artistId) throws Exception
Ask the specified player for a Label Artist Albums menu.- Parameters:
slotReference
- the player and slot for which the menu is desiredsortOrder
- the order in which responses should be sorted, 0 for default, see the Packet Analysis document for detailslabelId
- the label whose artist album menu is desiredartistId
- the artist whose album menu is desired, or -1 for all artists- Returns:
- the entries in the label artist albums menu
- Throws:
Exception
- if there is a problem obtaining the menu
-
requestLabelArtistAlbumTrackMenuFrom
public List<Message> requestLabelArtistAlbumTrackMenuFrom(SlotReference slotReference, int sortOrder, int labelId, int artistId, int albumId) throws Exception
Ask the specified player for a Label Artist Album Tracks menu.- Parameters:
slotReference
- the player and slot for which the menu is desiredsortOrder
- the order in which responses should be sorted, 0 for default, see the Packet Analysis document for detailslabelId
- the label whose artist album track menu is desiredartistId
- the artist whose album track menu is desired, or -1 for all artistsalbumId
- the album whose track menu is desired, or -1 for all albums- Returns:
- the entries in the label artist album tracks menu
- Throws:
Exception
- if there is a problem obtaining the menu
-
requestAlbumMenuFrom
public List<Message> requestAlbumMenuFrom(SlotReference slotReference, int sortOrder) throws Exception
Ask the specified player for an Album menu.- Parameters:
slotReference
- the player and slot for which the menu is desiredsortOrder
- the order in which responses should be sorted, 0 for default, see the Packet Analysis document for details- Returns:
- the entries in the album menu
- Throws:
Exception
- if there is a problem obtaining the menu
-
requestKeyMenuFrom
public List<Message> requestKeyMenuFrom(SlotReference slotReference, int sortOrder) throws Exception
Ask the specified player for a Key menu.- Parameters:
slotReference
- the player and slot for which the menu is desiredsortOrder
- the order in which responses should be sorted, 0 for default, see the Packet Analysis document for details- Returns:
- the entries in the key menu
- Throws:
Exception
- if there is a problem obtaining the menu
-
requestKeyNeighborMenuFrom
public List<Message> requestKeyNeighborMenuFrom(SlotReference slotReference, int sortOrder, int keyId) throws Exception
Ask the specified player for a key neighbor menu for a given key.- Parameters:
slotReference
- the player and slot for which the menu is desiredkeyId
- the key whose available compatible keys are desiredsortOrder
- the order in which responses should be sorted, 0 for default, see the Packet Analysis document for details- Returns:
- the entries in the key neighbor menu
- Throws:
Exception
- if there is a problem obtaining the menu
-
requestTracksByKeyAndDistanceFrom
public List<Message> requestTracksByKeyAndDistanceFrom(SlotReference slotReference, int sortOrder, int keyId, int distance) throws Exception
Ask the specified player for a track menu for an allowed distance from a given key.- Parameters:
slotReference
- the player and slot for which the menu is desiredkeyId
- the key whose compatible tracks are desireddistance
- how far along the circle of fifths are the tracks allowed to be from the specified keysortOrder
- the order in which responses should be sorted, 0 for default, see the Packet Analysis document for details- Returns:
- the matching tracks
- Throws:
Exception
- if there is a problem obtaining the menu
-
requestBpmMenuFrom
public List<Message> requestBpmMenuFrom(SlotReference slotReference, int sortOrder) throws Exception
Ask the specified player for a BPM menu.- Parameters:
slotReference
- the player and slot for which the menu is desiredsortOrder
- the order in which responses should be sorted, 0 for default, see the Packet Analysis document for details- Returns:
- the entries in the BPM menu
- Throws:
Exception
- if there is a problem obtaining the menu
-
requestBpmRangeMenuFrom
public List<Message> requestBpmRangeMenuFrom(SlotReference slotReference, int sortOrder, int bpm) throws Exception
Ask the specified player for a tempo range menu for a given BPM.- Parameters:
slotReference
- the player and slot for which the menu is desiredbpm
- the tempo whose nearby ranges are desiredsortOrder
- the order in which responses should be sorted, 0 for default, see the Packet Analysis document for details- Returns:
- the entries in the tempo range menu
- Throws:
Exception
- if there is a problem obtaining the menu
-
requestTracksByBpmRangeFrom
public List<Message> requestTracksByBpmRangeFrom(SlotReference slotReference, int sortOrder, int bpm, int range) throws Exception
Ask the specified player for tracks whose tempo falls within a specific percentage of a given BPM.- Parameters:
slotReference
- the player and slot for which the menu is desiredbpm
- the tempo that tracks must be close torange
- the percentage by which the actual tempo may differ for a track to still be returnedsortOrder
- the order in which responses should be sorted, 0 for default, see the Packet Analysis document for details- Returns:
- the tracks whose tempo falls within the specified range
- Throws:
Exception
- if there is a problem obtaining the menu
-
requestRatingMenuFrom
public List<Message> requestRatingMenuFrom(SlotReference slotReference, int sortOrder) throws Exception
Ask the specified player for a Rating menu.- Parameters:
slotReference
- the player and slot for which the menu is desiredsortOrder
- the order in which responses should be sorted, 0 for default, see the Packet Analysis document for details- Returns:
- the entries in the rating menu
- Throws:
Exception
- if there is a problem obtaining the menu
-
requestTracksByRatingFrom
public List<Message> requestTracksByRatingFrom(SlotReference slotReference, int sortOrder, int rating) throws Exception
Ask the specified player for a track menu for a given rating.- Parameters:
slotReference
- the player and slot for which the menu is desiredrating
- the desired rating for tracks to be returnedsortOrder
- the order in which responses should be sorted, 0 for default, see the Packet Analysis document for details- Returns:
- the matching tracks
- Throws:
Exception
- if there is a problem obtaining the menu
-
requestColorMenuFrom
public List<Message> requestColorMenuFrom(SlotReference slotReference, int sortOrder) throws Exception
Ask the specified player for a Color menu.- Parameters:
slotReference
- the player and slot for which the menu is desiredsortOrder
- the order in which responses should be sorted, 0 for default, see the Packet Analysis document for details- Returns:
- the entries in the color menu
- Throws:
Exception
- if there is a problem obtaining the menu
-
requestTracksByColorFrom
public List<Message> requestTracksByColorFrom(SlotReference slotReference, int sortOrder, int color) throws Exception
Ask the specified player for a track menu for a given color.- Parameters:
slotReference
- the player and slot for which the menu is desiredcolor
- the desired color for tracks to be returnedsortOrder
- the order in which responses should be sorted, 0 for default, see the Packet Analysis document for details- Returns:
- the matching tracks
- Throws:
Exception
- if there is a problem obtaining the menu
-
requestTimeMenuFrom
public List<Message> requestTimeMenuFrom(SlotReference slotReference, int sortOrder) throws Exception
Ask the specified player for a Time menu, grouping tracks by their length in minutes.- Parameters:
slotReference
- the player and slot for which the menu is desiredsortOrder
- the order in which responses should be sorted, 0 for default, see the Packet Analysis document for details- Returns:
- the entries in the time menu
- Throws:
Exception
- if there is a problem obtaining the menu
-
requestTracksByTimeFrom
public List<Message> requestTracksByTimeFrom(SlotReference slotReference, int sortOrder, int time) throws Exception
Ask the specified player for a track menu for a given time (track length in minutes).- Parameters:
slotReference
- the player and slot for which the menu is desiredtime
- the length in minutes of tracks to be returnedsortOrder
- the order in which responses should be sorted, 0 for default, see the Packet Analysis document for details- Returns:
- the matching tracks
- Throws:
Exception
- if there is a problem obtaining the menu
-
requestBitRateMenuFrom
public List<Message> requestBitRateMenuFrom(SlotReference slotReference, int sortOrder) throws Exception
Ask the specified player for a Bit Rate menu.- Parameters:
slotReference
- the player and slot for which the menu is desiredsortOrder
- the order in which responses should be sorted, 0 for default, see the Packet Analysis document for details- Returns:
- the entries in the bit rate menu
- Throws:
Exception
- if there is a problem obtaining the menu
-
requestTracksByBitRateFrom
public List<Message> requestTracksByBitRateFrom(SlotReference slotReference, int sortOrder, int bitRate) throws Exception
Ask the specified player for a track menu for a given track bit rate (in Kbps).- Parameters:
slotReference
- the player and slot for which the menu is desiredbitRate
- the bit rate, in kilobits per second, of tracks to be returnedsortOrder
- the order in which responses should be sorted, 0 for default, see the Packet Analysis document for details- Returns:
- the matching tracks
- Throws:
Exception
- if there is a problem obtaining the menu
-
requestYearMenuFrom
public List<Message> requestYearMenuFrom(SlotReference slotReference, int sortOrder) throws Exception
Ask the specified player for a Year menu, grouping years by decade.- Parameters:
slotReference
- the player and slot for which the menu is desiredsortOrder
- the order in which responses should be sorted, 0 for default, see the Packet Analysis document for details- Returns:
- the entries in the year menu
- Throws:
Exception
- if there is a problem obtaining the menu
-
requestYearsByDecadeFrom
public List<Message> requestYearsByDecadeFrom(SlotReference slotReference, int sortOrder, int decade) throws Exception
Ask the specified player for a year menu for a given decade.- Parameters:
slotReference
- the player and slot for which the menu is desireddecade
- narrows the years of tracks to be returnedsortOrder
- the order in which responses should be sorted, 0 for default, see the Packet Analysis document for details- Returns:
- the matching tracks
- Throws:
Exception
- if there is a problem obtaining the menu
-
requestTracksByDecadeAndYear
public List<Message> requestTracksByDecadeAndYear(SlotReference slotReference, int sortOrder, int decade, int year) throws Exception
Ask the specified player for a track menu for a decade and year.- Parameters:
slotReference
- the player and slot for which the menu is desireddecade
- the decade for which tracks are desiredyear
- the specific year for which tracks are desired, or -1 for all years within the specified decadesortOrder
- the order in which responses should be sorted, 0 for default, see the Packet Analysis document for details- Returns:
- the matching tracks
- Throws:
Exception
- if there is a problem obtaining the menu
-
requestFilenameMenuFrom
public List<Message> requestFilenameMenuFrom(SlotReference slotReference, int sortOrder) throws Exception
Ask the specified player for a Filename menu.- Parameters:
slotReference
- the player and slot for which the menu is desiredsortOrder
- the order in which responses should be sorted, 0 for default, see the Packet Analysis document for details- Returns:
- the entries in the filename menu
- Throws:
Exception
- if there is a problem obtaining the menu
-
requestFolderMenuFrom
public List<Message> requestFolderMenuFrom(SlotReference slotReference, int sortOrder, int folderId) throws Exception
Ask the specified player for a Folder menu for exploring its raw filesystem. This is a request for unanalyzed items, so we do a typed menu request.- Parameters:
slotReference
- the player and slot for which the menu is desiredsortOrder
- the order in which responses should be sorted, 0 for default, see the Packet Analysis document for detailsfolderId
- identifies the folder whose contents should be listed, use -1 to get the root folder- Returns:
- the entries in the folder menu
- Throws:
Exception
- if there is a problem obtaining the menu
-
requestSearchResultsFrom
public List<Message> requestSearchResultsFrom(int player, CdjStatus.TrackSourceSlot slot, int sortOrder, String text, AtomicInteger count) throws Exception
Ask the specified player for database records whose names containtext
. Ifcount
is notnull
, no more than that many results will be returned, and the value will be set to the total number of results that were available. Otherwise all results will be returned.- Parameters:
player
- the player number whose database is to be searchedslot
- the slot in which the database can be foundsortOrder
- the order in which responses should be sorted, 0 for default, see the Packet Analysis document for details, although it does not seem to have an effect on searches.text
- the search text used to filter the resultscount
- if present, sets an upper limit on the number of results to return, and will get set to the actual number that were available- Returns:
- the items that the specified search string; they may be a variety of different types
- Throws:
Exception
- if there is a problem performing the search
-
requestMoreSearchResultsFrom
public List<Message> requestMoreSearchResultsFrom(int player, CdjStatus.TrackSourceSlot slot, int sortOrder, String text, int offset, int count) throws Exception
Ask the specified player for more database records whose names containtext
. This can be used after callingrequestSearchResultsFrom(int, CdjStatus.TrackSourceSlot, int, String, AtomicInteger)
to obtain a partial result and the total count available, to gradually expand the search under direction from the user.- Parameters:
player
- the player number whose database is to be searchedslot
- the slot in which the database can be foundsortOrder
- the order in which responses should be sorted, 0 for default, see the Packet Analysis document for details, although it does not seem to have an effect on searches.text
- the search text used to filter the resultsoffset
- the first result desired (the first available result has offset 0)count
- the number of results to return (if more than the number available, fewer will simply be returned)- Returns:
- the items that the specified search string; they may be a variety of different types
- Throws:
Exception
- if there is a problem performing the search
-
getInstance
public static MenuLoader getInstance()
Get the singleton instance of this class.- Returns:
- the only instance of this class which exists.
-
-