ca.bc.webarts
Class jOggPlayer

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--java.applet.Applet
                          |
                          +--javax.swing.JApplet
                                |
                                +--ca.bc.webarts.jOggPlayer
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.lang.Runnable, java.io.Serializable

public class jOggPlayer
extends javax.swing.JApplet
implements java.awt.event.ActionListener, java.lang.Runnable

An Open Source Platform independant Graphical Vorbis Ogg Player!

You can now listen to your Oggs using an app that is NOT bloated. In fact this app/let can run on a web page (it is under 50 kB).
ScreenShot

It provides the usual basics needed to enjoy your files:

Visit the Homepage for latest news and updates.

Based on the Great work done by the jCraft crew to build jOrbis - the Java implementation of the Vorbis Ogg Codec by The XIPHOPHORUS Company .

All the aforementioned work has been released under an OpenSource GNU General Public License.


This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

Author:
Tom Gutwin P.Eng
See Also:
Serialized Form

Inner classes inherited from class javax.swing.JApplet
javax.swing.JApplet.AccessibleJApplet
 
Inner classes inherited from class java.applet.Applet
java.applet.Applet.AccessibleApplet
 
Inner classes inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.AWTTreeLock
 
Field Summary
(package private)  java.awt.Image aboutGraphic_
          Description of the Field
(package private)  java.awt.event.ActionListener addFromPlaylistActionListener
          Listener For the add ALL Songs from PlaylistFile Button.
(package private)  java.awt.event.ActionListener addSongActionListener
          Listener For the Add a Song to the Playlist Button.
(package private)  java.awt.event.ActionListener addURLActionListener
          Listener For the Add a Song from a URL Button.
private static java.lang.String APP_NAME
          Description of the Field
(package private) static java.net.URL appCodeBase_
          Description of the Field
(package private) static javax.swing.JFrame appFrame_
          Description of the Field
(package private) static jOggPlayer applicationPlayer
          Description of the Field
private static int appXpos
          the x position of the app window.
private static int appYpos
          the y position of the app window.
(package private) static ColouredLabel artistLabel
          The artist Coloured text label.
(package private) static ColouredLabel artistLabelValue
          Description of the Field
(package private)  java.lang.String[] availableTextureNames_
          Description of the Field
(package private)  java.awt.Image backgroundTexture_
          Description of the Field
(package private)  java.lang.String backgroundTextureFilename_
          Description of the Field
(package private) static KPanel bodyPanel
          Description of the Field
(package private)  byte[] buffer
          Description of the Field
(package private)  int bufferLengthInBytes
          Description of the Field
(package private) static int bufferMultiple_
          The File Load Play Buffer.
(package private) static int bufferSize_
          The File Load Play Buffer.
(package private)  KButton button
          Description of the Field
(package private)  KButton buttonAddToPlaylist
          Description of the Field
(package private)  KButton buttonAddUrlToPlaylist
          Description of the Field
(package private)  java.awt.Color buttonBackColour_
          Description of the Field
(package private)  KButton buttonDeleteFromPlaylist
          Description of the Field
(package private)  KButton buttonLast
          Description of the Field
(package private)  KButton buttonNext
          Description of the Field
(package private) static KPanel buttonPanel
          Description of the Field
(package private)  KButton buttonPause
          Description of the Field
(package private)  KButton buttonRefreshPlaylist
          Description of the Field
(package private)  int bytes
          Description of the Field
private  ConfigurationManager cfgmgr_
           
(package private)  int channels
          Description of the Field
(package private)  javax.swing.JCheckBox checkBoxLoop
          Description of the Field
(package private)  javax.swing.JCheckBox checkBoxMiniView
          Description of the Field
(package private)  javax.swing.JCheckBox checkBoxPlaylist
          Description of the Field
(package private)  javax.swing.JCheckBox checkBoxRandom
          Description of the Field
(package private) static javax.swing.JCheckBox checkBoxRecursePlaylist
          Description of the Field
(package private) static KPanel checkPanel
          Description of the Field
private static java.lang.String className_
          A Class holder for its name (used in Logging).
(package private) static java.lang.String CLASSPATH
          Description of the Field
(package private) static java.net.URL codeBase_
          Description of the Field
private static java.lang.String configFileName_
           
(package private)  int controlHeight_
          Description of the Field
(package private) static KPanel controlPanel
          Description of the Field
(package private) static byte[] convbuffer
          Description of the Field
(package private) static int convsize
          Description of the Field
(package private)  double currentVolumeMultiplier_
          Description of the Field
(package private)  int currVolSetting_
          Description of the Field
(package private)  java.util.Date date
          Description of the Field
(package private)  java.awt.event.ActionListener deleteAllActionListener
          Listener For the Delete ALL Songs from the Playlist Button.
(package private)  java.awt.event.ActionListener deleteSelectedSongActionListener
          Listener For the Delete Selected Song Playlist Button.
(package private)  java.awt.event.ActionListener deselectAllAsFavouriteSongActionListener
          Listener For the select all as favourite Songs menuitem.
(package private) static java.awt.Color displayBackColour_
          The colour used to back the display area.
(package private)  java.awt.Font displayFont_
          Description of the Field
(package private)  java.awt.Font displayFontBold_
          Description of the Field
(package private)  int displayHeight_
          Description of the Field
(package private) static javax.swing.JPopupMenu displayMenu
          Description of the Field
(package private) static javax.swing.JPanel displayPanel
          Description of the Field
(package private) static java.awt.Color displayTextColour_
          The display area text colour.
(package private)  int displayWidth_
          Description of the Field
(package private) static KPanel dragableMiniViewPanel
          Description of the Field
(package private)  java.awt.event.MouseMotionAdapter dragMiniViewMotionListener
          Listener .
(package private)  int format
          Description of the Field
(package private) static java.awt.Dimension frameCurrentSize_
          Description of the Field
(package private) static java.awt.Dimension frameInitSize_
          Description of the Field
(package private)  int frameSizeInBytes
          Description of the Field
(package private) static KPanel headerPanel
          Description of the Field
(package private) static java.lang.String helpHtmlStr_
           
(package private) static ColouredLabel helpLabel_
          The help Text Label html String
(package private) static java.lang.String ICON_JAR_FILENAME
          Description of the Field
(package private)  javax.swing.ImageIcon iconAdd_
          Description of the Field
(package private)  javax.swing.ImageIcon iconAddUrl_
          Description of the Field
(package private)  javax.swing.ImageIcon iconBack_
          Description of the Field
(package private)  javax.swing.ImageIcon iconDelete_
          Description of the Field
(package private)  javax.swing.ImageIcon iconForward_
          Description of the Field
(package private) static java.util.jar.JarFile iconJar
          Description of the Field
(package private)  javax.swing.ImageIcon iconLoop_
          Description of the Field
(package private)  javax.swing.ImageIcon iconMiniBack_
          Icon For going back a song.
(package private)  javax.swing.ImageIcon iconMiniClose_
          Description of the Field
(package private)  javax.swing.ImageIcon iconMiniForward_
          Description of the Field
(package private)  javax.swing.ImageIcon iconMiniPause_
          Description of the Field
(package private)  javax.swing.ImageIcon iconMiniPlay_
          Description of the Field
(package private)  javax.swing.ImageIcon iconMiniStop_
          Description of the Field
(package private)  javax.swing.ImageIcon iconMiniView_
          Description of the Field
(package private)  javax.swing.ImageIcon iconPause_
          Description of the Field
(package private)  javax.swing.ImageIcon iconPlay_
          Description of the Field
(package private)  javax.swing.ImageIcon iconRefresh_
          Description of the Field
(package private)  javax.swing.ImageIcon iconSelectedLoop
          Description of the Field
(package private)  javax.swing.ImageIcon iconStop_
          Description of the Field
(package private)  javax.swing.ImageIcon iconVolOff_
          Muted Icon
(package private)  javax.swing.ImageIcon iconVolOn_
          Unmuted Icon
(package private) static java.lang.String IMAGE_DIR
          Description of the Field
(package private) static java.lang.String[] initArgs_
          Description of the Field
(package private) static javax.swing.JPanel innerDisplayPanel
          Description of the Field
(package private)  int innerDisplayPanelHeight_
          Description of the Field
(package private)  int innerDisplayPanelWidth_
          Description of the Field
(package private) static KPanel innerFooterPanel
          Description of the Field
(package private) static KPanel innerHeaderPanel
          Description of the Field
(package private) static javax.swing.JPanel innerLeftDisplayPanel
          Description of the Field
(package private)  int innerLeftDisplayPanelHeight_
          Description of the Field
(package private)  int innerLeftDisplayPanelWidth_
          Description of the Field
(package private) static KPanel innerPanel
          Description of the Field
(package private) static KPanel innerPlaylistPanel
          Description of the Field
(package private) static javax.swing.JPanel innerRightDisplayPanel
          Description of the Field
(package private)  int innerRightDisplayPanelHeight_
          Description of the Field
(package private) static int left_vol_scale
          Description of the Field
(package private) static KPanel leftPanel
          Description of the Field
protected static Log log_
          The Log that will get used.
private static java.lang.String logFile_
          The Log Filename.
(package private)  boolean logVolumeScale_
          Description of the Field
(package private)  java.lang.Thread looperThread_
          Description of the Field
(package private)  java.lang.Runnable loopingRunnable_
          Runs the Looping of Songs in its own thread.
(package private)  boolean loopPaused_
          Description of the Field
(package private) static java.awt.Color mainBackColour_
          The colour used for all panels except the display area.
(package private) static javax.swing.JPopupMenu mainMenu
          Description of the Field
(package private) static int maxVolScale_
          Description of the Field
(package private)  KButton miniButtonClose_
          Description of the Field
(package private)  KButton miniButtonLast
          Description of the Field
(package private)  KButton miniButtonNext
          Description of the Field
(package private) static KPanel miniButtonPanel
          Description of the Field
(package private)  KButton miniButtonPause
          Description of the Field
(package private)  KButton miniButtonPlay
          Description of the Field
(package private)  KButton miniButtonView_
          Description of the Field
(package private)  KButton miniDragButton
          Description of the Field
(package private)  ColouredLabel miniDragLabel
          Description of the Field
(package private) static ColouredLabel miniTimeLabelValue
          Description of the Field
(package private)  java.awt.event.MouseAdapter miniViewMouseListener
          Listener .
(package private) static KPanel miniViewPanel
          Description of the Field
(package private) static boolean miniViewShowing_
          Description of the Field
(package private) static KPanel miniViewWindowControlPanel
          Description of the Field
(package private) static KButton muteButton_
          The Volume Slider.
(package private) static int mutedVolume_
          The last volume before mute.
(package private)  java.io.InputStream oggBitStream_
          Description of the Field
(package private)  Packet oggPacket_
          Description of the Field
(package private)  Page oggPage_
          Description of the Field
(package private)  StreamState oggStreamState_
          Description of the Field
(package private)  SyncState oggSyncState_
          Description of the Field
(package private)  javax.sound.sampled.SourceDataLine outputLine
          Description of the Field
(package private)  KPanel panel
          Description of the Field
(package private)  java.lang.Thread playerThread_
          Description of the Field
(package private)  PlayList playList
          Description of the Field
(package private)  java.awt.Color playlistBackColour_
          Description of the Field
(package private)  JCheckDropDown playListComboBox
          Description of the Field
(package private) static java.lang.String playListDir_
          Description of the Field
(package private)  java.lang.String playListFilename_
          Description of the Field
(package private)  int playlistHeight_
          Description of the Field
(package private) static javax.swing.JPopupMenu playlistMenu
          Description of the Field
(package private)  boolean playListShowing_
          Description of the Field
(package private) static java.awt.event.MouseListener popupListener_
          Popup menu Mouse Listener.
protected static javax.swing.JWindow popUpWin_
          The JWindow for the miniView.
(package private)  int progressCount_
          Description of the Field
(package private)  int rate
          Description of the Field
(package private) static int right_vol_scale
          Description of the Field
(package private) static KPanel rightPanel
          Description of the Field
(package private) static boolean running_as_applet
          Description of the Field
(package private)  java.awt.event.ActionListener savePlaylistActionListener
          Listener For the Save Playlist to a file Button.
(package private)  java.awt.event.ActionListener selectAllAsFavouriteSongActionListener
          Listener For the select all as favourite Songs menuitem.
(package private)  boolean showButtonBorders_
          Description of the Field
(package private) static boolean showMiniViewOnStart_
          Flag to show the mini view on startup, It gets read from the config file.
(package private) static boolean showPlaylistOnStart_
          Flag to show the playlist on startup, It gets read from the config file.
(package private)  boolean showTextures_
          Description of the Field
(package private)  java.util.Vector songComments_
          Description of the Field
(package private)  javax.swing.JProgressBar songProgress
          Description of the Field
(package private)  int songProgressHeight_
          Description of the Field
(package private)  long songStartTime_
          Description of the Field
private static java.lang.String SYSTEM_FILE_SEPERATOR
          Description of the Field
(package private) static ColouredLabel timeLabel
          Description of the Field
(package private) static ColouredLabel timeLabelValue
          Description of the Field
(package private)  boolean timerRunning_
          Description of the Field
(package private)  java.lang.Runnable timeWatcherRunnable_
          Handles the Timer display in its own Thread.
(package private)  java.lang.Thread timeWatcherThread_
          Description of the Field
(package private) static ColouredLabel titleLabel
          Description of the Field
(package private) static ColouredLabel titleLabelValue
          Description of the Field
(package private) static java.lang.String USER_DIR
          Description of the Field
(package private) static java.awt.GraphicsEnvironment USER_GRAPHIC_ENV
          Description of the Field
(package private) static java.lang.String VERSION
          Description of the Field
(package private)  java.awt.Color volumeBackColour_
          Description of the Field
(package private) static javax.swing.JSlider volumeSlider_
          The Volume Slider.
(package private)  int volumeWidth_
          Description of the Field
(package private)  Block vorbisBlock
          Description of the Field
(package private)  Comment vorbisComment
          Description of the Field
(package private)  DspState vorbisDspState
          Description of the Field
(package private)  Info vorbisInfo
          Description of the Field
private  int XDifference
          The X amount the current window was just dragged.
private static int xpos
          the x position of the mini window.
private  int YDifference
          The Y amount the current window was just dragged.
private static int ypos
          the y position of the mini window.
 
Fields inherited from class javax.swing.JApplet
accessibleContext, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.applet.Applet
serialVersionUID, stub
 
Fields inherited from class java.awt.Panel
base, nameCounter
 
Fields inherited from class java.awt.Container
component, containerListener, containerSerializedDataVersion, dbg, dispatcher, layoutMgr, listeningBoundsChildren, listeningChildren, maxSize, ncomponents, needsPaint, printing, printingThreads
 
Fields inherited from class java.awt.Component
actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, changeSupport, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, graphicsConfig, hasFocus, height, hierarchyBoundsListener, hierarchyBoundsListenerK, hierarchyListener, hierarchyListenerK, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, metrics, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, privateKey, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowClosingException, windowListenerK, x, y
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
jOggPlayer()
          Basic constructor for this Object.
jOggPlayer(java.lang.String[] args)
          Constructor for this Object to initated the playlist with the file/songname args that are passed to it, if the passed args is empty or values are invalid - the default playlistfile is loaded.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Handles all the Actions originating from the Control Buttons.
private  void createConfigs()
          Creates all the storable data in to the config manager.
 java.net.URL getCodeBase()
           
private  java.net.URL[] getFileBaseURLs(java.lang.String[] fileStrings)
          Creates a URL[] for the given Strings.
private  javax.sound.sampled.SourceDataLine getOutputLine(int channels, int rate)
          Gets the OutputLine attribute of the jOggPlayer object
private  void init_audio(int channels, int rate)
          Description of the Method
private  void init_jorbis()
          Initializes all the jOrbis and jOgg vars that are used for song playback.
 void init()
          A helper method that initializes the required class vars.
private  void initMenus()
          Gets the Menus setup.
private  void initUI()
          Gets the GUI setup *
private  void loadConfigs()
          Loads all the storable data from the config manager.
private  void loadIconImages()
          Loads / initializes the class vars for all required icons and images this app/let uses.
private  java.lang.String[] loadTextureNames()
          Loads the names of the textures available in this classes jar file.
static void main(java.lang.String[] arg)
          The main program for the jOggPlayer class
private  int readFromStream(byte[] buffer, int index, int bufferSize_)
          Reads from the oggBitStream_ a specified number of Bytes(bufferSize_) worth sarting at index and puts them in the specified buffer[].
 void run()
          The Runnable to do the actual playing of the song.
private  void setColours()
          Sets all the Various colours to their current variable values.
private  void setDisplayFont(java.awt.Font newFont)
          Changes all the Labels in the Display area to the ne font.
private static void showMiniView(boolean showIt)
          Switches to or from the mini view.
private  void showPlaylistPanel(boolean showIt)
          Switches the Playlist panel on/off.
 void start()
          The applet start *
private  void startTimer()
          Helper method to encapsulate the starting of the timeWatcherRunnable_.*
 void stop()
          Stops the current playing oggStream in the playerStream_.
private  void storeConfigs()
          Puts all the storable data in to the config manager in prep for saving.
private  void tryPlay(java.lang.String item)
          Attempts to Play the Ogg File At the Specified URL String.
private  void tryPlay(java.net.URL url)
          Attempts to Play the Ogg File At the Specified URL.
private  void updateDisplayPopup()
          Updates the tooltip popup text for the Display area with the latest song info.
 double volumeMultiplier(int currSetting)
          Converts a linear mapped value to its Log equivalent.
 
Methods inherited from class javax.swing.JApplet
addImpl, createRootPane, createRootPaneException, getAccessibleContext, getContentPane, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, remove, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.applet.Applet
destroy, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus
 
Methods inherited from class java.awt.Panel
, addNotify, constructComponentName
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, adjustListeningChildren, applyOrientation, checkGD, countComponents, createChildHierarchyEvents, createHierarchyEvents, deliverEvent, dispatchEventImpl, dispatchEventToSelf, doLayout, eventEnabled, findComponentAt, findComponentAt, findComponentAt, getAccessibleAt, getAccessibleChild, getAccessibleChildrenCount, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMouseEventTarget, getPreferredSize, getWindow, initIDs, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPaint, lightweightPrint, list, list, locate, minimumSize, nextFocus, numListening, paint, paintComponents, paintHeavyweightComponents, postProcessKeyEvent, postsOldMouseEvents, preferredSize, preProcessKeyEvent, print, printComponents, printHeavyweightComponents, processContainerEvent, processEvent, proxyEnableEvents, proxyRequestFocus, readObject, remove, removeAll, removeContainerListener, removeNotify, setFocusOwner, setFont, transferFocus, validate, validateTree, writeObject
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkImage, checkImage, checkWindowClosingException, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAccessibleIndexInParent, getAccessibleStateSet, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen_NoTreeLock, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getSize, getToolkit, getToolkitImpl, getTreeLock, getWidth, getWindowForObject, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isRecursivelyVisible, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, resetGC, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

SYSTEM_FILE_SEPERATOR

