public class Radio extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Radio.RadioStation |
Modifier and Type | Field and Description |
---|---|
private int |
expiry |
private Session |
session |
private String |
stationName |
private String |
stationUrl |
private boolean |
supportsDiscovery |
private String |
type |
Modifier | Constructor and Description |
---|---|
private |
Radio(Session session) |
Modifier and Type | Method and Description |
---|---|
Playlist |
getPlaylist()
Fetches a new radio playlist or
null if an error occured, such as when the user is not allowed to stream radio
(no subscriber). |
Playlist |
getPlaylist(boolean discovery,
boolean rtp)
Fetches a new radio playlist.
|
Playlist |
getPlaylist(boolean discovery,
boolean rtp,
boolean buyLinks,
double speedMultiplier,
int bitrate)
Fetches a new radio playlist.
|
String |
getStationName() |
String |
getStationUrl() |
String |
getType() |
int |
playlistExpiresIn()
Returns the playlist expiration value for the last playlist fetchet, or -1 if no playlist has been fetched yet.
|
static Radio.RadioStation |
search(String name,
String apiKey)
Resolve the name of a resource into a station depending on which resource it is most likely to represent
|
boolean |
supportsDiscovery() |
static Radio |
tune(Radio.RadioStation station,
Locale locale,
Session session)
Tune in to a Last.fm radio station.
|
static Radio |
tune(Radio.RadioStation station,
Session session)
Tune in to a Last.fm radio station.
|
static Radio |
tune(String station,
Locale locale,
Session session)
Tune in to a Last.fm radio station.
|
private String stationName
private String stationUrl
private boolean supportsDiscovery
private int expiry
public String getStationName()
public String getStationUrl()
public boolean supportsDiscovery()
public int playlistExpiresIn()
public static Radio.RadioStation search(String name, String apiKey)
name
- The tag or artist to resolveapiKey
- A Last.fm API key.Radio.RadioStation
or null
public static Radio tune(Radio.RadioStation station, Session session)
station
- An instance of Radio.RadioStation
session
- A Session instancepublic static Radio tune(Radio.RadioStation station, Locale locale, Session session)
station
- An instance of Radio.RadioStation
locale
- The language you want the radio's name insession
- A Session instancepublic static Radio tune(String station, Locale locale, Session session)
station
- A lastfm radio URLlocale
- The language you want the radio's name insession
- A Session instancepublic Playlist getPlaylist()
null
if an error occured, such as when the user is not allowed to stream radio
(no subscriber).Playlist
or null
public Playlist getPlaylist(boolean discovery, boolean rtp)
discovery
- Whether to request last.fm content with discovery mode switched onrtp
- Whether the user is scrobbling or not during this radio session (helps content generation)public Playlist getPlaylist(boolean discovery, boolean rtp, boolean buyLinks, double speedMultiplier, int bitrate)
discovery
- Whether to request last.fm content with discovery mode switched onrtp
- Whether the user is scrobbling or not during this radio session (helps content generation)buyLinks
- Whether the response should contain links for purchase/download, if availablespeedMultiplier
- The rate at which to provide the stream (supported multipliers are 1.0 and 2.0)bitrate
- What bitrate to stream content at, in kbps (supported bitrates are 64 and 128)WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses