]> git.sesse.net Git - vlc/blob - bindings/java/org/videolan/jvlc/PlaylistIntf.java
Use playlist loop libvlc facility
[vlc] / bindings / java / org / videolan / jvlc / PlaylistIntf.java
1 /*****************************************************************************
2  * PlaylistIntf.java: The playlist interface
3  *****************************************************************************
4  *
5  * Copyright (C) 1998-2006 the VideoLAN team
6  * 
7  * Author: Filippo Carone <filippo@carone.org>
8  *
9  * Created on 28-feb-2006
10  *
11  * $Id$
12  *
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.
17  * 
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.
22  * 
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.
26  * 
27  */
28
29
30 package org.videolan.jvlc;
31
32 public interface PlaylistIntf {
33
34         /**
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
39      */
40     void play(int id, String[] options) throws VLCException;
41     
42     /**
43      * Plays the current item in the playlist.
44      */
45     void play() throws VLCException;
46     
47     /**
48      * Toggles pause for the current item.
49      */
50     void togglePause() throws VLCException;
51     
52     
53     /**
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.
57      * 
58      * @param pause
59      * @throws VLCException
60      */
61     void setPause(boolean pause) throws VLCException;
62     
63     /**
64      * Stops the currently playing item. Differently from pause, stopping
65      * an item destroys any information related to the item.
66      */
67     void stop() throws VLCException;
68     
69     /**
70      * This function returns true if the current item has not been stopped.
71      * @return True if the current item has not been stopped
72      */
73     boolean isRunning() throws VLCException;
74     
75     /**
76      * TODO: this should return the number of items added with add, with no
77      * respect to videolan internal playlist.
78      * 
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.
81      * 
82      * @return Current number of items in the playlist
83      */
84     int itemsCount() throws VLCException;
85     
86     /**
87      * Move to next item in the playlist and play it.
88      */
89     void next() throws VLCException;
90     
91     /**
92      * Move to previous item in the playlist and play it.
93      */
94     void prev() throws VLCException;
95     
96     /**
97      * Clear the playlist which becomes empty after this call.
98      */
99     void clear() throws VLCException;
100     
101     /**
102      * TODO: document the kind of items that can be added.
103      * Add a new item in the playlist.
104      * 
105      * @param uri Location of the item
106      * @param name Name of the item
107      * @return The item ID
108      */
109     int add(String uri, String name) throws VLCException;
110     
111     /**
112      * Currently not implemented
113      */
114     void addExtended();
115     
116     /**
117      * @param loop
118      */
119     void setLoop(boolean loop);
120 }