private static final java.lang.String SYSTEM_FILE_SEPERATOR
Description of the Field

APP_NAME

private static final java.lang.String APP_NAME
Description of the Field

className_

private static java.lang.String className_
A Class holder for its name (used in Logging).

logFile_

private static java.lang.String logFile_
The Log Filename.

XDifference

private int XDifference
The X amount the current window was just dragged.

YDifference

private int YDifference
The Y amount the current window was just dragged.

xpos

private static int xpos
the x position of the mini window.

ypos

private static int ypos
the y position of the mini window.

appXpos

private static int appXpos
the x position of the app window.

appYpos

private static int appYpos
the y position of the app window.

IMAGE_DIR

static final java.lang.String IMAGE_DIR
Description of the Field

ICON_JAR_FILENAME

static final java.lang.String ICON_JAR_FILENAME
Description of the Field

USER_DIR

static final java.lang.String USER_DIR
Description of the Field

CLASSPATH

static java.lang.String CLASSPATH
Description of the Field

configFileName_

private static java.lang.String configFileName_

VERSION

static final java.lang.String VERSION
Description of the Field

USER_GRAPHIC_ENV

static final java.awt.GraphicsEnvironment USER_GRAPHIC_ENV
Description of the Field

appCodeBase_

static java.net.URL appCodeBase_
Description of the Field

codeBase_

static java.net.URL codeBase_
Description of the Field

initArgs_

static java.lang.String[] initArgs_
Description of the Field

applicationPlayer

static jOggPlayer applicationPlayer
Description of the Field

iconJar

static java.util.jar.JarFile iconJar
Description of the Field

playListDir_

static java.lang.String playListDir_
Description of the Field

mainBackColour_

static java.awt.Color mainBackColour_
The colour used for all panels except the display area.

displayBackColour_

static java.awt.Color displayBackColour_
The colour used to back the display area.

displayTextColour_

static java.awt.Color displayTextColour_
The display area text colour.

maxVolScale_

static final int maxVolScale_
Description of the Field

left_vol_scale

static int left_vol_scale
Description of the Field

right_vol_scale

static int right_vol_scale
Description of the Field

frameInitSize_

static java.awt.Dimension frameInitSize_
Description of the Field

frameCurrentSize_

static java.awt.Dimension frameCurrentSize_
Description of the Field

checkBoxRecursePlaylist

static javax.swing.JCheckBox checkBoxRecursePlaylist
Description of the Field

appFrame_

static javax.swing.JFrame appFrame_
Description of the Field

showPlaylistOnStart_

static boolean showPlaylistOnStart_
Flag to show the playlist on startup, It gets read from the config file.

showMiniViewOnStart_

static boolean showMiniViewOnStart_
Flag to show the mini view on startup, It gets read from the config file.

muteButton_

static KButton muteButton_
The Volume Slider.

mutedVolume_

static int mutedVolume_
The last volume before mute.

volumeSlider_

static javax.swing.JSlider volumeSlider_
The Volume Slider.

helpHtmlStr_

static java.lang.String helpHtmlStr_

helpLabel_

static ColouredLabel helpLabel_
The help Text Label html String

artistLabel

static ColouredLabel artistLabel
The artist Coloured text label.

titleLabel

static ColouredLabel titleLabel
Description of the Field

timeLabel

static ColouredLabel timeLabel
Description of the Field

artistLabelValue

static ColouredLabel artistLabelValue
Description of the Field

titleLabelValue

static ColouredLabel titleLabelValue
Description of the Field

timeLabelValue

static ColouredLabel timeLabelValue
Description of the Field

miniTimeLabelValue

static ColouredLabel miniTimeLabelValue
Description of the Field

headerPanel

static KPanel headerPanel
Description of the Field

bodyPanel

static KPanel bodyPanel
Description of the Field

dragableMiniViewPanel

static KPanel dragableMiniViewPanel
Description of the Field

miniViewPanel

static KPanel miniViewPanel
Description of the Field

miniViewWindowControlPanel

static KPanel miniViewWindowControlPanel
Description of the Field

leftPanel

static KPanel leftPanel
Description of the Field

innerPanel

static KPanel innerPanel
Description of the Field

rightPanel

static KPanel rightPanel
Description of the Field

innerHeaderPanel

static KPanel innerHeaderPanel
Description of the Field

displayPanel

static javax.swing.JPanel displayPanel
Description of the Field

controlPanel

static KPanel controlPanel
Description of the Field

innerFooterPanel

static KPanel innerFooterPanel
Description of the Field

innerDisplayPanel

static javax.swing.JPanel innerDisplayPanel
Description of the Field

innerLeftDisplayPanel

static javax.swing.JPanel innerLeftDisplayPanel
Description of the Field

innerRightDisplayPanel

static javax.swing.JPanel innerRightDisplayPanel
Description of the Field

innerPlaylistPanel

static KPanel innerPlaylistPanel
Description of the Field

