net.shredzone.ifish
Class IFishPrefs

java.lang.Object
  extended by net.shredzone.ifish.IFishPrefs

public class IFishPrefs
extends Object

This singleton contains iFish global preferences and their default values.

Version:
$Id: IFishPrefs.java 291 2009-04-28 21:29:27Z shred $

Field Summary
static Locale[] LOCALES
          All available languages.
static String PREFS_CHARSET
           
static String PREFS_CHARSET_ID3V1
           
static String PREFS_CHARSET_ID3V2
           
static String PREFS_CHECKDATE
           
static String PREFS_CHECKTRACKS
           
static String PREFS_COMPATIBILITY
           
static String PREFS_DELMAC
           
static String PREFS_DIR_RENAME
           
static String PREFS_DIRECTORY
           
static String PREFS_FILE_RENAME
           
static String PREFS_FIRSTTIME
           
static String PREFS_LAF
           
static String PREFS_LANGUAGE
           
static String PREFS_PL_BASEDIR
           
static String PREFS_PL_COMMENT
           
static String PREFS_PL_NAME
           
static String PREFS_PL_NEW
           
static String PREFS_PLAYER_PAUSE
           
static String PREFS_PLAYER_PLAY
           
static String PREFS_PLAYER_STOP
           
static String PREFS_REBUILD
           
 
Method Summary
 String getCharset()
          Get the Charset to be used in the database file.
 String getDirectory()
          Get the jukebox base directory.
 int getDirRename()
          Get the directory renaming mode.
 int getFileRename()
          Get the file renaming mode.
 String getID3v1Charset()
          Get the Charset to be used for reading mp3 tag ID3v1 files.
 String getID3v2Charset()
          Get the Charset to be used for reading mp3 tag ID3v2 files that are not UTF encoded.
 String getLAF()
          Get the look and feel to be used.
 Locale getLanguage()
          Get the language to be used.
 Preferences getNode()
          Get the Preferences node that is actually storing the preferences.
 String getPlayerPause()
          Get the pause command for the external player. "{}" will be replaced with the selected files on invocation.
 String getPlayerPlay()
          Get the play command for the external player. "{}" will be replaced with the selected files on invocation.
 String getPlayerStop()
          Get the stop command for the external player. "{}" will be replaced with the selected files on invocation.
 String getPLBaseDir()
          Get the playlist's base directory on the jukebox harddisk.
 String getPLName()
          Get the playlist name template for new entrances playlists.
static IFishPrefs instance()
          Get the singleton instance of IFishPrefs.
 boolean isCheckDate()
          Check if also the file date should be considered to find out if a file has been changed.
 boolean isCheckTracks()
          Check if the tag's track number is to be prepended to the file name.
 boolean isCompatibility()
          Check if Compatibility mode is enabled.
 boolean isDelMac()
          Check if MacOS X resource fork emulation files are to be deleted.
 boolean isFirstTime()
          Check if this is the first time iFish is used.
 boolean isPLComment()
          Check if playlists are to be generated by tag comments.
 boolean isPLNew()
          Check if a playlist about new entrances is to be created.
 boolean isRebuild()
          Check if the entire database is always to be recreated.
 void setCharset(String charset)
          Set the Charset to be used in the database file.
 void setCheckDate(boolean b)
          Set if also the file date should be considered to find out if a file has been changed.
 void setCheckTracks(boolean b)
          Set if the tag's track number is to be prepended to the file name.
 void setCompatibility(boolean b)
          Set if Compatibility mode is enabled.
 void setDelMac(boolean b)
          Set if MacOS X resource fork emulation files are to be deleted.
 void setDirectory(String dir)
          Set the jukebox base directory.
 void setDirRename(int mode)
          Set the directory renaming more.
 void setFileRename(int mode)
          Set the file renaming more.
 void setFirstTime(boolean b)
          Set if this is the first time iFish is used.
 void setID3v1Charset(String charset)
          Set the Charset to be used for reading mp3 tag ID3v1 files.
 void setID3v2Charset(String charset)
          Set the Charset to be used for reading mp3 tag ID3v2 files that are not UTF encoded.
 void setLAF(String laf)
          Set the look and feel to be used.
 void setLanguage(Locale locale)
          Set the language to be used.
 void setPlayerPause(String cmd)
          Set the pause command for the external player. "{}" will be replaced with the selected files on invocation.
 void setPlayerPlay(String cmd)
          Set the play command for the external player. "{}" will be replaced with the selected files on invocation.
 void setPlayerStop(String cmd)
          Set the stop command for the external player. "{}" will be replaced with the selected files on invocation.
 void setPLBaseDir(String dir)
          Set the playlist's base directory.
 void setPLComment(boolean b)
          Set if playlists are to be generated by tag comments.
 void setPLName(String name)
          Get the playlist name template for new entrances playlists.
 void setPLNew(boolean b)
          Set if a playlist about new entrances is to be created.
 void setRebuild(boolean b)
          Set if the entire database is always to be recreated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PREFS_DIRECTORY

public static final String PREFS_DIRECTORY
See Also:
Constant Field Values

PREFS_COMPATIBILITY

