chrriis.dj.nativeswing.swtimpl.components
Class VLCPlaylist

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

public class VLCPlaylist
extends Object

A VLC object responsible for playlist-related actions.

Author:
Christopher Deckers

Method Summary
 void addItem(Class<?> clazz, String resourcePath)
          Add an item from the classpath to the playlist.
 void addItem(Class<?> clazz, String resourcePath, String options)
          Add an item from the classpath to the playlist.
 void addItem(String resourcePath)
          Add an item to the playlist.
 void addItem(String resourcePath, String options)
          Add an item to the playlist.
 void clear()
          Clear the playlist.
 int getItemCount()
          Get the number of items in the playlist.
 void goNext()
          Move to the next item of the playlist.
 void goPrevious()
          Move to the previous item of the playlist.
 boolean isPlaying()
          Indicate whether the playlist is currently playing an item.
 void play()
          Start playing the playlist.
 void playItem(int itemID)
          Start playing an item from the playlist using its ID.
 void removeItem(int index)
          Remove an item using its index.
 void stop()
          Stop playing.
 void togglePause()
          Toggle the pause state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getItemCount

public int getItemCount()
Get the number of items in the playlist.

Returns:
the item count, or -1 in case of failure.

isPlaying

public boolean isPlaying()
Indicate whether the playlist is currently playing an item.

Returns:
true if an item is being played.

addItem

public void addItem(Class<?> clazz,
                    String resourcePath)
Add an item from the classpath to the playlist.

Parameters:
clazz - the reference clazz of the file to load.
resourcePath - the path to the file.

addItem

public void addItem(Class<?> clazz,
                    String resourcePath,
                    String options)
Add an item from the classpath to the playlist.

Parameters:
clazz - the reference clazz of the file to load.
resourcePath - the path to the file.
options - VLC options, for example ":start-time=30 :no-audio".

addItem

public void addItem(String resourcePath)
Add an item to the playlist.

Parameters:
resourcePath - the path or URL to the file.

addItem

public void addItem(String resourcePath,
                    String options)
Add an item to the playlist.

Parameters:
resourcePath - the path or URL to the file.
options - VLC options, for example ":start-time=30 :no-audio".

play

public void play()
Start playing the playlist.


playItem

public void playItem(int itemID)
Start playing an item from the playlist using its ID.

Parameters:
itemID - the ID of the item to play.

togglePause

public void togglePause()
Toggle the pause state.


stop

public void stop()
Stop playing.


goNext

public void goNext()
Move to the next item of the playlist.


goPrevious

public void goPrevious()
Move to the previous item of the playlist.


clear

public void clear()
Clear the playlist.


removeItem

public void removeItem(int index)
Remove an item using its index.

Parameters:
index - the index of the item.