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 java.lang.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 java.lang.String[] A_FINDME_FILES
           
static java.lang.String APP_NAME
           
(package private) static javax.swing.filechooser.FileFilter ASSIGNMENT_FILEFILTER
           
static boolean bBigEndian
           
static ControlFrame cf
           
static javax.sound.sampled.AudioFormat datalineformat
           
static javax.sound.sampled.DataLine.Info datalineformat_info
           
static java.lang.String DECODED_SUFFIX
           
static java.lang.String FINDME_GENERIC
           
static java.lang.String FINDME_INTRO
           
static java.lang.String FINDME_LEFT
           
static java.lang.String FINDME_RIGHT
           
static java.lang.String FINDME_SILENCE
           
static java.awt.Color HIGHLIGHT
           
static int iDecodedcount
           
static java.lang.String INSTRUCTIONS_HTMLFILENAME
           
static int iSongscount
           
static java.lang.String KEY_ASSIGNMENT
           
static java.lang.String KEY_DIM_LAYOUT_TABLE
           
static java.lang.String KEY_DIM_SOM
           
static java.lang.String KEY_FILE_SOM
           
static java.lang.String KEY_SPEAKER
           
static java.util.LinkedHashMap<java.io.File,java.io.File> lhmDecoded
           
static java.awt.Color LIGHTRED
           
static java.util.logging.Logger log
           
static java.lang.String LOGFILENAME
           
static long lStarttime
          Time when playback was started
static int MAX_TOOLTIP_COLUMNS
           
static int MAX_TOOLTIP_LINES
           
static javax.sound.sampled.AudioFormat monoformat
           
static java.awt.Color MUTED_SPEAKER
           
static float p_decode
           
static java.lang.String PROPFILE_SUFFIX
           
static java.lang.String PROPFILEHEADER
           
static java.util.Random rand
           
(package private) static java.lang.String RES_DIR
          Resource directory: "rsc/multichannel/"
static java.lang.String sDecodedOutputDir
           
static java.text.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 java.lang.String sJukeboxdir
           
static long SLEEPFOR
           
static java.lang.String sUnitDescFileName
           
 
Constructor Summary
Commons()
           
 
Method Summary
static void centerWindow(java.awt.Component fenster)
          Places the given component in the middle of the screen.
static java.lang.String cutEndOfString(java.lang.String in, int number)
          Removes the last "number" characters of the string
static java.io.File getChosenFile(boolean bSave, java.awt.Component parent, java.lang.String suffix, javax.swing.JFileChooser jfc)
          Gives the user the possibility to select a filename using the Filechooser-Dialog
static java.lang.String makeSureThatLastCharIsACorrectFileSeparator(java.lang.String path)
          Makes sure that the given String ends with the OS-correct File.separator ('/' on Unix, '\\' on Windows)
static void playSound(java.lang.String[][] aFiles, int iLine)
          Overloading: playSound with an array of files
static void playSound(java.lang.String file1, java.lang.String file2, int iLine)
          Plays two sound files on the required output line
static java.lang.String stripSuffix(java.lang.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 java.lang.String sUnitDescFileName

sJukeboxdir

public static java.lang.String sJukeboxdir

sDecodedOutputDir

public static java.lang.String sDecodedOutputDir

p_decode

public static float p_decode

log

public static java.util.logging.Logger log

rand

public static java.util.Random rand

lhmDecoded

public static java.util.LinkedHashMap<java.io.File,java.io.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 java.text.SimpleDateFormat sdfHHmmss
Format to display playback time


cf

public static ControlFrame cf

RES_DIR

static final java.lang.String RES_DIR
Resource directory: "rsc/multichannel/"

See Also:
Constant Field Values

ASSIGNMENT_FILEFILTER

static final javax.swing.filechooser.FileFilter ASSIGNMENT_FILEFILTER

bBigEndian

public static final boolean bBigEndian
See Also:
Constant Field Values

datalineformat

public static final javax.sound.sampled.AudioFormat datalineformat

monoformat

public static final javax.sound.sampled.AudioFormat monoformat

datalineformat_info

public static final javax.sound.sampled.DataLine.Info datalineformat_info

LIGHTRED

public static final java.awt.Color LIGHTRED

HIGHLIGHT

public static final java.awt.Color HIGHLIGHT

MUTED_SPEAKER

public static final java.awt.Color MUTED_SPEAKER

A_FINDME_FILES

public static final java.lang.String[] A_FINDME_FILES

FINDME_LEFT

public static final java.lang.String FINDME_LEFT
See Also:
Constant Field Values

FINDME_RIGHT

public static final java.lang.String FINDME_RIGHT
See Also:
Constant Field Values

FINDME_SILENCE

public static final java.lang.String FINDME_SILENCE
See Also:
Constant Field Values

FINDME_GENERIC

public static final java.lang.String FINDME_GENERIC
See Also:
Constant Field Values

FINDME_INTRO

public static final java.lang.String FINDME_INTRO
See Also:
Constant Field Values

SLEEPFOR

public static final long SLEEPFOR
See Also:
Constant Field Values

DECODED_SUFFIX

public static final java.lang.String DECODED_SUFFIX
See Also:
Constant Field Values

APP_NAME

public static final java.lang.String APP_NAME
See Also:
Constant Field Values

LOGFILENAME

public static final java.lang.String LOGFILENAME
See Also:
Constant Field Values

INSTRUCTIONS_HTMLFILENAME

public static final java.lang.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 java.lang.String KEY_DIM_LAYOUT_TABLE
See Also:
Constant Field Values

KEY_DIM_SOM

public static final java.lang.String KEY_DIM_SOM
See Also:
Constant Field Values

KEY_FILE_SOM

public static final java.lang.String KEY_FILE_SOM
See Also:
Constant Field Values

KEY_ASSIGNMENT

public static final java.lang.String KEY_ASSIGNMENT
See Also:
Constant Field Values

KEY_SPEAKER

public static final java.lang.String KEY_SPEAKER
See Also:
Constant Field Values

PROPFILEHEADER

public static final java.lang.String PROPFILEHEADER
See Also:
Constant Field Values

PROPFILE_SUFFIX

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

Commons

public Commons()
Method Detail

playSound

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


playSound

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


makeSureThatLastCharIsACorrectFileSeparator

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


stripSuffix

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

Returns:
filename without suffices

centerWindow

public static void centerWindow(java.awt.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 java.lang.String cutEndOfString(java.lang.String in,
                                              int number)
Removes the last "number" characters of the string


getChosenFile

public static java.io.File getChosenFile(boolean bSave,
                                         java.awt.Component parent,
                                         java.lang.String suffix,
                                         javax.swing.JFileChooser jfc)
                                  throws java.lang.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:
java.lang.Exception