public static final String PREFS_COMPATIBILITY
See Also:
Constant Field Values

PREFS_CHARSET

public static final String PREFS_CHARSET
See Also:
Constant Field Values

PREFS_CHARSET_ID3V1

public static final String PREFS_CHARSET_ID3V1
See Also:
Constant Field Values

PREFS_CHARSET_ID3V2

public static final String PREFS_CHARSET_ID3V2
See Also:
Constant Field Values

PREFS_REBUILD

public static final String PREFS_REBUILD
See Also:
Constant Field Values

PREFS_CHECKDATE

public static final String PREFS_CHECKDATE
See Also:
Constant Field Values

PREFS_CHECKTRACKS

public static final String PREFS_CHECKTRACKS
See Also:
Constant Field Values

PREFS_PL_COMMENT

public static final String PREFS_PL_COMMENT
See Also:
Constant Field Values

PREFS_PL_NEW

public static final String PREFS_PL_NEW
See Also:
Constant Field Values

PREFS_PL_NAME

public static final String PREFS_PL_NAME
See Also:
Constant Field Values

PREFS_PL_BASEDIR

public static final String PREFS_PL_BASEDIR
See Also:
Constant Field Values

PREFS_DELMAC

public static final String PREFS_DELMAC
See Also:
Constant Field Values

PREFS_DIR_RENAME

public static final String PREFS_DIR_RENAME
See Also:
Constant Field Values

PREFS_FILE_RENAME

public static final String PREFS_FILE_RENAME
See Also:
Constant Field Values

PREFS_LAF

public static final String PREFS_LAF
See Also:
Constant Field Values

PREFS_LANGUAGE

public static final String PREFS_LANGUAGE
See Also:
Constant Field Values

PREFS_PLAYER_PLAY

public static final String PREFS_PLAYER_PLAY
See Also:
Constant Field Values

PREFS_PLAYER_PAUSE

public static final String PREFS_PLAYER_PAUSE
See Also:
Constant Field Values

PREFS_PLAYER_STOP

public static final String PREFS_PLAYER_STOP
See Also:
Constant Field Values

PREFS_FIRSTTIME

public static final String PREFS_FIRSTTIME
See Also:
Constant Field Values

LOCALES

public static final Locale[] LOCALES
All available languages.

Method Detail

instance

public static IFishPrefs instance()
Get the singleton instance of IFishPrefs.

Returns:
IFishPrefs

getNode

public Preferences getNode()
Get the Preferences node that is actually storing the preferences. You can use the returned object e.g. for adding PreferenceChangeListeners.

Returns:
Preferences node actually storing the preferences.

isFirstTime

public boolean isFirstTime()
Check if this is the first time iFish is used. In this case, a welcome popup will open after startup. The default is true.

Returns:
true: first time

setFirstTime

public void setFirstTime(boolean b)
Set if this is the first time iFish is used.

Parameters:
b - true: first time, false: more than once.

getLAF

public String getLAF()
Get the look and feel to be used. The default is no look and feel (empty string).

Returns:
Look and Feel, may be empty but never null.

setLAF

public void setLAF(String laf)
Set the look and feel to be used.

Parameters:
laf - Look and Feel, may be empty but never null.

getLanguage

public Locale getLanguage()
Get the language to be used.

Returns:
Selected language, null if no special language is selected

setLanguage

public void setLanguage(Locale locale)
Set the language to be used.

Parameters:
locale - Locale to be used next time iFish is started. If null is passed, iFish will select the language according to the underlying OS language next time.

getPLBaseDir

public String getPLBaseDir()
Get the playlist's base directory on the jukebox harddisk. The default is "ifish".

Returns:
Playlist's base directory.

setPLBaseDir

public void setPLBaseDir(String dir)
Set the playlist's base directory.

Parameters:
dir - Playlist's base directory.

getDirRename

public int getDirRename()
Get the directory renaming mode. The default is 0.

Returns:
Directory renaming mode.

setDirRename

public void setDirRename(int mode)
Set the directory renaming more.

Parameters:
mode - Directory renaming mode.

getFileRename

public int getFileRename()
Get the file renaming mode. The default is 3.

Returns:
File renaming mode.

setFileRename

public void setFileRename(int mode)
Set the file renaming more.

Parameters:
mode - File renaming mode.

getDirectory

public String getDirectory()
Get the jukebox base directory. This is either the mount point or the drive letter, depending on the operating system. This may also be any other directory. The default is an empty string, meaning that no base directory has been set yet.

Returns:
Base Directory

setDirectory

public void setDirectory(String dir)
Set the jukebox base directory. This is either the mount point or the drive letter, depending on the operating system. This may also be any other directory.

Parameters:
dir - Base Directory

getPlayerPlay

public String getPlayerPlay()
Get the play command for the external player. "{}" will be replaced with the selected files on invocation. Default is an empty string, meaning that no player command has been set.

Returns:
Play command.

setPlayerPlay

public void setPlayerPlay(String cmd)
Set the play command for the external player. "{}" will be replaced with the selected files on invocation.

Parameters:
cmd - Play command.

getPlayerPause

