org.lyra
Class Lyra

java.lang.Object
  extended by org.lyra.Lyra

public class Lyra
extends java.lang.Object

This is the primary class used to create the original instance of the application. Certain constants are located here to provide a central location.

Version:
1.0.5, %Revision, 174%, %LastChangedDate, 27/10/12 3:33PM%
Author:
Martin Foster

Field Summary
static java.lang.String activeHost
          Provides a safety mechanism which prevents the removal of the the currently active host.
static java.lang.String BLANK
          The Lyra blank CD art cover.
static java.lang.String CACHE
          Sub-directory under rootUser which contains cached images.
private static java.lang.String CLASS
           
private  Pendulum Clock
           
static java.lang.String CONF
          Sub-directory under .rootUser and rootProgram which contains user modified and baseline settings and preferences for the application respectively.
private  Playback Control
           
private  java.lang.Process Daemon
           
static int DaemonAttempts
          Denotes the amount of times that connecting to the database will be done prior to failing.
static java.lang.String DATABASE
          The database structure necessary for all features and tracking of hosts is specified as follows.
private  Interface Db
           
static java.lang.String DB_SOURCE
          Primary source path used for all of the databases that exist as templates or resources.
static java.lang.String DOC_SOURCE
          Primary source path used for all of the images that exist as part of the base application.
static java.util.Map<java.lang.String,java.lang.String> Global
          Map containing the global settings for the environment.
private  Terminus Host
           
static java.lang.String HOST
          Sub-directory under .rootUser and rootProgram which contains host information and a default template respectively.
static java.lang.String IMG_SOURCE
          Primary source path used for all of the images that exist as part of the base application.
private  Status Information
           
static java.lang.String LANG
          Sub-directory located under rootProgram exclusively containing all supported language databases.
 java.util.Map<java.lang.String,java.lang.String> Language
          Language Map used to contain the language specific elements for display on the application.
private  Playlist Lists
           
private  Ledger Logger
           
static java.lang.String LOGS
          Sub-directory under rootUser which contains generated log files.
static java.lang.String LYRA
          The Lyra icon used to decorate windows.
private  Comptroller Manager
           
private  Options Modes
           
private  AbstractBlock myBlock
           
private static PlayerOrganiserFrame myOrg
           
private  Operations Ops
           
static java.lang.String pathCache
          The location of the cached images for retrieval of album art.
static java.lang.String pathDocs
          The location of help files for retrieval based on the selection of language element by the user.
static java.lang.String pathIcon
          The location of icons for retrieval based on the selection the user has made.
static java.lang.String PROG
          For the sake of a clean structure all of the user copies will be located within a certain structure.
private  Audit Recorder
           
private  java.io.File rootLang
           
static java.io.File rootProgram
          Directory which leads to the program root data files.
static java.io.File rootUser
          The user directory will normally point to the .lyra directory located in the users HOME directory.
static Lyra Self
          A reference to the instance created by the static main() instance.
private  Snooper Snoop
           
private  Library Songs
           
static boolean StateSave
          A switch that will indicate if the program has gone through its complete initialisation and can thus be saved safely.
static java.lang.String TEMPLATE
          The template file forms the base for other configuration files that will be copied for new configurations.
private static java.util.List<java.io.File> tempList
           
private  Updater Watcher
           
 
Constructor Summary
Lyra(java.lang.String[] args)
          Primary constructor of the class, will call initialisation and user components of the application.
 
Method Summary
static void addTempFile(java.io.File temp)
          Static method which will track all temporarily created files and will make sure to initiate their termination at the end.
static boolean closeApplication()
          A static pass-through to enable termination of application from anywhere that will display a generic error message.
static void closeApplication(java.awt.Window source)
          A static pass-through to enable termination of application from anywhere without requiring the passage of this class to each and every element that may eventually need it.
private  void completeExecution()
          Execution of the program will normal be ended through this process as it will ensure that various handles are closed and cleaned up prior to the completion.
private  void completeExecution(java.awt.Window source)
          Once the user has reached a point where a user-interface is present it will typically be shunted though this method.
