chrriis.dj.nativeswing.swtimpl.components
Class VLCInput

java.lang.Object
  extended by chrriis.dj.nativeswing.swtimpl.components.VLCInput

public class VLCInput
extends Object

A VLC object responsible for input-related actions.

Author:
Christopher Deckers

Nested Class Summary
static class VLCInput.VLCMediaState
          The state of a media.
 
Method Summary
 int getAbsolutePosition()
          Get the current position on the timeline.
 int getDuration()
          Get the duration in milliseconds of the current media.
 float getFrameRate()
          Get the number of frames per second.
 VLCInput.VLCMediaState getMediaState()
          Get the state.
 float getPlaySpeedFactor()
          Get the speed factor that is applied when a media is played.
 float getRelativePosition()
          Get the current relative position on the timeline as a float between 0 and 1.
 boolean isVideoDisplayed()
          Indicate if a video is currently displayed.
 void setAbsolutePosition(int time)
          Set the current position on the timeline.
 void setPlaySpeedFactor(float speedFactor)
          Set the speed factor that is applied when a media is played.
 void setRelativePosition(float position)
          Set the current relative position on the timeline.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDuration

public int getDuration()
Get the duration in milliseconds of the current media.

Returns:
the duration in milliseconds, or -1 in case of failure.

getFrameRate

public float getFrameRate()
Get the number of frames per second.

Returns:
the number of frames per second, or NaN in case of failure.

isVideoDisplayed

public boolean isVideoDisplayed()
Indicate if a video is currently displayed.

Returns:
true if a video is displayed.

setRelativePosition

public void setRelativePosition(float position)
Set the current relative position on the timeline.

Parameters:
position - A value between 0 and 1.

getRelativePosition

public float getRelativePosition()
Get the current relative position on the timeline as a float between 0 and 1.

Returns:
the current relative position, or Float.NaN if not available.

setAbsolutePosition

public void setAbsolutePosition(int time)
Set the current position on the timeline.

Parameters:
time - The current position in milliseconds.

getAbsolutePosition

public int getAbsolutePosition()
Get the current position on the timeline.

Returns:
the current position in milliseconds, or -1 in case of failure.

getMediaState

public VLCInput.VLCMediaState getMediaState()
Get the state.

Returns:
the state, or null in case of failure.

setPlaySpeedFactor

public void setPlaySpeedFactor(float speedFactor)
Set the speed factor that is applied when a media is played.

Parameters:
speedFactor - the speed factor.

getPlaySpeedFactor

public float getPlaySpeedFactor()
Get the speed factor that is applied when a media is played.

Returns:
the speed factor, or NaN in case of failure.