xinecanvas
Class XineCanvas

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Canvas
          extended by xinecanvas.XineCanvas
All Implemented Interfaces:
java.awt.event.HierarchyListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible

public class XineCanvas
extends java.awt.Canvas
implements java.awt.event.HierarchyListener

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.BaselineResizeBehavior
 
Field Summary
static int XINE_STATUS_PLAY
           
static int XINE_STATUS_QUIT
           
static int XINE_STATUS_STOP
           
 
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
XineCanvas()
           
 
Method Summary
static boolean callXInitThreads()
           
 void closeStream(long stream)
          Close the specific xine_stream and free its allocated memory
 long getStreamLenght(long stream)
          Get the length of the stream.
 long getStreamPosition(long stream)
          Get the stream position
 int getStreamStatus(long stream)
          Returns the status of a stream:
 void hierarchyChanged(java.awt.event.HierarchyEvent arg0)
           
 long openMRL(java.lang.String mrl)
          Allocate a new xine_stream structure and open the specified mrl.
 void paint(java.awt.Graphics g)
           
 boolean playStream(long stream)
          Returns true if the play was successful, false otherwise.
static java.lang.String statusString(int status_code)
           
 void stopStream(long stream)
          Stops the play of the current stream.
 void update(java.awt.Graphics g)
           
 
Methods inherited from class java.awt.Canvas
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, dispatchEvent, doLayout, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

XINE_STATUS_STOP

public static int XINE_STATUS_STOP

XINE_STATUS_PLAY

public static int XINE_STATUS_PLAY

XINE_STATUS_QUIT

public static int XINE_STATUS_QUIT
Constructor Detail

XineCanvas

public XineCanvas()
Method Detail

callXInitThreads

public static boolean callXInitThreads()

paint

public void paint(java.awt.Graphics g)
Overrides:
paint in class java.awt.Canvas

update

public void update(java.awt.Graphics g)
Overrides:
update in class java.awt.Canvas

hierarchyChanged

public void hierarchyChanged(java.awt.event.HierarchyEvent arg0)
Specified by:
hierarchyChanged in interface java.awt.event.HierarchyListener

openMRL

public long openMRL(java.lang.String mrl)
Allocate a new xine_stream structure and open the specified mrl.

Parameters:
mrl - The Media Resource Location for a media file.
Returns:
A pointer to the native xine_stream structure, or NULL if the stream could not be opened.

playStream

public boolean playStream(long stream)
Returns true if the play was successful, false otherwise.

Parameters:
stream -
Returns:

stopStream

public void stopStream(long stream)
Stops the play of the current stream.

Parameters:
stream -

closeStream

public void closeStream(long stream)
Close the specific xine_stream and free its allocated memory

Parameters:
stream -

getStreamPosition

public long getStreamPosition(long stream)
Get the stream position

Parameters:
stream -
Returns:
The play position in milliseconds of the stream, or -1 if it could not be retrieved.

getStreamLenght

public long getStreamLenght(long stream)
Get the length of the stream.

Parameters:
stream - The length in milliseconds of the stream, or -1 if it could not be retrieved.
Returns:

getStreamStatus

public int getStreamStatus(long stream)
Returns the status of a stream:
        #define XINE_STATUS_IDLE                   0 // no mrl assigned
  #define XINE_STATUS_STOP                   1
  #define XINE_STATUS_PLAY                   2
  #define XINE_STATUS_QUIT                   3
 

Parameters:
stream -
Returns:
The stream status code, as documented by xine.h

statusString

public static java.lang.String statusString(int status_code)