at.tuwien.ifs.somtoolbox.apps.viewer.controls.multichannelPlayback
Class Commons

java.lang.Object
  extended by at.tuwien.ifs.somtoolbox.apps.viewer.controls.multichannelPlayback.Commons

public class Commons
extends Object

This class contains static fields, methods and some additional logic that is used by multichannel playback related classes

Version:
$Id: Commons.java 3587 2010-05-21 10:35:33Z mayer $
Author:
Ewald Peiszer

Field Summary
static String[] A_FINDME_FILES
           
static String APP_NAME
           
(package private) static FileFilter ASSIGNMENT_FILEFILTER
           
static boolean bBigEndian
           
static ControlFrame cf
           
static AudioFormat datalineformat
           
static DataLine.Info datalineformat_info
           
static String DECODED_SUFFIX
           
static String FINDME_GENERIC
           
static String FINDME_INTRO
           
static String FINDME_LEFT
           
static String FINDME_RIGHT
           
static String FINDME_SILENCE
           
static Color HIGHLIGHT
           
static int iDecodedcount
           
static String INSTRUCTIONS_HTMLFILENAME
           
static int iSongscount
           
static String KEY_ASSIGNMENT
           
static String KEY_DIM_LAYOUT_TABLE
           
static String KEY_DIM_SOM
           
static String KEY_FILE_SOM
           
static String KEY_SPEAKER
           
static LinkedHashMap<File,File> lhmDecoded
           
static Color LIGHTRED
           
static Logger log
           
static String LOGFILENAME
           
static long lStarttime
          Time when playback was started
static int MAX_TOOLTIP_COLUMNS
           
static int MAX_TOOLTIP_LINES
           
static AudioFormat monoformat
           
static Color MUTED_SPEAKER
           
static float p_decode
           
static String PROPFILE_SUFFIX
           
static String PROPFILEHEADER
           
static Random rand
           
(package private) static String RES_DIR
          Resource directory: "rsc/multichannel/"
static String sDecodedOutputDir
           
static SimpleDateFormat sdfHHmmss
          Format to display playback time
static char SEP_IN_KEY
          Separater for use in keys for property files
static char SEP_IN_VALUE
          Separater for use in values for property files
static String sJukeboxdir
           
static long SLEEPFOR
           
static String sUnitDescFileName
           
 
Constructor Summary
Commons()
           
 
Method Summary
static void centerWindow(Component fenster)
          Places the given component in the middle of the screen.
static String cutEndOfString(String in, int number)
          Removes the last "number" characters of the string
static File getChosenFile(boolean bSave, Component parent, String suffix, JFileChooser jfc)
          Gives the user the possibility to select a filename using the Filechooser-Dialog
static String makeSureThatLastCharIsACorrectFileSeparator(String path)
          Makes sure that the given String ends with the OS-correct File.separator ('/' on Unix, '\\' on Windows)
static void playSound(String[][] aFiles, int iLine)
          Overloading: playSound with an array of files
static void playSound(String file1, String file2, int iLine)
          Plays two sound files on the required output line
static String stripSuffix(String sMitSuffix)
          Returns the string until (excluding) the first dot (.)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sUnitDescFileName

public static String sUnitDescFileName

sJukeboxdir

public static String sJukeboxdir

sDecodedOutputDir

public static String sDecodedOutputDir

p_decode

public static float p_decode

log

public static Logger log

rand

public static Random rand

lhmDecoded

public static LinkedHashMap<File,File> lhmDecoded

iSongscount

public static int iSongscount

iDecodedcount

public static int iDecodedcount

lStarttime

public static long lStarttime
Time when playback was started


sdfHHmmss

public static SimpleDateFormat sdfHHmmss
Format to display playback time


cf

public static ControlFrame cf

RES_DIR

static final String RES_DIR
Resource directory: "rsc/multichannel/"

See Also:
Constant Field Values

ASSIGNMENT_FILEFILTER

static final FileFilter ASSIGNMENT_FILEFILTER

bBigEndian

public static final boolean bBigEndian
See Also:
Constant Field Values

datalineformat

public static final AudioFormat datalineformat

monoformat

public static final AudioFormat monoformat

datalineformat_info

public static final DataLine.Info datalineformat_info

LIGHTRED

public static final Color LIGHTRED

HIGHLIGHT

public static final Color HIGHLIGHT

MUTED_SPEAKER

public static final Color MUTED_SPEAKER

A_FINDME_FILES

public static final String[] A_FINDME_FILES

FINDME_LEFT

public static final String FINDME_LEFT
See Also:
Constant Field Values

FINDME_RIGHT

public static final String FINDME_RIGHT
See Also:
Constant Field Values

FINDME_SILENCE

public static final String FINDME_SILENCE
See Also:
Constant Field Values

FINDME_GENERIC

public static final String FINDME_GENERIC
See Also:
Constant Field Values

FINDME_INTRO

public static final String FINDME_INTRO
See Also:
Constant Field Values

SLEEPFOR

public static final long SLEEPFOR
See Also:
Constant Field Values

DECODED_SUFFIX

public static final String DECODED_SUFFIX
See Also:
Constant Field Values

APP_NAME

public static final String APP_NAME
See Also:
Constant Field Values

LOGFILENAME

public static final String LOGFILENAME
See Also:
Constant Field Values

INSTRUCTIONS_HTMLFILENAME

public static final String INSTRUCTIONS_HTMLFILENAME
See Also:
Constant Field Values

MAX_TOOLTIP_COLUMNS

public static final int MAX_TOOLTIP_COLUMNS
See Also:
Constant Field Values

MAX_TOOLTIP_LINES

public static final int MAX_TOOLTIP_LINES
See Also:
Constant Field Values

SEP_IN_KEY

public static final char SEP_IN_KEY
Separater for use in keys for property files

See Also:
Constant Field Values

SEP_IN_VALUE

public static final char SEP_IN_VALUE
Separater for use in values for property files

See Also:
Constant Field Values

KEY_DIM_LAYOUT_TABLE

public static final String KEY_DIM_LAYOUT_TABLE
See Also:
Constant Field Values

KEY_DIM_SOM

public static final String KEY_DIM_SOM
See Also:
Constant Field Values

KEY_FILE_SOM

public static final String KEY_FILE_SOM
See Also:
Constant Field Values

KEY_ASSIGNMENT

public static final String KEY_ASSIGNMENT
See Also:
Constant Field Values

KEY_SPEAKER

public static final String KEY_SPEAKER
See Also:
Constant Field Values

PROPFILEHEADER

public static final String PROPFILEHEADER
See Also:
Constant Field Values

PROPFILE_SUFFIX

public static final String PROPFILE_SUFFIX
See Also:
Constant Field Values
Constructor Detail

Commons

public Commons()
Method Detail

playSound

public static void playSound(String file1,
                             String file2,
                             int iLine)
Plays two sound files on the required output line


playSound

public static void playSound(String[][] aFiles,
                             int iLine)
Overloading: playSound with an array of files


makeSureThatLastCharIsACorrectFileSeparator

public static String makeSureThatLastCharIsACorrectFileSeparator(String path)
Makes sure that the given String ends with the OS-correct File.separator ('/' on Unix, '\\' on Windows)


stripSuffix

public static String stripSuffix(String sMitSuffix)
Returns the string until (excluding) the first dot (.)

Returns:
filename without suffices

centerWindow

public static void centerWindow(Component fenster)
Places the given component in the middle of the screen.

Actually intended for JFrame and JDialog, but java.awt.Component is superclass of both.


cutEndOfString

public static String cutEndOfString(String in,
                                    int number)
Removes the last "number" characters of the string


getChosenFile

public static File getChosenFile(boolean bSave,
                                 Component parent,
                                 String suffix,
                                 JFileChooser jfc)
                          throws Exception
Gives the user the possibility to select a filename using the Filechooser-Dialog

suffix should start with the .

Returns:
the selected file or null if the user canceled the dialog
Throws:
Exception