checkPanel

static KPanel checkPanel
Description of the Field

buttonPanel

static KPanel buttonPanel
Description of the Field

miniButtonPanel

static KPanel miniButtonPanel
Description of the Field

mainMenu

static javax.swing.JPopupMenu mainMenu
Description of the Field

playlistMenu

static javax.swing.JPopupMenu playlistMenu
Description of the Field

displayMenu

static javax.swing.JPopupMenu displayMenu
Description of the Field

popupListener_

static java.awt.event.MouseListener popupListener_
Popup menu Mouse Listener.

bufferMultiple_

static int bufferMultiple_
The File Load Play Buffer.

bufferSize_

static int bufferSize_
The File Load Play Buffer.

convsize

static int convsize
Description of the Field

convbuffer

static byte[] convbuffer
Description of the Field

running_as_applet

static boolean running_as_applet
Description of the Field

playListShowing_

boolean playListShowing_
Description of the Field

miniViewShowing_

static boolean miniViewShowing_
Description of the Field

loopPaused_

boolean loopPaused_
Description of the Field

timerRunning_

boolean timerRunning_
Description of the Field

logVolumeScale_

boolean logVolumeScale_
Description of the Field

showButtonBorders_

boolean showButtonBorders_
Description of the Field

showTextures_

boolean showTextures_
Description of the Field

playerThread_

java.lang.Thread playerThread_
Description of the Field

looperThread_

java.lang.Thread looperThread_
Description of the Field

timeWatcherThread_

java.lang.Thread timeWatcherThread_
Description of the Field

currentVolumeMultiplier_

double currentVolumeMultiplier_
Description of the Field

songStartTime_

long songStartTime_
Description of the Field

date

java.util.Date date
Description of the Field

progressCount_

int progressCount_
Description of the Field

playListFilename_

java.lang.String playListFilename_
Description of the Field

playList

PlayList playList
Description of the Field

playlistBackColour_

java.awt.Color playlistBackColour_
Description of the Field

buttonBackColour_

java.awt.Color buttonBackColour_
Description of the Field

volumeBackColour_

java.awt.Color volumeBackColour_
Description of the Field

availableTextureNames_

java.lang.String[] availableTextureNames_
Description of the Field

displayFont_

java.awt.Font displayFont_
Description of the Field

displayFontBold_

java.awt.Font displayFontBold_
Description of the Field

currVolSetting_

int currVolSetting_
Description of the Field

playlistHeight_

int playlistHeight_
Description of the Field

innerLeftDisplayPanelHeight_

int innerLeftDisplayPanelHeight_
Description of the Field

innerLeftDisplayPanelWidth_

int innerLeftDisplayPanelWidth_
Description of the Field

innerRightDisplayPanelHeight_

int innerRightDisplayPanelHeight_
Description of the Field

innerDisplayPanelHeight_

int innerDisplayPanelHeight_
Description of the Field

innerDisplayPanelWidth_

int innerDisplayPanelWidth_
Description of the Field

songProgressHeight_

int songProgressHeight_
Description of the Field

controlHeight_

int controlHeight_
Description of the Field

volumeWidth_

int volumeWidth_
Description of the Field

displayHeight_

int displayHeight_
Description of the Field

displayWidth_

int displayWidth_
Description of the Field

aboutGraphic_

java.awt.Image aboutGraphic_
Description of the Field

backgroundTexture_

java.awt.Image backgroundTexture_
Description of the Field

iconMiniView_

javax.swing.ImageIcon iconMiniView_
Description of the Field

iconMiniClose_

javax.swing.ImageIcon iconMiniClose_
Description of the Field

iconDelete_

javax.swing.ImageIcon iconDelete_
Description of the Field

iconAdd_

javax.swing.ImageIcon iconAdd_
Description of the Field

iconAddUrl_

javax.swing.ImageIcon iconAddUrl_
Description of the Field

iconRefresh_

javax.swing.ImageIcon iconRefresh_
Description of the Field

iconPlay_

javax.swing.ImageIcon iconPlay_
Description of the Field

iconPause_

javax.swing.ImageIcon iconPause_
Description of the Field

iconStop_

javax.swing.ImageIcon iconStop_
Description of the Field

iconForward_

javax.swing.ImageIcon iconForward_
Description of the Field

iconBack_

javax.swing.ImageIcon iconBack_
Description of the Field

iconMiniPlay_

javax.swing.ImageIcon iconMiniPlay_
Description of the Field

iconMiniPause_

javax.swing.ImageIcon iconMiniPause_
Description of the Field

iconMiniStop_

javax.swing.ImageIcon iconMiniStop_
Description of the Field

iconMiniForward_

javax.swing.ImageIcon iconMiniForward_
Description of the Field

iconMiniBack_

javax.swing.ImageIcon iconMiniBack_
Icon For going back a song.

iconVolOn_

javax.swing.ImageIcon iconVolOn_
Unmuted Icon

iconVolOff_

javax.swing.ImageIcon iconVolOff_
Muted Icon

iconLoop_

javax.swing.ImageIcon iconLoop_
Description of the Field

iconSelectedLoop

javax.swing.ImageIcon iconSelectedLoop
Description of the Field

backgroundTextureFilename_

java.lang.String backgroundTextureFilename_
Description of the Field

panel

KPanel panel
Description of the Field

miniDragButton

KButton miniDragButton
Description of the Field

miniDragLabel

ColouredLabel miniDragLabel
Description of the Field

buttonDeleteFromPlaylist

KButton buttonDeleteFromPlaylist
Description of the Field

buttonAddToPlaylist

KButton buttonAddToPlaylist
Description of the Field

buttonAddUrlToPlaylist

KButton buttonAddUrlToPlaylist
Description of the Field

buttonRefreshPlaylist

KButton buttonRefreshPlaylist
Description of the Field

button

KButton button
Description of the Field

buttonPause

KButton buttonPause
Description of the Field

buttonLast

KButton buttonLast
Description of the Field

buttonNext

KButton buttonNext
Description of the Field

miniButtonPlay

KButton miniButtonPlay
Description of the Field

miniButtonPause

KButton miniButtonPause
Description of the Field

miniButtonLast

KButton miniButtonLast
Description of the Field

miniButtonNext

KButton miniButtonNext
Description of the Field

miniButtonView_

KButton miniButtonView_
Description of the Field

miniButtonClose_

KButton miniButtonClose_
Description of the Field

checkBoxLoop

javax.swing.JCheckBox checkBoxLoop
Description of the Field

checkBoxRandom

javax.swing.JCheckBox checkBoxRandom
Description of the Field

checkBoxPlaylist

javax.swing.JCheckBox checkBoxPlaylist
Description of the Field

checkBoxMiniView

javax.swing.JCheckBox checkBoxMiniView
Description of the Field

songProgress

javax.swing.JProgressBar songProgress
Description of the Field

oggBitStream_

java.io.InputStream oggBitStream_
Description of the Field

buffer

byte[] buffer
Description of the Field

bytes

int bytes
Description of the Field

rate

int rate
Description of the Field

channels

int channels
Description of the Field

outputLine

javax.sound.sampled.SourceDataLine outputLine
Description of the Field

songComments_

java.util.Vector songComments_
Description of the Field

selectAllAsFavouriteSongActionListener

java.awt.event.ActionListener selectAllAsFavouriteSongActionListener
Listener For the select all as favourite Songs menuitem. *

deselectAllAsFavouriteSongActionListener

java.awt.event.ActionListener deselectAllAsFavouriteSongActionListener
Listener For the select all as favourite Songs menuitem. *

miniViewMouseListener

java.awt.event.MouseAdapter miniViewMouseListener
Listener . *

dragMiniViewMotionListener

java.awt.event.MouseMotionAdapter dragMiniViewMotionListener
Listener . *

deleteSelectedSongActionListener

java.awt.event.ActionListener deleteSelectedSongActionListener
Listener For the Delete Selected Song Playlist Button. *

savePlaylistActionListener

java.awt.event.ActionListener savePlaylistActionListener
Listener For the Save Playlist to a file Button. *

deleteAllActionListener

java.awt.event.ActionListener deleteAllActionListener
Listener For the Delete ALL Songs from the Playlist Button. *

addSongActionListener

java.awt.event.ActionListener addSongActionListener
Listener For the Add a Song to the Playlist Button. *

addFromPlaylistActionListener

java.awt.event.ActionListener addFromPlaylistActionListener
Listener For the add ALL Songs from PlaylistFile Button. *

addURLActionListener

java.awt.event.ActionListener addURLActionListener
Listener For the Add a Song from a URL Button. *

loopingRunnable_

java.lang.Runnable loopingRunnable_
Runs the Looping of Songs in its own thread. It simply watches the playerThread_ to see when it goes null and then increments the currentItemIndex and trys to play the next song via tryPlay(...).

timeWatcherRunnable_

java.lang.Runnable timeWatcherRunnable_
Handles the Timer display in its own Thread.

Why not use the Timer class in the JDK??? Because it is since JDK 1.3.


playListComboBox

JCheckDropDown playListComboBox
Description of the Field

oggSyncState_

SyncState oggSyncState_
Description of the Field

oggStreamState_

StreamState oggStreamState_
Description of the Field

oggPage_

Page oggPage_
Description of the Field

oggPacket_

Packet oggPacket_
Description of the Field

vorbisInfo

Info vorbisInfo
Description of the Field

vorbisComment

Comment vorbisComment
Description of the Field

vorbisDspState

DspState vorbisDspState
Description of the Field

vorbisBlock

Block vorbisBlock
Description of the Field

format

int format
Description of the Field

frameSizeInBytes

int frameSizeInBytes
Description of the Field

