public class

Preferences

extends Model
java.lang.Object
   ↳ java.util.Observable
     ↳ fm.audiobox.core.models.Model
       ↳ fm.audiobox.core.models.Preferences

Class Overview

General preferences of the user, mostly used in the Cloud Web Player.

Summary

Constants
String PATH
Fields
public static final Map<String, String> COLORS Contains the color mapping: key is the name, value is the RGB value.
protected boolean accept_emails
protected boolean autoplay
protected String color
protected boolean hide_tooltips
protected boolean js_demuxer
protected boolean prebuffer
protected boolean repeat
protected boolean shuffle
protected String top_bar_bg
protected String volume_level
Public Constructors
Preferences()
Public Methods
boolean areTooltipsHidden()
Checks whether the CWP tooltips should be shown or not.
boolean doesAcceptsEmails()
Does accepts emails.
String getColor()
Gets the color chosen by the user.
String getColorValue()
Gets the RGB value of the color chosen by the user.
String getTopBarBg()
Gets CWP top bar background name.
String getVolumeLevel()
Gets CWP volume level.
boolean isAutoplayEnabled()
Checks if CWP autoplay is enabled by the user.
boolean isJsDemuxerEnabled()
Checks if CWP JS demuxer is enabled by the user.
boolean isPrebufferEnabled()
Checks if CWP prebuffer is enabled by the user.
boolean isRepeatEnabled()
Checks if CWP repetition is enabled by the user.
boolean isShuffleEnabled()
Checks if CWP shuffle is enabled by the user.
void setAcceptEmails(boolean accept_emails)
Sets accept emails.
void setAutoplay(boolean autoplay)
Enable or disable autoplay feature on CWP.
void setColor(String colorName)
Sets color (must be one of the COLORS keys).
void setHideTooltips(boolean hide_tooltips)
Sets CWP hide tooltips preference.
void setJsDemuxer(boolean js_demuxer)
Enable or disable CWP experimental apple losseless support.
void setPrebuffer(boolean prebuffer)
Enable or disable prebuffer feature on CWP.
void setRepeat(boolean repeat)
Enable or disable repeat feature on CWP.
void setShuffle(boolean shuffle)
Enable or disable shuffle feature on CWP.
void setTopBarBg(String top_bar_bg)
Sets top bar bg.
void setVolumeLevel(String volume_level)
Sets CWP volume level.
[Expand]
Inherited Methods
From class fm.audiobox.core.models.Model
From class java.util.Observable
From class java.lang.Object

Constants

public static final String PATH

Constant Value: "/api/v1/preferences.json"

Fields

public static final Map<String, String> COLORS

Contains the color mapping: key is the name, value is the RGB value.

protected boolean accept_emails

protected boolean autoplay

protected String color

protected boolean hide_tooltips

protected boolean js_demuxer

protected boolean prebuffer

protected boolean repeat

protected boolean shuffle

protected String top_bar_bg

protected String volume_level

Public Constructors

public Preferences ()

Public Methods

public boolean areTooltipsHidden ()

Checks whether the CWP tooltips should be shown or not.

Returns
  • true if the tooltip should be shown, false otherwise.

public boolean doesAcceptsEmails ()

Does accepts emails.

Returns
  • true if the user accepts emails.

public String getColor ()

Gets the color chosen by the user.

Returns
  • the color name (no RGB neither hex code)

public String getColorValue ()

Gets the RGB value of the color chosen by the user.

Returns
  • the RGB color value

public String getTopBarBg ()

Gets CWP top bar background name.

Returns
  • the CWP top bar background name.

public String getVolumeLevel ()

Gets CWP volume level.

Returns
  • the CWP volume level

public boolean isAutoplayEnabled ()

Checks if CWP autoplay is enabled by the user.

Returns
  • the true if it is enabled, false otherwise.

public boolean isJsDemuxerEnabled ()

Checks if CWP JS demuxer is enabled by the user.

Returns
  • the true if it is enabled, false otherwise.

public boolean isPrebufferEnabled ()

Checks if CWP prebuffer is enabled by the user.

Returns
  • the true if it is enabled, false otherwise.

public boolean isRepeatEnabled ()

Checks if CWP repetition is enabled by the user.

Returns
  • the true if it is enabled, false otherwise.

public boolean isShuffleEnabled ()

Checks if CWP shuffle is enabled by the user.

Returns
  • the true if it is enabled, false otherwise.

public void setAcceptEmails (boolean accept_emails)

Sets accept emails.

Parameters
accept_emails true to accept email false otherwise

public void setAutoplay (boolean autoplay)

Enable or disable autoplay feature on CWP.

Parameters
autoplay true to enable false to disable

public void setColor (String colorName)

Sets color (must be one of the COLORS keys).

Parameters
colorName the color name to set
Throws
IllegalArgumentException the illegal argument exception

public void setHideTooltips (boolean hide_tooltips)

Sets CWP hide tooltips preference.

Parameters
hide_tooltips true to show tooltips false to hide

public void setJsDemuxer (boolean js_demuxer)

Enable or disable CWP experimental apple losseless support.

Parameters
js_demuxer true to enable false to disable

public void setPrebuffer (boolean prebuffer)

Enable or disable prebuffer feature on CWP.

Parameters
prebuffer true to enable false to disable

public void setRepeat (boolean repeat)

Enable or disable repeat feature on CWP.

Parameters
repeat true to enable false to disable

public void setShuffle (boolean shuffle)

Enable or disable shuffle feature on CWP.

Parameters
shuffle true to enable false to disable

public void setTopBarBg (String top_bar_bg)

Sets top bar bg.

Parameters
top_bar_bg the top _ bar _ bg

public void setVolumeLevel (String volume_level)

Sets CWP volume level.

Parameters
volume_level a range from 0 (mute) to 100 (max) in form of a String