1 /*****************************************************************************
2 * PlaylistIntf.java: The playlist interface
3 *****************************************************************************
5 * Copyright (C) 1998-2006 the VideoLAN team
7 * Author: Filippo Carone <filippo@carone.org>
9 * Created on 28-feb-2006
13 * This program is free software; you can redistribute it
14 * and/or modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2 of the
16 * License, or (at your option) any later version.
18 * This program is distributed in the hope that it will be useful, but
19 * WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * General Public License for more details.
23 * You should have received a copy of the GNU General Public
24 * License along with this program; if not, write to the Free Software
25 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
30 package org.videolan.jvlc;
32 public interface PlaylistIntf {
35 * Plays the item specified in id, with options. At the moment options
36 * has no effect and can be safely set to null.
37 * @param id The ID to play
38 * @param options Options to play the item with
40 void play(int id, String[] options) throws VLCException;
43 * Plays the current item in the playlist.
45 void play() throws VLCException;
48 * Toggles pause for the current item.
50 void togglePause() throws VLCException;
54 * Pauses the currently playing item if pause value is true. Plays it
55 * otherwise. If you set pause to true and the current item is already
56 * playing, this has no effect.
59 * @throws VLCException
61 void setPause(boolean pause) throws VLCException;
64 * Stops the currently playing item. Differently from pause, stopping
65 * an item destroys any information related to the item.
67 void stop() throws VLCException;
70 * This function returns true if the current item has not been stopped.
71 * @return True if the current item has not been stopped
73 boolean isRunning() throws VLCException;
76 * TODO: this should return the number of items added with add, with no
77 * respect to videolan internal playlist.
79 * Returns the number of items in the playlist. Beware that this number
80 * could be bigger than the number of times add() has been called.
82 * @return Current number of items in the playlist
84 int itemsCount() throws VLCException;
87 * Move to next item in the playlist and play it.
89 void next() throws VLCException;
92 * Move to previous item in the playlist and play it.
94 void prev() throws VLCException;
97 * Clear the playlist which becomes empty after this call.
99 void clear() throws VLCException;
102 * TODO: document the kind of items that can be added.
103 * Add a new item in the playlist.
105 * @param uri Location of the item
106 * @param name Name of the item
107 * @return The item ID
109 int add(String uri, String name) throws VLCException;
112 * Currently not implemented
119 void setLoop(boolean loop);