bufferLengthInBytes

int bufferLengthInBytes
Description of the Field

log_

protected static Log log_
The Log that will get used.

popUpWin_

protected static javax.swing.JWindow popUpWin_
The JWindow for the miniView.

cfgmgr_

private ConfigurationManager cfgmgr_
Constructor Detail

jOggPlayer

public jOggPlayer()
Basic constructor for this Object. It is initated with no songs in the playlist.

jOggPlayer

public jOggPlayer(java.lang.String[] args)
Constructor for this Object to initated the playlist with the file/songname args that are passed to it, if the passed args is empty or values are invalid - the default playlistfile is loaded.
Parameters:
args - is a set of ogg file names to initially load (it can be a directory name)
Method Detail

getCodeBase

public java.net.URL getCodeBase()
Overrides:
getCodeBase in class java.applet.Applet

setColours

private void setColours()
Sets all the Various colours to their current variable values.

setDisplayFont

private void setDisplayFont(java.awt.Font newFont)
Changes all the Labels in the Display area to the ne font. It re validates the display as well.
Parameters:
newFont - The new DisplayFont value

getOutputLine

private javax.sound.sampled.SourceDataLine getOutputLine(int channels,
                                                         int rate)
Gets the OutputLine attribute of the jOggPlayer object
Parameters:
channels - Description of Parameter
rate - Description of Parameter
Returns:
The OutputLine value

getFileBaseURLs

private java.net.URL[] getFileBaseURLs(java.lang.String[] fileStrings)
Creates a URL[] for the given Strings.
Parameters:
fileStrings - Description of Parameter
Returns:
The FileBaseURLs value

loadTextureNames

private java.lang.String[] loadTextureNames()
Loads the names of the textures available in this classes jar file.
Returns:
an array of strings containing the relative paths of all textures within the jar file.

loadIconImages

private void loadIconImages()
Loads / initializes the class vars for all required icons and images this app/let uses.


init_jorbis

private void init_jorbis()
Initializes all the jOrbis and jOgg vars that are used for song playback.

init_audio

private void init_audio(int channels,
                        int rate)
Description of the Method
Parameters:
channels - Description of Parameter
rate - Description of Parameter

readFromStream

private int readFromStream(byte[] buffer,
                           int index,
                           int bufferSize_)
Reads from the oggBitStream_ a specified number of Bytes(bufferSize_) worth sarting at index and puts them in the specified buffer[].
Parameters:
buffer -  
index -  
bufferSize_ -  
Returns:
the number of bytes read or -1 if error.

startTimer

private void startTimer()
Helper method to encapsulate the starting of the timeWatcherRunnable_.*

tryPlay

private void tryPlay(java.net.URL url)
Attempts to Play the Ogg File At the Specified URL. It checks the URL , updates the buttons and then starts the playerThread.
Parameters:
url - the url for the song to play

tryPlay

private void tryPlay(java.lang.String item)
Attempts to Play the Ogg File At the Specified URL String. It checks the URL, updates the buttons and then starts the playerThread.
Parameters:
item - Description of Parameter

updateDisplayPopup

private void updateDisplayPopup()
Updates the tooltip popup text for the Display area with the latest song info.

initMenus

private void initMenus()
Gets the Menus setup.

showPlaylistPanel

private void showPlaylistPanel(boolean showIt)
Switches the Playlist panel on/off.
Parameters:
showIt - specifies whether to view or not.

showMiniView

private static void showMiniView(boolean showIt)
Switches to or from the mini view.
Parameters:
showIt - specifies whether to go to mini view or not.

initUI

private void initUI()
Gets the GUI setup *

main

public static void main(java.lang.String[] arg)
The main program for the jOggPlayer class
Parameters:
arg - The command line arguments

init

public void init()
A helper method that initializes the required class vars. This gets called by this class running as an applet.
Overrides:
init in class java.applet.Applet

start

public void start()
The applet start *
Overrides:
start in class java.applet.Applet

run

public void run()
The Runnable to do the actual playing of the song. All the rest of this class is fluff to get to this point [:)] . This code was developed by the jCraft group.
Specified by:
run in interface java.lang.Runnable

stop

public void stop()
Stops the current playing oggStream in the playerStream_.
Overrides:
stop in class java.applet.Applet

loadConfigs

private void loadConfigs()
Loads all the storable data from the config manager.

storeConfigs

private void storeConfigs()
Puts all the storable data in to the config manager in prep for saving.

createConfigs

private void createConfigs()
Creates all the storable data in to the config manager.

volumeMultiplier

public double volumeMultiplier(int currSetting)
Converts a linear mapped value to its Log equivalent. For use in the Volume Scale.
Parameters:
currSetting - is the linear value to convert. Acceptable values: 0 = mute, 10 = full, 11 is for fun.
Returns:
the Log value (Log currSetting)

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Handles all the Actions originating from the Control Buttons. *
Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - Description of Parameter