|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object android.content.Context android.content.ContextWrapper android.app.Application sk.baka.ambient.AmbientApplication
public final class AmbientApplication
Serves mainly for a primary access point to a singleton data structures and
services, such as Library
, PlaylistPlayer
etc.
Field Summary |
---|
Constructor Summary | |
---|---|
AmbientApplication()
|
Method Summary | |
---|---|
void |
error(Class<?> sender,
boolean error,
String message,
Throwable cause)
An error occurred. |
BackgroundOpExecutor |
getBackgroundTasks()
Returns the background tasks executor. |
SimpleBus |
getBus()
Returns the message bus. |
Object |
getClipboard()
Retrieves a clipboard object. |
CoverCache |
getCovers()
Returns the cover cache manager instance. |
ErrorHandler |
getErrorHandler()
Returns the error handler instance. |
static Handler |
getHandler()
Returns the main message loop handler. |
static AmbientApplication |
getInstance()
Returns application instance. |
LRCStorage |
getKaraoke()
Returns the karaoke lyrics manager instance. |
Library |
getLibrary()
Returns singleton instance of the library. |
PlaybackNotificator |
getNotificator()
Returns the playback notificator instance. |
PlaylistPlayer |
getPlaylist()
Returns singleton instance of the playlist. |
ObjectStorage |
getPlaylistStorage()
Returns the cover cache manager instance. |
ICollection |
getProvider(TrackOriginEnum origin)
Returns the provider for given origin. |
AppStateHandler |
getStateHandler()
Returns the application state and configuration handler instance. |
String |
getVersion()
Returns the Ambient version. |
boolean |
isMainActivityVisible()
Checks if MainActivity is visible. |
boolean |
isShutdown()
Checks if the application is shutting down. |
void |
onCreate()
|
void |
onTerminate()
|
void |
registerProvider(TrackOriginEnum origin,
ICollection provider)
Registers new provider for given origin. |
void |
setClipboard(Object obj)
Sets clipboard contents. |
void |
setOffline(boolean offline)
Sets the online/offline state. |
void |
shutdown()
Shuts down the application. |
Methods inherited from class android.app.Application |
---|
onConfigurationChanged, onLowMemory |
Methods inherited from class android.content.Context |
---|
getString, getString, getText, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AmbientApplication()
Method Detail |
---|
public static Handler getHandler()
public PlaybackNotificator getNotificator()
null
.public void onCreate()
onCreate
in class Application
public void setOffline(boolean offline)
offline
- if true
then the application switches into
offline mode.public ErrorHandler getErrorHandler()
null
.public AppStateHandler getStateHandler()
null
.public boolean isMainActivityVisible()
MainActivity
is visible.
true
if the activity is visible, false
otherwise.public CoverCache getCovers()
public LRCStorage getKaraoke()
public ObjectStorage getPlaylistStorage()
public static AmbientApplication getInstance()
public Library getLibrary()
null
public BackgroundOpExecutor getBackgroundTasks()
null
instance of executor.public PlaylistPlayer getPlaylist()
null
.public SimpleBus getBus()
public void onTerminate()
onTerminate
in class Application
public void error(Class<?> sender, boolean error, String message, Throwable cause)
sender
- the sender.error
- error if true
, warning if false
.message
- the message to show. The message will be followed by a new
line, the Cause:
string and the
Throwable.getMessage()
if the cause is not
null
.cause
- optional cause.public void setClipboard(Object obj)
obj
- the clipboard object to set.public Object getClipboard()
null
if the clipboard
was cleared, either by client or by the garbage collector.public boolean isShutdown()
true
if we are shutting down, false
otherwise.public void shutdown()
public void registerProvider(TrackOriginEnum origin, ICollection provider)
ICollection.fixLocations(java.util.Collection)
.
origin
- the originprovider
- the provider instance.public ICollection getProvider(TrackOriginEnum origin)
null
if no
such provider was registered.
origin
- the origin
public String getVersion()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |