1 /*****************************************************************************
2 * Playlist.java: PlaylistIntf implementation class
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 class Playlist implements PlaylistIntf {
35 private long libvlcInstance;
37 public Playlist(long _libvlcInstance) {
38 this.libvlcInstance = _libvlcInstance;
41 native private int _playlist_add(String uri, String name, String[] options);
42 native private void _play(int _id, String[] options);
43 native private void _pause();
44 native private void _stop();
45 native private void _next();
46 native private void _prev();
47 native private void _clear();
48 native private void _deleteItem(int itemID);
50 native private int _itemsCount();
51 native private int _isRunning();
52 native private void _setLoop(boolean loop);
55 public synchronized void play(int id, String[] options) throws VLCException {
59 public synchronized void play() throws VLCException {
63 public synchronized void togglePause() throws VLCException {
67 public synchronized void stop() throws VLCException {
72 // } catch (InterruptedException e) {
73 // e.printStackTrace();
75 // } while (isRunning());
78 public boolean isRunning() throws VLCException {
79 return (_isRunning() == 0)? false : true ;
82 public synchronized int itemsCount() throws VLCException {
86 public synchronized void next() throws VLCException {
92 public synchronized void prev() throws VLCException {
98 public synchronized void clear() throws VLCException {
102 public synchronized int add(String uri, String name, String[] options) throws VLCException {
103 return _playlist_add(uri, name, options);
106 public synchronized int add(String uri, String name) throws VLCException {
107 return add(uri, name, null);
110 public synchronized void addExtended() {
113 public synchronized void deleteItem(int itemID) throws VLCException {
117 public synchronized void setLoop(boolean loop) {
121 public long getInstance() throws VLCException {
122 return libvlcInstance;
125 public void setPause(boolean pause) throws VLCException {
126 // TODO Auto-generated method stub