static java.lang.String getCacheByFile(java.lang.String filename)
          Returns the path with filename to extract a cached image used for the album art display.
static java.lang.String getDocsByFile(java.lang.String filename)
          Returns the path holding the designated icons for use.
static java.lang.String getDocsByMap(java.lang.String ident)
          Returns the path holding the designated help file for use.
static java.lang.String getIconByFile(java.lang.String filename)
          Returns the path holding the designated icons for use.
static java.lang.String getIconByMap(java.lang.String ident)
          Returns the path holding the designated icons for use.
private  boolean hostInitialise()
          Handles the basics of host initialisation, making sure a host exists, is selected and populate/update the database if necessary.
private  java.util.Map<java.lang.String,java.lang.String> hostPrompt()
          Host creation process.
static void main(java.lang.String[] args)
          The main entry point into the application.
private  boolean progInitialise(java.lang.String[] args)
          This method aims to sort out the various complexities related to drawing parameters from many sources.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Global

public static java.util.Map<java.lang.String,java.lang.String> Global
Map containing the global settings for the environment. Normally generated from user preferences.


Language

public java.util.Map<java.lang.String,java.lang.String> Language
Language Map used to contain the language specific elements for display on the application.


activeHost

public static java.lang.String activeHost
Provides a safety mechanism which prevents the removal of the the currently active host.


rootProgram

public static java.io.File rootProgram
Directory which leads to the program root data files. Elements related to the database, languages and images located under this root.


rootUser

public static java.io.File rootUser
The user directory will normally point to the .lyra directory located in the users HOME directory.


pathIcon

public static java.lang.String pathIcon
The location of icons for retrieval based on the selection the user has made.


pathDocs

public static java.lang.String pathDocs
The location of help files for retrieval based on the selection of language element by the user.


pathCache

public static java.lang.String pathCache
The location of the cached images for retrieval of album art. These are not host specific, meaning that if you have the same Artist and Album instance they will used the cached version,


DB_SOURCE

public static final java.lang.String DB_SOURCE
Primary source path used for all of the databases that exist as templates or resources.

See Also:
Constant Field Values

DOC_SOURCE

public static final java.lang.String DOC_SOURCE
Primary source path used for all of the images that exist as part of the base application.

See Also:
Constant Field Values

IMG_SOURCE

public static final java.lang.String IMG_SOURCE
Primary source path used for all of the images that exist as part of the base application.

See Also:
Constant Field Values

PROG

public static final java.lang.String PROG
For the sake of a clean structure all of the user copies will be located within a certain structure.

See Also:
Constant Field Values

CONF

public static final java.lang.String CONF
Sub-directory under .rootUser and rootProgram which contains user modified and baseline settings and preferences for the application respectively.

See Also:
Constant Field Values

HOST

public static final java.lang.String HOST
Sub-directory under .rootUser and rootProgram which contains host information and a default template respectively.

See Also:
Constant Field Values

LANG

public static final java.lang.String LANG
Sub-directory located under rootProgram exclusively containing all supported language databases.

See Also:
Constant Field Values

LOGS

public static final java.lang.String LOGS
Sub-directory under rootUser which contains generated log files.

See Also:
Constant Field Values

CACHE

public static final java.lang.String CACHE
Sub-directory under rootUser which contains cached images.

See Also:
Constant Field Values

TEMPLATE

public static final java.lang.String TEMPLATE
The template file forms the base for other configuration files that will be copied for new configurations.

See Also:
Constant Field Values

DATABASE

public static final java.lang.String DATABASE
The database structure necessary for all features and tracking of hosts is specified as follows.

See Also:
Constant Field Values

LYRA

public static final java.lang.String LYRA
The Lyra icon used to decorate windows.

See Also:
Constant Field Values

BLANK

public static final java.lang.String BLANK
The Lyra blank CD art cover.

See Also:
Constant Field Values

Self

public static Lyra Self
A reference to the instance created by the static main() instance. Making use of this instance will ensure that we can always return to the root and kill the application properly.


StateSave

public static boolean StateSave
A switch that will indicate if the program has gone through its complete initialisation and can thus be saved safely.


DaemonAttempts