public String getPlayerPause()
Get the pause command for the external player. "{}" will be replaced with the selected files on invocation. Default is an empty string, meaning that no player command has been set.

Returns:
Pause command.

setPlayerPause

public void setPlayerPause(String cmd)
Set the pause command for the external player. "{}" will be replaced with the selected files on invocation.

Parameters:
cmd - Pause command.

getPlayerStop

public String getPlayerStop()
Get the stop command for the external player. "{}" will be replaced with the selected files on invocation. Default is an empty string, meaning that no player command has been set.

Returns:
Stop command.

setPlayerStop

public void setPlayerStop(String cmd)
Set the stop command for the external player. "{}" will be replaced with the selected files on invocation.

Parameters:
cmd - Stop command.

getCharset

public String getCharset()
Get the Charset to be used in the database file. This is only used if the compatibility mode is enabled. Default is "ISO-8859-1".

Returns:
Charset to be used

setCharset

public void setCharset(String charset)
Set the Charset to be used in the database file. This is only used if the compatibility mode is enabled.

Parameters:
charset - Charset to be used

getID3v1Charset

public String getID3v1Charset()
Get the Charset to be used for reading mp3 tag ID3v1 files. Defaults to the system's charset, unless it's an UTF charset.

Returns:
Charset to be used

setID3v1Charset

public void setID3v1Charset(String charset)
Set the Charset to be used for reading mp3 tag ID3v1 files.

Parameters:
charset - Charset to be used

getID3v2Charset

public String getID3v2Charset()
Get the Charset to be used for reading mp3 tag ID3v2 files that are not UTF encoded. Defaults to "ISO-8859-1" since this is the charset mentioned in the ID3 documentation. Anyhow some broken tools also use other charsets there.

Returns:
Charset to be used

setID3v2Charset

public void setID3v2Charset(String charset)
Set the Charset to be used for reading mp3 tag ID3v2 files that are not UTF encoded.

Parameters:
charset - Charset to be used

isCompatibility

public boolean isCompatibility()
Check if Compatibility mode is enabled. In this case, the database file is written in an old format, using the given charset. Otherwise the database file is always written in UTF-8, which might disturb other database tools. Defaults to false.

Returns:
Compatibility mode enabled?

setCompatibility

public void setCompatibility(boolean b)
Set if Compatibility mode is enabled. In this case, the database file is written in an old format, using the given charset. Otherwise the database file is always written in UTF-8, which might disturb other database tools.

Parameters:
b - true: enable compatibility mode

isPLComment

public boolean isPLComment()
Check if playlists are to be generated by tag comments. Defaults to true.

Returns:
Generate playlists by tag comments?

setPLComment

public void setPLComment(boolean b)
Set if playlists are to be generated by tag comments.

Parameters:
b - Generate playlists by tag comments

isRebuild

public boolean isRebuild()
Check if the entire database is always to be recreated. Otherwise only changes to the files are regarded. Defaults to false.

Returns:
Rebuild database

setRebuild

public void setRebuild(boolean b)
Set if the entire database is always to be recreated. Otherwise only changes to the files are regarded.

Parameters:
b - Rebuild database

isCheckDate

public boolean isCheckDate()
Check if also the file date should be considered to find out if a file has been changed. Defaults to true.

Returns:
Check file date for changes.

setCheckDate

public void setCheckDate(boolean b)
Set if also the file date should be considered to find out if a file has been changed.

Parameters:
b - Check file date for changes.

isDelMac

public boolean isDelMac()
Check if MacOS X resource fork emulation files are to be deleted. Defaults to false, since this operation will delete files.

Returns:
Delete MacOS X resource fork emulation files.

setDelMac

public void setDelMac(boolean b)
Set if MacOS X resource fork emulation files are to be deleted. This will delete all files starting with "._"!

Parameters:
b - Delete MacOS X resource fork emulation files.

isPLNew

public boolean isPLNew()
Check if a playlist about new entrances is to be created. Defaults to true.

Returns:
Create a playlist about all new entrances.

setPLNew

public void setPLNew(boolean b)
Set if a playlist about new entrances is to be created.

Parameters:
b - true: Create a playlist about all new entrances.

isCheckTracks

public boolean isCheckTracks()
Check if the tag's track number is to be prepended to the file name. A track number is only prepended if the file name does not start with a number. Defaults to false, since it might rename a large number of files.

Returns:
Prepend the track number.

setCheckTracks

public void setCheckTracks(boolean b)
Set if the tag's track number is to be prepended to the file name. A track number is only prepended if the file name does not start with a number.

Parameters:
b - true: Prepend the track number.

getPLName

public String getPLName()
Get the playlist name template for new entrances playlists. "{s}" will be replaced by the date of the last database update. "{d}" will be replaced by the current date. Defaults to a name which is language dependent.

Returns:
Playlist name template.

setPLName

public void setPLName(String name)
Get the playlist name template for new entrances playlists. "{s}" will be replaced by the date of the last database update. "{d}" will be replaced by the current date.

Parameters:
name - Playlist name template


Copyright © 2007-2011 shredzone.org. All Rights Reserved.