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 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();
53 native private boolean _inputIsPlaying();
54 native private boolean _inputHasVout();
57 public synchronized void play(int id, String[] options) {
59 while (! _inputIsPlaying()) ;
62 public synchronized void play() {
66 public synchronized void pause() {
70 public synchronized void stop() {
75 public boolean isRunning() {
76 return (_isRunning() == 0)? false : true ;
79 public synchronized int itemsCount() {
83 public synchronized void next() {
89 public synchronized void prev() {
95 public synchronized void clear() {
99 public synchronized int add(String uri, String name, String[] options) {
100 return _playlist_add(uri, name, options);
103 public synchronized int add(String uri, String name) {
104 return add(uri, name, null);
107 public synchronized void addExtended() {
110 public synchronized void deleteItem(int itemID) {
114 public long getInstance() {
115 return libvlcInstance;
118 public synchronized boolean inputIsPlaying() {
119 return _inputIsPlaying();
122 public synchronized boolean inputHasVout() {
123 return _inputHasVout();