public static int DaemonAttempts
Denotes the amount of times that connecting to the database will be done prior to failing.


Manager

private Comptroller Manager

Db

private Interface Db

Logger

private Ledger Logger

Recorder

private Audit Recorder

Clock

private Pendulum Clock

Control

private Playback Control

Host

private Terminus Host

Information

private Status Information

Lists

private Playlist Lists

Songs

private Library Songs

Watcher

private Updater Watcher

Modes

private Options Modes

Snoop

private Snooper Snoop

myOrg

private static PlayerOrganiserFrame myOrg

myBlock

private AbstractBlock myBlock

CLASS

private static final java.lang.String CLASS
See Also:
Constant Field Values

rootLang

private java.io.File rootLang

tempList

private static java.util.List<java.io.File> tempList

Ops

private Operations Ops

Daemon

private java.lang.Process Daemon
Constructor Detail

Lyra

public Lyra(java.lang.String[] args)
Primary constructor of the class, will call initialisation and user components of the application.

Parameters:
args - String of arguments passed on the command line.
Method Detail

main

public static void main(java.lang.String[] args)
The main entry point into the application. Exclusively creates an instance to the constructor of this class.

Parameters:
args - String of arguments passed on the command line.

hostInitialise

private boolean hostInitialise()
Handles the basics of host initialisation, making sure a host exists, is selected and populate/update the database if necessary.

Returns:
Boolean indicating success of overall operation.

hostPrompt

private java.util.Map<java.lang.String,java.lang.String> hostPrompt()
Host creation process. Used to prompt the user for details and then create a host which works.

Returns:
Map containing login details.

progInitialise

private boolean progInitialise(java.lang.String[] args)
This method aims to sort out the various complexities related to drawing parameters from many sources. It will first check the command line and then load in the appropriate files.

Parameters:
args - Command Line driven arguments;
Returns:
boolean Simple True or False event

completeExecution

private void completeExecution()
Execution of the program will normal be ended through this process as it will ensure that various handles are closed and cleaned up prior to the completion.


completeExecution

private void completeExecution(java.awt.Window source)
Once the user has reached a point where a user-interface is present it will typically be shunted though this method. This will permit the user to select if he/she wants to end termination.

Parameters:
source - Source window.

closeApplication

public static void closeApplication(java.awt.Window source)
A static pass-through to enable termination of application from anywhere without requiring the passage of this class to each and every element that may eventually need it.

Parameters:
source - Source window.

closeApplication

public static boolean closeApplication()
A static pass-through to enable termination of application from anywhere that will display a generic error message. This is normally produced if the host suddenly drops.

Returns:
Returns user choice as long as its to try again.

getIconByMap

public static java.lang.String getIconByMap(java.lang.String ident)
Returns the path holding the designated icons for use. The path can change at startup based on colour selection for the theme.

Parameters:
ident - String which contains key for the map.
Returns:
String containing path.

getIconByFile

public static java.lang.String getIconByFile(java.lang.String filename)
Returns the path holding the designated icons for use. The path can change at startup based on colour selection for the theme. Makes use of a direct filename entry instead of an abstract.

Parameters:
filename - String which contains filename.
Returns:
String containing path.

getDocsByMap

public static java.lang.String getDocsByMap(java.lang.String ident)
Returns the path holding the designated help file for use. These vary based on language elements passed at startup.

Parameters:
ident - String which contains key for the map.
Returns:
String containing path.

getDocsByFile

public static java.lang.String getDocsByFile(java.lang.String filename)
Returns the path holding the designated icons for use. The path can change at startup based on colour selection for the theme. Makes use of a direct filename entry instead of an abstract.

Parameters:
filename - String which contains filename.
Returns:
String containing path.

getCacheByFile

public static java.lang.String getCacheByFile(java.lang.String filename)
Returns the path with filename to extract a cached image used for the album art display.

Parameters:
filename - String which contains filename.
Returns:
String containing path.

addTempFile

public static void addTempFile(java.io.File temp)
Static method which will track all temporarily created files and will make sure to initiate their termination at the end.

Parameters:
temp - File instance containing temporary file.