ca.bc.webarts
Class jOggPlayer

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Panel
              extended byjava.applet.Applet
                  extended byjavax.swing.JApplet
                      extended byca.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

Nested Class Summary
 
Nested classes inherited from class javax.swing.JApplet
javax.swing.JApplet.AccessibleJApplet
 
Nested classes inherited from class java.applet.Applet
java.applet.Applet.AccessibleApplet
 
Nested classes inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
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
          The application name string
(package private) static java.net.URL appCodeBase_
          The codebase dir when running as an application.
(package private) static javax.swing.JFrame appFrame_
          Description of the Field
(package private) static jOggPlayer applicationPlayer
          The instantied class.
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) static boolean autoPlayOnStart_
          Flag to specify if the playlist gets auto started on startup.
(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
          Class holder for the classpath.
(package private) static java.net.URL codeBase_
          The codebase dir when running as an applet.
private static java.lang.String configFileName_
          The jOggPlayer persistant config data file.
(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
          The panel used to hold all the display components.
(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
          This Listener watches/listens where the mini window is being dragged to so it can be repainted on the screen because the miniwindow does NOT have a Java created titlebar so I have to mimic the window move.
(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)  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
          The dir where the images are located.
(package private) static java.lang.String[] initArgs_
          The commandline args that get passed to the app.
(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)  boolean looping_
          Small flag when a songs are looping.
(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
          This Listener gets the first event when the mini view title bar is pressed so it can remember the original location of mini window.
(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) static int songInfoDisplayDismissDelay_
          The dismiss delay time for the song info Dispay tooltip.
(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
          Constant holding the users file seperator.
(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
          Class holder for the users dir.
(package private) static java.awt.GraphicsEnvironment USER_GRAPHIC_ENV
          The Java2 Graphics environment (getrs some platform local data).
(package private) static java.lang.String VERSION
          The version string for this release.
(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
 
Fields inherited from class java.awt.Panel
 
Fields inherited from class java.awt.Container
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
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 autoPlay()
           
private  void createConfigs()
          Creates all the storable data in to the config manager.
 java.net.URL getCodeBase()
           
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, getAccessibleContext, getContentPane, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, 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
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, 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, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SYSTEM_FILE_SEPERATOR

private static final java.lang.String SYSTEM_FILE_SEPERATOR
Constant holding the users file seperator. ("/" or "\")


APP_NAME

private static final java.lang.String APP_NAME
The application name string

See Also:
Constant Field Values

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
The dir where the images are located.


USER_DIR

static final java.lang.String USER_DIR
Class holder for the users dir.


CLASSPATH

static java.lang.String CLASSPATH
Class holder for the classpath.


configFileName_

private static java.lang.String configFileName_
The jOggPlayer persistant config data file.


VERSION

static final java.lang.String VERSION
The version string for this release.

See Also:
Constant Field Values

USER_GRAPHIC_ENV

static final java.awt.GraphicsEnvironment USER_GRAPHIC_ENV
The Java2 Graphics environment (getrs some platform local data).


appCodeBase_

static java.net.URL appCodeBase_
The codebase dir when running as an application.


codeBase_

static java.net.URL codeBase_
The codebase dir when running as an applet.


initArgs_

static java.lang.String[] initArgs_
The commandline args that get passed to the app.


applicationPlayer

static jOggPlayer applicationPlayer
The instantied class.


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.


songInfoDisplayDismissDelay_

static int songInfoDisplayDismissDelay_
The dismiss delay time for the song info Dispay tooltip.


maxVolScale_

static final int maxVolScale_
Description of the Field

See Also:
Constant Field Values

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.


autoPlayOnStart_

static boolean autoPlayOnStart_
Flag to specify if the playlist gets auto started on startup.


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
The panel used to hold all the display components.


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


looping_

boolean looping_
Small flag when a songs are looping.


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
This Listener gets the first event when the mini view title bar is pressed so it can remember the original location of mini window. This is in anticipation of a window drag


dragMiniViewMotionListener

java.awt.event.MouseMotionAdapter dragMiniViewMotionListener
This Listener watches/listens where the mini window is being dragged to so it can be repainted on the screen because the miniwindow does NOT have a Java created titlebar so I have to mimic the window move.


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()

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

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 *


autoPlay

private void autoPlay()

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.


start

public void start()
The applet start *


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_.


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