[PATCH] - maven project structure reorganization - add a exec:java goal to launch...
authorAdrien Grand <jpountz@jpountz.net>
Sat, 15 Mar 2008 12:27:06 +0000 (13:27 +0100)
committerFilippo Carone <littlejohn@videolan.org>
Sat, 15 Mar 2008 12:27:35 +0000 (13:27 +0100)
44 files changed:
bindings/java/VlcClient.java [deleted file]
bindings/java/core/pom.xml [new file with mode: 0644]
bindings/java/core/src/main/java/org/videolan/jvlc/Audio.java [new file with mode: 0644]
bindings/java/core/src/main/java/org/videolan/jvlc/JVLC.java [new file with mode: 0644]
bindings/java/core/src/main/java/org/videolan/jvlc/MediaDescriptor.java [new file with mode: 0644]
bindings/java/core/src/main/java/org/videolan/jvlc/MediaInstance.java [new file with mode: 0644]
bindings/java/core/src/main/java/org/videolan/jvlc/MediaList.java [new file with mode: 0644]
bindings/java/core/src/main/java/org/videolan/jvlc/MediaListPlayer.java [new file with mode: 0644]
bindings/java/core/src/main/java/org/videolan/jvlc/Playlist.java [new file with mode: 0644]
bindings/java/core/src/main/java/org/videolan/jvlc/VLCException.java [new file with mode: 0644]
bindings/java/core/src/main/java/org/videolan/jvlc/Video.java [new file with mode: 0644]
bindings/java/core/src/main/java/org/videolan/jvlc/event/MediaInstanceCallback.java [new file with mode: 0644]
bindings/java/core/src/main/java/org/videolan/jvlc/event/MediaInstanceListener.java [new file with mode: 0644]
bindings/java/core/src/main/java/org/videolan/jvlc/example/VLCExample.java [new file with mode: 0644]
bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlc.java [new file with mode: 0644]
bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlcEventType.java [new file with mode: 0644]
bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlcImpl.java [new file with mode: 0644]
bindings/java/core/src/main/resources/.gitignore [new file with mode: 0644]
bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcCoreTest.java [new file with mode: 0644]
bindings/java/core/src/test/java/org/videolan/jvlc/internal/MediaListTest.java [new file with mode: 0644]
bindings/java/core/src/test/resources/raffa_voice.ogg [new file with mode: 0644]
bindings/java/pom.xml
bindings/java/samples/client/pom.xml [new file with mode: 0644]
bindings/java/samples/client/src/main/java/VlcClient.java [new file with mode: 0644]
bindings/java/samples/pom.xml [new file with mode: 0644]
bindings/java/src/main/java/org/videolan/jvlc/Audio.java [deleted file]
bindings/java/src/main/java/org/videolan/jvlc/JVLC.java [deleted file]
bindings/java/src/main/java/org/videolan/jvlc/MediaDescriptor.java [deleted file]
bindings/java/src/main/java/org/videolan/jvlc/MediaInstance.java [deleted file]
bindings/java/src/main/java/org/videolan/jvlc/MediaList.java [deleted file]
bindings/java/src/main/java/org/videolan/jvlc/MediaListPlayer.java [deleted file]
bindings/java/src/main/java/org/videolan/jvlc/Playlist.java [deleted file]
bindings/java/src/main/java/org/videolan/jvlc/VLCException.java [deleted file]
bindings/java/src/main/java/org/videolan/jvlc/Video.java [deleted file]
bindings/java/src/main/java/org/videolan/jvlc/event/MediaInstanceCallback.java [deleted file]
bindings/java/src/main/java/org/videolan/jvlc/event/MediaInstanceListener.java [deleted file]
bindings/java/src/main/java/org/videolan/jvlc/example/VLCExample.java [deleted file]
bindings/java/src/main/java/org/videolan/jvlc/internal/LibVlc.java [deleted file]
bindings/java/src/main/java/org/videolan/jvlc/internal/LibVlcEventType.java [deleted file]
bindings/java/src/main/java/org/videolan/jvlc/internal/LibVlcImpl.java [deleted file]
bindings/java/src/main/resources/.gitignore [deleted file]
bindings/java/src/test/java/org/videolan/jvlc/internal/LibVlcCoreTest.java [deleted file]
bindings/java/src/test/java/org/videolan/jvlc/internal/MediaListTest.java [deleted file]
bindings/java/src/test/resources/raffa_voice.ogg [deleted file]

diff --git a/bindings/java/VlcClient.java b/bindings/java/VlcClient.java
deleted file mode 100644 (file)
index a1b6692..0000000
+++ /dev/null
@@ -1,231 +0,0 @@
-/*****************************************************************************
- * VlcClient.java: Sample Swing player
- *****************************************************************************
- * Copyright (C) 1998-2006 the VideoLAN team
- * 
- * Created on 28-feb-2006
- *
- * $Id: AudioIntf.java 8 2006-02-28 12:03:47Z little $
- *
- * This program is free software; you can redistribute it
- * and/or modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- * 
- */
-
-import java.awt.Canvas;
-import java.awt.Frame;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-
-import javax.swing.JPanel;
-
-import org.videolan.jvlc.JVLC;
-import org.videolan.jvlc.Playlist;
-import org.videolan.jvlc.VLCException;
-
-
-class VLCPlayerFrame extends Frame
-{
-
-    private Playlist playlist;
-
-    public Canvas jvcanvas;
-
-    public VLCPlayerFrame()
-    {
-        initComponents();
-    }
-
-    private void initComponents()
-    {
-
-        java.awt.GridBagConstraints gridBagConstraints;
-
-        fullScreenButton = new javax.swing.JButton();
-        jTextField1 = new javax.swing.JTextField();
-        setButton = new javax.swing.JButton();
-        pauseButton = new javax.swing.JButton();
-        stopButton = new javax.swing.JButton();
-
-        jvcc = new JPanel();
-        jvcanvas = new java.awt.Canvas();
-        jvcanvas.setSize(200, 200);
-        jvcc.add(jvcanvas);
-        
-        jvlc = new JVLC();
-        
-        playlist = new Playlist(jvlc);
-
-        setLayout(new java.awt.GridBagLayout());
-
-        gridBagConstraints = new java.awt.GridBagConstraints();
-        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.CENTER;
-        gridBagConstraints.gridx = 0;
-        gridBagConstraints.gridy = 0;
-        add(jvcc, gridBagConstraints);
-
-        fullScreenButton.setText("FullScreen");
-        fullScreenButton.addActionListener(new java.awt.event.ActionListener()
-        {
-
-            public void actionPerformed(java.awt.event.ActionEvent evt)
-            {
-                fullScreenButtonActionPerformed(evt);
-            }
-        });
-
-        gridBagConstraints = new java.awt.GridBagConstraints();
-        gridBagConstraints.gridx = 0;
-        gridBagConstraints.gridy = 2;
-        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
-        add(fullScreenButton, gridBagConstraints);
-
-        jTextField1.setText("file://a.avi");
-        gridBagConstraints = new java.awt.GridBagConstraints();
-        gridBagConstraints.gridx = 0;
-        gridBagConstraints.gridy = 1;
-        gridBagConstraints.gridwidth = 2;
-        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
-        add(jTextField1, gridBagConstraints);
-
-        setButton.setText("Set item");
-        setButton.addActionListener(new java.awt.event.ActionListener()
-        {
-
-            public void actionPerformed(java.awt.event.ActionEvent evt)
-            {
-                setButtonActionPerformed(evt);
-            }
-        });
-        gridBagConstraints = new java.awt.GridBagConstraints();
-        gridBagConstraints.gridx = 2;
-        gridBagConstraints.gridy = 1;
-        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
-        add(setButton, gridBagConstraints);
-
-        pauseButton.setText("Play/Pause");
-        pauseButton.addActionListener(new java.awt.event.ActionListener()
-        {
-
-            public void actionPerformed(java.awt.event.ActionEvent evt)
-            {
-                pauseButtonActionPerformed(evt);
-            }
-        });
-        gridBagConstraints = new java.awt.GridBagConstraints();
-        gridBagConstraints.gridx = 1;
-        gridBagConstraints.gridy = 2;
-        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
-        add(pauseButton, gridBagConstraints);
-
-        stopButton.setText("Stop");
-        stopButton.addActionListener(new java.awt.event.ActionListener()
-        {
-
-            public void actionPerformed(java.awt.event.ActionEvent evt)
-            {
-                stopButtonActionPerformed(evt);
-            }
-        });
-        gridBagConstraints = new java.awt.GridBagConstraints();
-        gridBagConstraints.gridx = 2;
-        gridBagConstraints.gridy = 2;
-        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
-        add(stopButton, gridBagConstraints);
-
-        pack();
-
-    }
-
-    private void stopButtonActionPerformed(java.awt.event.ActionEvent evt)
-    {
-        try
-        {
-            playlist.stop();
-        }
-        catch (Exception e)
-        {
-            e.printStackTrace();
-        }
-    }
-
-    private void pauseButtonActionPerformed(java.awt.event.ActionEvent evt)
-    {
-        try
-        {
-            playlist.togglePause();
-        }
-        catch (Exception e)
-        {
-            e.printStackTrace();
-        }
-    }
-
-    private void setButtonActionPerformed(java.awt.event.ActionEvent evt)
-    {
-        try
-        {
-            jvlc.setVideoOutput(jvcanvas);
-            playlist.add(jTextField1.getText(), "a.avi");
-            playlist.play();
-        }
-        catch (VLCException e)
-        {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-        }
-    }
-
-    private void fullScreenButtonActionPerformed(java.awt.event.ActionEvent evt)
-    {
-        // jvlc.fullScreen();
-    }
-
-    private javax.swing.JButton setButton;
-
-    private javax.swing.JButton pauseButton;
-
-    private javax.swing.JButton stopButton;
-
-    private javax.swing.JButton fullScreenButton;
-
-    private javax.swing.JTextField jTextField1;
-
-    private JPanel jvcc;
-
-    public JVLC jvlc;
-    // MediaControlInstance mci;
-
-}
-
-
-public class VlcClient
-{
-
-    public static void main(String[] args)
-    {
-        Frame f = new VLCPlayerFrame();
-        f.setBounds(0, 0, 500, 500);
-        f.addWindowListener(new WindowAdapter()
-        {
-
-            @Override
-            public void windowClosing(WindowEvent ev)
-            {
-                System.exit(0);
-            }
-        });
-        f.setVisible(true);
-    }
-}
diff --git a/bindings/java/core/pom.xml b/bindings/java/core/pom.xml
new file mode 100644 (file)
index 0000000..9a4989f
--- /dev/null
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd ">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.videolan</groupId>
+    <artifactId>jvlc-parent</artifactId>
+    <version>0.9.0-SNAPSHOT</version>
+  </parent>
+  <artifactId>jvlc-core</artifactId>
+  <packaging>jar</packaging>
+  <name>JVLC - Core</name>
+  <description>Java Bindings for VideoLAN - Core</description>
+   <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <source>1.6</source>
+          <target>1.6</target>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build> 
+  <dependencies>
+    <dependency>
+      <groupId>com.jna</groupId>
+      <artifactId>jna</artifactId>
+      <version>3.0.2</version>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.4</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  <repositories>
+    <repository>
+      <id>jvlc</id>
+      <name>JVLC Maven Repository</name>
+      <url>http://jvlc.ihack.it/maven2</url>
+      <snapshots>
+        <enabled>false</enabled>
+      </snapshots>
+    </repository>
+  </repositories>
+</project>
diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/Audio.java b/bindings/java/core/src/main/java/org/videolan/jvlc/Audio.java
new file mode 100644 (file)
index 0000000..09cf270
--- /dev/null
@@ -0,0 +1,122 @@
+/*****************************************************************************
+ * Audio.java: VLC Java Bindings, audio methods
+ *****************************************************************************
+ *
+ * Copyright (C) 1998-2008 the VideoLAN team
+ * 
+ * Author: Filippo Carone <filippo@carone.org>
+ *
+ *
+ * $Id: $
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * 
+ */
+
+package org.videolan.jvlc;
+
+import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t;
+
+
+public class Audio
+{
+
+    private final JVLC jvlc;
+
+    /**
+     * Constant for left channel audio
+     */
+    public static final int LEFT_CHANNEL = 3;
+
+    /**
+     * Constant for right channel audio
+     */
+    public static final int RIGHT_CHANNEL = 4;
+
+    /**
+     * Constant for reverse channel audio
+     */
+    public static final int REVERSE_CHANNEL = 2;
+
+    /**
+     * Constant for stereo channel audio
+     */
+    public static final int STEREO_CHANNEL = 1;
+
+    /**
+     * Constant for dolby channel audio
+     */
+    public final int DOLBY_CHANNEL = 5;
+
+    
+    public Audio(JVLC jvlc)
+    {
+        this.jvlc = jvlc;
+    }
+
+    public int getTrack(MediaInstance mediaInstance)
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        return jvlc.getLibvlc().libvlc_audio_get_track(mediaInstance.getInstance(), exception);
+    }
+
+    public void setTrack(MediaInstance mediaInstance, int track)
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        jvlc.getLibvlc().libvlc_audio_set_track(mediaInstance.getInstance(), track, exception);
+    }
+
+    public int getChannel()
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        return jvlc.getLibvlc().libvlc_audio_get_channel(jvlc.getInstance(), exception);
+    }
+
+    public void setChannel(int channel)
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        jvlc.getLibvlc().libvlc_audio_set_channel(jvlc.getInstance(), channel, exception);
+    }
+
+    public boolean getMute()
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        return jvlc.getLibvlc().libvlc_audio_get_mute(jvlc.getInstance(), exception) == 1 ? true : false;
+    }
+
+    public void setMute(boolean value)
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        jvlc.getLibvlc().libvlc_audio_set_mute(jvlc.getInstance(), value ? 1 : 0, exception);
+    }
+
+    public void toggleMute()
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        jvlc.getLibvlc().libvlc_audio_toggle_mute(jvlc.getInstance(), exception);
+    }
+
+    public int getVolume()
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        return jvlc.getLibvlc().libvlc_audio_get_volume(jvlc.getInstance(), exception);
+    }
+
+    public void setVolume(int volume)
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        jvlc.getLibvlc().libvlc_audio_set_volume(jvlc.getInstance(), volume, exception);
+    }
+}
diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/JVLC.java b/bindings/java/core/src/main/java/org/videolan/jvlc/JVLC.java
new file mode 100644 (file)
index 0000000..7ffaa18
--- /dev/null
@@ -0,0 +1,116 @@
+/*****************************************************************************
+ * JVLC.java: Main Java Class, represents a libvlc_instance_t object
+ *****************************************************************************
+ *
+ * Copyright (C) 1998-2008 the VideoLAN team
+ * 
+ * Author: Filippo Carone <filippo@carone.org>
+ *         Philippe Morin <phmorin@free.fr>
+ *
+ * Created on 28-feb-2006
+ *
+ * $Id: JVLC.java 20141 2007-05-16 19:31:35Z littlejohn $
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * 
+ */
+
+package org.videolan.jvlc;
+
+import org.videolan.jvlc.internal.LibVlc;
+import org.videolan.jvlc.internal.LibVlc.LibVlcInstance;
+import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t;
+
+import com.sun.jna.Native;
+
+import java.awt.Canvas;
+
+public class JVLC
+{
+
+    private final LibVlcInstance instance;
+
+    private final LibVlc libvlc = LibVlc.SYNC_INSTANCE;
+    
+    public JVLC()
+    {
+        String[] args = new String[1];
+        args[0] = "jvlc";
+        instance = createInstance(args);
+    }
+
+    public JVLC(String[] args)
+    {
+        String[] myargs = new String[args.length + 1];
+        myargs[0] = "jvlc";
+        System.arraycopy(args, 0, myargs, 1, args.length);
+        instance = createInstance(myargs);
+    }
+
+    public MediaInstance play(String media)
+    {
+        MediaDescriptor mediaDescriptor = new MediaDescriptor(this, media);
+        MediaInstance mediaInstance = new MediaInstance(mediaDescriptor);
+        mediaInstance.play();
+        return mediaInstance;
+    }
+
+    public void setVideoOutput(Canvas canvas)
+    {
+        long drawable = Native.getComponentID(canvas);
+        libvlc_exception_t exception = new libvlc_exception_t();
+        libvlc.libvlc_video_set_parent(instance, drawable, exception );
+    }
+
+    /*
+     * Core methods
+     */
+    private LibVlcInstance createInstance(String[] args)
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        libvlc.libvlc_exception_init(exception);
+
+        return libvlc.libvlc_new(args.length, args, exception);
+    }
+
+    /**
+     * Returns the _instance.
+     * @return the _instance
+     */
+    LibVlcInstance getInstance()
+    {
+        return instance;
+    }
+
+    /**
+     * Returns the libvlc.
+     * @return the libvlc
+     */
+    LibVlc getLibvlc()
+    {
+        return libvlc;
+    }
+
+    /*
+     * (non-Javadoc)
+     * @see java.lang.Object#finalize()
+     */
+    @Override
+    protected void finalize() throws Throwable
+    {
+        libvlc.libvlc_release(instance);
+        super.finalize();
+    }
+}
diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/MediaDescriptor.java b/bindings/java/core/src/main/java/org/videolan/jvlc/MediaDescriptor.java
new file mode 100644 (file)
index 0000000..a248d58
--- /dev/null
@@ -0,0 +1,104 @@
+/*****************************************************************************
+ * MediaDescriptor.java: VLC Java Bindings Media Descriptor
+ *****************************************************************************
+ * Copyright (C) 1998-2008 the VideoLAN team
+ *
+ * Authors: Filippo Carone <filippo@carone.org>
+ *
+ *
+ * $Id $
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+package org.videolan.jvlc;
+
+import org.videolan.jvlc.internal.LibVlc;
+import org.videolan.jvlc.internal.LibVlc.LibVlcEventManager;
+import org.videolan.jvlc.internal.LibVlc.LibVlcMediaDescriptor;
+import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t;
+
+
+public class MediaDescriptor
+{
+    private LibVlcMediaDescriptor instance;
+    private LibVlc libvlc;
+    private LibVlcEventManager eventManager;
+    
+    /**
+     * @param jvlc The jvlc instance to create the media descriptor for.
+     * @param media The media string
+     */
+    public MediaDescriptor(JVLC jvlc, String media)
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        libvlc = jvlc.getLibvlc();
+        instance = libvlc.libvlc_media_descriptor_new(jvlc.getInstance(), media, exception);
+        eventManager = libvlc.libvlc_media_descriptor_event_manager(instance, exception);
+    }
+
+    MediaDescriptor(JVLC jvlc, LibVlcMediaDescriptor instance)
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        libvlc = jvlc.getLibvlc();
+        this.instance = instance;
+        eventManager = libvlc.libvlc_media_descriptor_event_manager(instance, exception);
+    }
+
+    public void addOption(String option)
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        libvlc.libvlc_media_descriptor_add_option(instance, option, exception );
+    }
+    
+    public String getMrl()
+    {
+        return libvlc.libvlc_media_descriptor_get_mrl(instance);
+    }
+    
+    public MediaInstance getMediaInstance()
+    {
+        return new MediaInstance(this);
+    }
+    
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected void finalize() throws Throwable
+    {
+        libvlc.libvlc_media_descriptor_release(instance);
+        super.finalize();
+    }
+
+    
+    /**
+     * Returns the instance.
+     * @return the instance
+     */
+    LibVlcMediaDescriptor getInstance()
+    {
+        return instance;
+    }
+    
+    /**
+     * Returns the libvlc.
+     * @return the libvlc
+     */
+    LibVlc getLibvlc()
+    {
+        return libvlc;
+    }
+}
diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/MediaInstance.java b/bindings/java/core/src/main/java/org/videolan/jvlc/MediaInstance.java
new file mode 100644 (file)
index 0000000..d2ceee9
--- /dev/null
@@ -0,0 +1,196 @@
+/*****************************************************************************
+ * MediaInstance.java: VLC Java Bindings Media Instance
+ *****************************************************************************
+ * Copyright (C) 1998-2008 the VideoLAN team
+ *
+ * Authors: Filippo Carone <filippo@carone.org>
+ *
+ *
+ * $Id $
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+package org.videolan.jvlc;
+
+import java.util.ArrayList;
+import java.util.EnumSet;
+import java.util.List;
+
+import org.videolan.jvlc.event.MediaInstanceCallback;
+import org.videolan.jvlc.event.MediaInstanceListener;
+import org.videolan.jvlc.internal.LibVlc;
+import org.videolan.jvlc.internal.LibVlcEventType;
+import org.videolan.jvlc.internal.LibVlc.LibVlcEventManager;
+import org.videolan.jvlc.internal.LibVlc.LibVlcMediaInstance;
+import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t;
+
+
+public class MediaInstance
+{
+
+    private final LibVlcMediaInstance instance;
+
+    private final LibVlc libvlc;
+
+    private final LibVlcEventManager eventManager;
+
+    private List<MediaInstanceCallback> callbacks = new ArrayList<MediaInstanceCallback>();
+
+    private MediaDescriptor mediaDescriptor;
+
+    MediaInstance(JVLC jvlc, LibVlcMediaInstance instance)
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        this.instance = instance;
+        libvlc = jvlc.getLibvlc();
+        eventManager = libvlc.libvlc_media_instance_event_manager(instance, exception);
+    }
+
+    public MediaInstance(MediaDescriptor mediaDescriptor)
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        libvlc = mediaDescriptor.getLibvlc();
+        instance = libvlc.libvlc_media_instance_new_from_media_descriptor(mediaDescriptor.getInstance(), exception);
+        eventManager = libvlc.libvlc_media_instance_event_manager(instance, exception);
+        this.mediaDescriptor = mediaDescriptor;
+    }
+
+    public MediaDescriptor getMediaDescriptor()
+    {
+        return mediaDescriptor;
+    }
+
+    public void play()
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        libvlc.libvlc_media_instance_play(instance, exception);
+    }
+
+    public void stop()
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        libvlc.libvlc_media_instance_stop(instance, exception);
+    }
+
+    public void pause()
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        libvlc.libvlc_media_instance_pause(instance, exception);
+    }
+
+    public long getLength()
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        return libvlc.libvlc_media_instance_get_length(instance, exception);
+    }
+
+    public long getTime()
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        return libvlc.libvlc_media_instance_get_time(instance, exception);
+    }
+
+    public void setTime(long time)
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        libvlc.libvlc_media_instance_set_time(instance, time, exception);
+    }
+
+    public float getPosition()
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        return libvlc.libvlc_media_instance_get_position(instance, exception);
+    }
+
+    public void setPosition(float position)
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        libvlc.libvlc_media_instance_set_position(instance, position, exception);
+    }
+
+    public boolean willPlay()
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        return (libvlc.libvlc_media_instance_will_play(instance, exception) == 1);
+    }
+
+    public float getRate()
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        return libvlc.libvlc_media_instance_get_rate(instance, exception);
+    }
+
+    public void setRate(float rate)
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        libvlc.libvlc_media_instance_set_rate(instance, rate, exception);
+    }
+
+    public boolean hasVideoOutput()
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        return (libvlc.libvlc_media_instance_has_vout(instance, exception) == 1);
+    }
+
+    public float getFPS()
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        return libvlc.libvlc_media_instance_get_fps(instance, exception);
+    }
+
+    public void addListener(final MediaInstanceListener listener)
+    {
+        MediaInstanceCallback callback = new MediaInstanceCallback(this, listener);
+        libvlc_exception_t exception = new libvlc_exception_t();
+        for (LibVlcEventType event : EnumSet.range(
+            LibVlcEventType.libvlc_MediaInstancePlayed,
+            LibVlcEventType.libvlc_MediaInstanceTimeChanged))
+        {
+            libvlc.libvlc_event_attach(eventManager, event.ordinal(), callback, null, exception);
+        }
+        callbacks.add(callback);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected void finalize() throws Throwable
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        for (MediaInstanceCallback callback : callbacks)
+        {
+            for (LibVlcEventType event : EnumSet.range(
+                LibVlcEventType.libvlc_MediaInstancePlayed,
+                LibVlcEventType.libvlc_MediaInstancePositionChanged))
+            {
+                libvlc.libvlc_event_detach(eventManager, event.ordinal(), callback, null, exception);
+            }
+        }
+        libvlc.libvlc_media_instance_release(instance);
+        super.finalize();
+    }
+
+    /**
+     * Returns the instance.
+     * @return the instance
+     */
+    LibVlcMediaInstance getInstance()
+    {
+        return instance;
+    }
+
+}
diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/MediaList.java b/bindings/java/core/src/main/java/org/videolan/jvlc/MediaList.java
new file mode 100644 (file)
index 0000000..bef31c4
--- /dev/null
@@ -0,0 +1,115 @@
+/*****************************************************************************
+ * MediaList.java: VLC Java Bindings, MediaList
+ *****************************************************************************
+ * Copyright (C) 1998-2008 the VideoLAN team
+ *
+ * Authors: Filippo Carone <filippo@carone.org>
+ *
+ *
+ * $Id $
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+package org.videolan.jvlc;
+
+import org.videolan.jvlc.internal.LibVlc.LibVlcEventManager;
+import org.videolan.jvlc.internal.LibVlc.LibVlcMediaDescriptor;
+import org.videolan.jvlc.internal.LibVlc.LibVlcMediaList;
+import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t;
+
+
+public class MediaList
+{
+
+    private final JVLC jvlc;
+
+    private final LibVlcMediaList instance;
+
+    private final LibVlcEventManager eventManager;
+
+    public MediaList(JVLC jvlc)
+    {
+        this.jvlc = jvlc;
+        libvlc_exception_t exception = new libvlc_exception_t();
+        instance = jvlc.getLibvlc().libvlc_media_list_new(jvlc.getInstance(), exception);
+        eventManager = jvlc.getLibvlc().libvlc_media_list_event_manager(instance, exception);
+    }
+
+    public void addMedia(String media)
+    {
+        MediaDescriptor descriptor = new MediaDescriptor(jvlc, media);
+        addMediaDescriptor(descriptor);
+    }
+
+    public void addMediaDescriptor(MediaDescriptor descriptor)
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        jvlc.getLibvlc().libvlc_media_list_add_media_descriptor(instance, descriptor.getInstance(), exception);
+    }
+
+    public int itemsCount()
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        return jvlc.getLibvlc().libvlc_media_list_count(instance, exception);
+    }
+
+    public int indexOf(MediaDescriptor descriptor)
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        return jvlc.getLibvlc().libvlc_media_list_index_of_item(instance, descriptor.getInstance(), exception);
+    }
+
+    public MediaDescriptor getMediaDescriptorAtIndex(int index)
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        LibVlcMediaDescriptor descriptor = jvlc.getLibvlc().libvlc_media_list_item_at_index(instance, index, exception);
+        return new MediaDescriptor(jvlc, descriptor);
+    }
+
+    public void remove(int index)
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        jvlc.getLibvlc().libvlc_media_list_remove_index(instance, index, exception);
+    }
+
+    public void insertMediaDescriptor(MediaDescriptor descriptor, int index)
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        jvlc
+            .getLibvlc()
+            .libvlc_media_list_insert_media_descriptor(instance, descriptor.getInstance(), index, exception);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected void finalize() throws Throwable
+    {
+        jvlc.getLibvlc().libvlc_media_list_release(instance);
+        super.finalize();
+    }
+
+    /**
+     * Returns the instance.
+     * @return the instance
+     */
+    LibVlcMediaList getInstance()
+    {
+        return instance;
+    }
+
+}
diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/MediaListPlayer.java b/bindings/java/core/src/main/java/org/videolan/jvlc/MediaListPlayer.java
new file mode 100644 (file)
index 0000000..28bda15
--- /dev/null
@@ -0,0 +1,105 @@
+/*****************************************************************************
+ * MediaListPlayer.java: VLC Java Bindings, MediaList player
+ *****************************************************************************
+ * Copyright (C) 1998-2008 the VideoLAN team
+ *
+ * Authors: Filippo Carone <filippo@carone.org>
+ *
+ *
+ * $Id $
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+package org.videolan.jvlc;
+
+import org.videolan.jvlc.internal.LibVlc.LibVlcMediaListPlayer;
+import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t;
+
+
+public class MediaListPlayer
+{
+
+    private final LibVlcMediaListPlayer instance;
+
+    private final JVLC jvlc;
+
+    public MediaListPlayer(JVLC jvlc)
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        this.jvlc = jvlc;
+        instance = jvlc.getLibvlc().libvlc_media_list_player_new(jvlc.getInstance(), exception);
+    }
+
+    public void setMediaList(MediaList list)
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        jvlc.getLibvlc().libvlc_media_list_player_set_media_list(instance, list.getInstance(), exception);
+    }
+
+    public boolean isPlaying()
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        return jvlc.getLibvlc().libvlc_media_list_player_is_playing(instance, exception) == 1;
+    }
+
+    public void play()
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        jvlc.getLibvlc().libvlc_media_list_player_play(instance, exception);
+    }
+
+    public void stop()
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        jvlc.getLibvlc().libvlc_media_list_player_stop(instance, exception);
+    }
+
+    public void pause()
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        jvlc.getLibvlc().libvlc_media_list_player_pause(instance, exception);
+    }
+
+    
+    public void playItem(MediaDescriptor descriptor)
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        jvlc.getLibvlc().libvlc_media_list_player_play_item(instance, descriptor.getInstance(), exception);
+    }
+
+    public void playItem(int index)
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        jvlc.getLibvlc().libvlc_media_list_player_play_item_at_index(instance, index, exception);
+    }
+    
+    public void setMediaInstance(MediaInstance mediaInstance)
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        jvlc.getLibvlc().libvlc_media_list_player_set_media_instance(instance, mediaInstance.getInstance(), exception);        
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected void finalize() throws Throwable
+    {
+        jvlc.getLibvlc().libvlc_media_list_player_release(instance);
+        super.finalize();
+    }
+
+}
diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/Playlist.java b/bindings/java/core/src/main/java/org/videolan/jvlc/Playlist.java
new file mode 100644 (file)
index 0000000..140dc36
--- /dev/null
@@ -0,0 +1,126 @@
+ /*****************************************************************************
+ * Playlist.java: PlaylistIntf implementation class
+ *****************************************************************************
+ *
+ * Copyright (C) 1998-2008 the VideoLAN team
+ * 
+ * Author: Filippo Carone <filippo@carone.org>
+ *
+ * Created on 28-feb-2006
+ *
+ * $Id: Playlist.java 17089 2006-10-15 10:54:15Z littlejohn $
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * 
+ */
+
+
+package org.videolan.jvlc;
+
+import org.videolan.jvlc.internal.LibVlc;
+import org.videolan.jvlc.internal.LibVlc.LibVlcInstance;
+import org.videolan.jvlc.internal.LibVlc.LibVlcMediaInstance;
+import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t;
+
+/**
+ * The playlist is deprecated and will be removed. Use MediaList and MediaListPlayer instead.
+ */
+@Deprecated
+public class Playlist {
+    
+    
+    private final LibVlcInstance libvlcInstance;
+    private final LibVlc libvlc;
+    private final JVLC jvlc;
+
+    public Playlist(JVLC jvlc) {
+        this.jvlc = jvlc;
+        this.libvlcInstance = jvlc.getInstance();
+        this.libvlc = jvlc.getLibvlc();
+    }
+    
+    public synchronized void play(int id, String[] options) throws VLCException {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        libvlc.libvlc_playlist_play(libvlcInstance, id, options.length, options, exception);
+    }
+
+    public synchronized void play() throws VLCException {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        libvlc.libvlc_playlist_play(libvlcInstance, -1, 0, new String[] {}, exception);
+    }
+
+    public synchronized void togglePause() throws VLCException {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        libvlc.libvlc_playlist_pause(libvlcInstance, exception);
+    }
+
+    public synchronized void stop() throws VLCException {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        libvlc.libvlc_playlist_stop(libvlcInstance, exception);
+    }
+
+    public boolean isRunning() throws VLCException {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        return libvlc.libvlc_playlist_isplaying(libvlcInstance, exception) == 0? false : true;
+    }
+
+    public synchronized int itemsCount() throws VLCException {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        return libvlc.libvlc_playlist_items_count(libvlcInstance, exception);
+    }
+
+    public synchronized void next() throws VLCException {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        if (! isRunning())
+            play();
+        libvlc.libvlc_playlist_next(libvlcInstance, exception);
+    }
+
+    public synchronized void prev() throws VLCException {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        if (! isRunning())
+            play();
+        libvlc.libvlc_playlist_prev(libvlcInstance, exception);
+    }
+
+    public synchronized void clear() throws VLCException {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        libvlc.libvlc_playlist_clear(libvlcInstance, exception);
+    }
+    
+    public synchronized int add(String uri, String name) throws VLCException {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        return libvlc.libvlc_playlist_add(libvlcInstance, uri, name, exception);
+    }
+
+
+    public synchronized void deleteItem(int itemID) throws VLCException {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        libvlc.libvlc_playlist_delete_item(libvlcInstance, itemID, exception);
+    }
+    
+    public synchronized void setLoop(boolean loop) {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        libvlc.libvlc_playlist_loop(libvlcInstance, loop? 1 : 0, exception);
+    }
+    
+    public MediaInstance getMediaInstance()
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        LibVlcMediaInstance mi = libvlc.libvlc_playlist_get_media_instance(libvlcInstance, exception);
+        return new MediaInstance(jvlc, mi);
+        
+    }
+}
diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/VLCException.java b/bindings/java/core/src/main/java/org/videolan/jvlc/VLCException.java
new file mode 100644 (file)
index 0000000..e239e98
--- /dev/null
@@ -0,0 +1,46 @@
+/*****************************************************************************
+ * JVLC.java: Main Java Class, represents a libvlc_instance_t object
+ *****************************************************************************
+ *
+ * Copyright (C) 1998-2006 the VideoLAN team
+ * 
+ * Author: Philippe Morin <phmorin@free.fr>
+ *
+ * Created on 18-jul-2006
+ *
+ * $Id $
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * 
+ */
+
+package org.videolan.jvlc;
+
+import java.lang.Exception;
+
+public class VLCException extends Exception {
+       public VLCException() {
+          super();
+       }
+       public VLCException(String message) {
+          super(message);
+       }
+       public VLCException(String message,Throwable cause) {
+          super(message,cause);
+       }
+       public VLCException(Throwable cause) {
+          super(cause);
+       }
+}
diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/Video.java b/bindings/java/core/src/main/java/org/videolan/jvlc/Video.java
new file mode 100644 (file)
index 0000000..4020830
--- /dev/null
@@ -0,0 +1,137 @@
+/*****************************************************************************
+ * Video.java: JVLC Video Output
+ *****************************************************************************
+ *
+ * Copyright (C) 1998-2008 the VideoLAN team
+ * 
+ * Author: Filippo Carone <filippo@carone.org>
+ *         Philippe Morin <phmorin@free.fr>
+ *
+ * Created on 28-feb-2006
+ *
+ * $Id: JVLC.java 20141 2007-05-16 19:31:35Z littlejohn $
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * 
+ */
+package org.videolan.jvlc;
+
+import java.awt.Dimension;
+
+import org.videolan.jvlc.internal.LibVlc;
+import org.videolan.jvlc.internal.LibVlc.LibVlcInstance;
+import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t;
+
+public class Video
+{
+       
+       private final LibVlcInstance libvlcInstance;
+       
+    private final LibVlc libvlc;
+    
+       public Video( JVLC jvlc) {
+               this.libvlcInstance = jvlc.getInstance();
+               this.libvlc = jvlc.getLibvlc();
+       }
+
+       /* (non-Javadoc)
+        * @see org.videolan.jvlc.VideoIntf#destroyVideo()
+        */
+       public void destroyVideo(MediaInstance media)
+       {
+               libvlc_exception_t exception = new libvlc_exception_t();
+        libvlc.libvlc_video_destroy(media.getInstance(), exception );
+               
+       }
+
+       /* (non-Javadoc)
+        * @see org.videolan.jvlc.VideoIntf#getFullscreen()
+        */
+       public boolean getFullscreen(MediaInstance media)  {
+           libvlc_exception_t exception = new libvlc_exception_t();
+           return libvlc.libvlc_get_fullscreen(media.getInstance(), exception) == 1 ? true : false;
+       }
+
+       /* (non-Javadoc)
+        * @see org.videolan.jvlc.VideoIntf#getSnapshot(java.lang.String)
+        */
+       public void getSnapshot(MediaInstance media, String filepath, int width, int height)  {
+           libvlc_exception_t exception = new libvlc_exception_t();
+           libvlc.libvlc_video_take_snapshot(media.getInstance(), filepath, width, height, exception);
+       }
+
+       /* (non-Javadoc)
+        * @see org.videolan.jvlc.VideoIntf#getVideoHeight()
+        */
+       public int getHeight(MediaInstance media)  {
+           libvlc_exception_t exception = new libvlc_exception_t();
+           return libvlc.libvlc_video_get_height(media.getInstance(), exception);
+       }
+
+       /* (non-Javadoc)
+        * @see org.videolan.jvlc.VideoIntf#getVideoWidth()
+        */
+       public int getWidth(MediaInstance media)  {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        return libvlc.libvlc_video_get_height(media.getInstance(), exception);
+       }
+
+       /* (non-Javadoc)
+        * @see org.videolan.jvlc.VideoIntf#reparentVideo(java.awt.Component)
+        */
+       public void reparent(MediaInstance media, java.awt.Canvas canvas)  {
+           libvlc_exception_t exception = new libvlc_exception_t();
+        long drawable = com.sun.jna.Native.getComponentID(canvas);
+           libvlc.libvlc_video_reparent(media.getInstance(), drawable, exception);
+       }
+
+       /* (non-Javadoc)
+        * @see org.videolan.jvlc.VideoIntf#resizeVideo(int, int)
+        */
+       public void setSize(int width, int height)  {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        libvlc.libvlc_video_set_size(libvlcInstance, width, height, exception);
+       }
+
+       /* (non-Javadoc)
+        * @see org.videolan.jvlc.VideoIntf#setFullscreen(boolean)
+        */
+       public void setFullscreen(MediaInstance media, boolean fullscreen)  {
+           libvlc_exception_t exception = new libvlc_exception_t();
+           libvlc.libvlc_set_fullscreen(media.getInstance(), fullscreen? 1 : 0, exception);
+       }
+
+       /* (non-Javadoc)
+        * @see org.videolan.jvlc.VideoIntf#toggleFullscreen()
+        */
+       public void toggleFullscreen(MediaInstance media)  {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        libvlc.libvlc_toggle_fullscreen(media.getInstance(), exception);
+       }
+       
+       /* (non-Javadoc)
+        * @see org.videolan.jvlc.VideoIntf#getSize()
+        */
+       public Dimension getSize(MediaInstance media)  {
+               return new Dimension (getWidth(media), getHeight(media));
+       }
+
+       /* (non-Javadoc)
+        * @see org.videolan.jvlc.VideoIntf#setSize(java.awt.Dimension)
+        */
+       public void setSize(Dimension d)  {
+               setSize(d.width, d.height);
+       }
+}
diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/event/MediaInstanceCallback.java b/bindings/java/core/src/main/java/org/videolan/jvlc/event/MediaInstanceCallback.java
new file mode 100644 (file)
index 0000000..c5f5329
--- /dev/null
@@ -0,0 +1,83 @@
+/*****************************************************************************
+ * MediaInstancePlayCallback.java: VLC Java Bindings
+ *****************************************************************************
+ * Copyright (C) 1998-2008 the VideoLAN team
+ *
+ * Authors: Filippo Carone <filippo@carone.org>
+ *
+ *
+ * $Id $
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+package org.videolan.jvlc.event;
+
+import org.videolan.jvlc.MediaInstance;
+import org.videolan.jvlc.internal.LibVlc;
+import org.videolan.jvlc.internal.LibVlcEventType;
+import org.videolan.jvlc.internal.LibVlc.LibVlcCallback;
+import org.videolan.jvlc.internal.LibVlc.libvlc_event_t;
+import org.videolan.jvlc.internal.LibVlc.media_instance_time_changed;
+
+import com.sun.jna.Pointer;
+
+
+public class MediaInstanceCallback implements LibVlcCallback
+{
+
+    private MediaInstanceListener listener;
+    private MediaInstance mediaInstance;
+
+    public MediaInstanceCallback(MediaInstance mediaInstance, MediaInstanceListener listener)
+    {
+        this.mediaInstance = mediaInstance;
+        this.listener = listener;
+    }
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void callback(libvlc_event_t libvlc_event, Pointer userData)
+    {
+        if (libvlc_event.type == LibVlcEventType.libvlc_MediaInstancePlayed.ordinal())
+        {
+            listener.played(mediaInstance);
+        }
+        else if (libvlc_event.type == LibVlcEventType.libvlc_MediaInstancePaused.ordinal())
+        {
+            listener.paused(mediaInstance);
+        }
+        else if (libvlc_event.type == LibVlcEventType.libvlc_MediaInstanceReachedEnd.ordinal())
+        {
+            listener.endReached(mediaInstance);
+        }
+        else if (libvlc_event.type == LibVlcEventType.libvlc_MediaInstancePositionChanged.ordinal())
+        {
+            listener.positionChanged(mediaInstance);
+        }
+        else if (libvlc_event.type == LibVlcEventType.libvlc_MediaInstanceTimeChanged.ordinal())
+        {
+            libvlc_event.event_type_specific.setType(LibVlc.media_instance_time_changed.class);
+            LibVlc.media_instance_time_changed timeChanged = (media_instance_time_changed) libvlc_event.event_type_specific
+                .readField("media_instance_time_changed");
+            listener.timeChanged(mediaInstance, timeChanged.new_time);
+        }
+        else
+        {
+            throw new RuntimeException("Unsupported event error. Event id: " + libvlc_event.type);
+        }
+    }
+}
diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/event/MediaInstanceListener.java b/bindings/java/core/src/main/java/org/videolan/jvlc/event/MediaInstanceListener.java
new file mode 100644 (file)
index 0000000..784aa94
--- /dev/null
@@ -0,0 +1,44 @@
+/*****************************************************************************
+ * MediaInstancePlayListener.java: VLC Java Bindings
+ *****************************************************************************
+ * Copyright (C) 1998-2008 the VideoLAN team
+ *
+ * Authors: Filippo Carone <filippo@carone.org>
+ *
+ *
+ * $Id $
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+package org.videolan.jvlc.event;
+
+import org.videolan.jvlc.MediaInstance;
+
+
+public interface MediaInstanceListener
+{
+
+    void played(MediaInstance mediaInstance);
+    
+    void paused(MediaInstance mediaInstance);
+    
+    void endReached(MediaInstance mediaInstance);
+    
+    void timeChanged(MediaInstance mediaInstance, long newTime);
+    
+    void positionChanged(MediaInstance mediaInstance);
+    
+}
diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/example/VLCExample.java b/bindings/java/core/src/main/java/org/videolan/jvlc/example/VLCExample.java
new file mode 100644 (file)
index 0000000..c0597e9
--- /dev/null
@@ -0,0 +1,117 @@
+package org.videolan.jvlc.example;
+
+import org.videolan.jvlc.Audio;
+import org.videolan.jvlc.JVLC;
+import org.videolan.jvlc.MediaDescriptor;
+import org.videolan.jvlc.MediaInstance;
+import org.videolan.jvlc.VLCException;
+import org.videolan.jvlc.Video;
+import org.videolan.jvlc.event.MediaInstanceListener;
+
+
+public class VLCExample
+{
+
+    public static void main(String[] args) throws InterruptedException
+    {
+        System.out.println("== Starting VLCExample ==");
+        if (args.length == 0)
+        {
+            System.out.print("Creating a JVLC instance without args");
+        }
+        else
+        {
+            System.out.println("Creating a JVLC instance with args: ");
+            for (int i = 0; i < args.length; i++)
+            {
+                System.out.println(i + ") " + args[i]);
+            }
+        }
+        JVLC jvlc = new JVLC(args);
+        System.out.println("... done.");
+
+        MediaDescriptor mediaDescriptor = new MediaDescriptor(jvlc, "/home/carone/apps/a.avi");
+        MediaInstance mediaInstance = mediaDescriptor.getMediaInstance();
+
+        mediaInstance.addListener(new MediaInstanceListener()
+        {
+
+            @Override
+            public void endReached(MediaInstance mediaInstance)
+            {
+                System.out.println("Media instance end reached. MRL: " + mediaInstance.getMediaDescriptor().getMrl());
+            }
+
+            @Override
+            public void paused(MediaInstance mediaInstance)
+            {
+                System.out.println("Media instance paused. MRL: " + mediaInstance.getMediaDescriptor().getMrl());
+            }
+
+            @Override
+            public void played(MediaInstance mediaInstance)
+            {
+                System.out.println("Media instance played. MRL: " + mediaInstance.getMediaDescriptor().getMrl());
+            }
+
+            @Override
+            public void positionChanged(MediaInstance mediaInstance)
+            {
+                // TODO Auto-generated method stub
+            }
+
+            @Override
+            public void timeChanged(MediaInstance mediaInstance, long newTime)
+            {
+                System.out.println("new time: " + newTime);
+            }
+        });
+        mediaInstance.play();
+
+        while (!mediaInstance.hasVideoOutput())
+        {
+            Thread.sleep(100);
+        }
+
+        Video video = new Video(jvlc);
+        System.out.print(video.getWidth(mediaInstance));
+        System.out.print("x");
+        System.out.println(video.getHeight(mediaInstance));
+        System.out.print("Fullscreen... ");
+        video.setFullscreen(mediaInstance, true);
+        Thread.sleep(3000);
+        System.out.println("real size.");
+        video.setFullscreen(mediaInstance, false);
+        System.out.print("Taking snapshot... ");
+        video.getSnapshot(mediaInstance, System.getProperty("user.dir") + "/snap.png", 0, 0);
+        System.out.println("taken. (see " + System.getProperty("user.dir") + "/snap.png )");
+        Thread.sleep(2000);
+        System.out.println("Resizing to 300x300");
+        video.setSize(300, 300);
+
+        System.out.print("Muting...");
+        Audio audio = new Audio(jvlc);
+        audio.setMute(true);
+        Thread.sleep(3000);
+        System.out.println("unmuting.");
+        audio.setMute(false);
+        Thread.sleep(3000);
+        System.out.println("Volume is: " + audio.getVolume());
+        System.out.print("Setting volume to 150... ");
+        audio.setVolume(150);
+        System.out.println("done");
+        System.out.println("== AUDIO INFO ==");
+        System.out.println("Audio track number: " + audio.getTrack(mediaInstance));
+        System.out.println("Audio channel info: " + audio.getChannel());
+        Thread.sleep(3000);
+        System.out.println("MEDIA INSTANCE INFORMATION");
+        System.out.println("--------------------------");
+        System.out.println("Total length (ms) :\t" + mediaInstance.getLength());
+        System.out.println("Input time (ms) :\t" + mediaInstance.getTime());
+        System.out.println("Input position [0-1]:\t" + mediaInstance.getPosition());
+        System.out.println("Input FPS :\t" + mediaInstance.getFPS());
+
+        System.out.println("Everything fine ;)");
+        return;
+    }
+}
diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlc.java b/bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlc.java
new file mode 100644 (file)
index 0000000..b8d2015
--- /dev/null
@@ -0,0 +1,484 @@
+/*****************************************************************************
+ * LibVlc.java: VLC Java Bindings JNA Glue
+ *****************************************************************************
+ * Copyright (C) 1998-2008 the VideoLAN team
+ *
+ * Authors: Filippo Carone <filippo@carone.org>
+ *
+ *
+ * $Id $
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+package org.videolan.jvlc.internal;
+
+import com.sun.jna.Callback;
+import com.sun.jna.Library;
+import com.sun.jna.Native;
+import com.sun.jna.NativeLong;
+import com.sun.jna.Pointer;
+import com.sun.jna.PointerType;
+import com.sun.jna.Structure;
+import com.sun.jna.Union;
+
+
+public interface LibVlc extends Library
+{
+
+    LibVlc INSTANCE = (LibVlc) Native.loadLibrary("vlc-control", LibVlc.class);
+    LibVlc SYNC_INSTANCE = (LibVlc) Native.synchronizedLibrary(INSTANCE);
+
+    public static class libvlc_exception_t extends Structure
+    {
+
+        public int raised;
+
+        public int code;
+
+        public String message;
+    }
+
+    public static class libvlc_event_t extends Structure
+    {
+
+        public int type;
+
+        public Pointer obj;
+
+        public event_type_specific event_type_specific;
+
+    }
+
+    public class media_descriptor_meta_changed extends Structure
+    {
+
+        public Pointer meta_type;
+    }
+
+    public class media_descriptor_subitem_added extends Structure
+    {
+
+        public LibVlcMediaDescriptor new_child;
+    }
+
+    public class media_descriptor_duration_changed extends Structure
+    {
+
+        public NativeLong new_duration;
+    }
+
+    public class media_descriptor_preparsed_changed extends Structure
+    {
+
+        public int new_status;
+    }
+
+    public class media_descriptor_freed extends Structure
+    {
+
+        public LibVlcMediaDescriptor md;
+    }
+
+    public class media_descriptor_state_changed extends Structure
+    {
+
+        // @todo: check this one
+        public int new_state;
+    }
+
+    /* media instance */
+
+    public class media_instance_position_changed extends Structure
+    {
+
+        public float new_position;
+    }
+
+    public class media_instance_time_changed extends Structure
+    {
+
+        // @todo: check this one
+        public long new_time;
+    }
+
+    /* media list */
+    public class media_list_item_added extends Structure
+    {
+
+        public LibVlcMediaDescriptor item;
+
+        public int index;
+    }
+
+    public class media_list_will_add_item extends Structure
+    {
+
+        public LibVlcMediaDescriptor item;
+
+        public int index;
+    }
+
+    public class media_list_item_deleted extends Structure
+    {
+        
+        public LibVlcMediaDescriptor item;
+
+        public int index;
+    }
+
+    public class media_list_will_delete_item extends Structure
+    {
+
+        public LibVlcMediaDescriptor item;
+
+        public int index;
+    }
+
+    /* media list view */
+    public class media_list_view_item_added extends Structure
+    {
+
+        public LibVlcMediaDescriptor item;
+
+        public int index;
+    }
+
+    public class media_list_view_will_add_item extends Structure
+    {
+
+        public LibVlcMediaDescriptor item;
+
+        public int index;
+    }
+
+    public class media_list_view_item_deleted extends Structure
+    {
+
+        public LibVlcMediaDescriptor item;
+
+        public int index;
+    }
+
+    public class media_list_view_will_delete_item extends Structure
+    {
+
+        public LibVlcMediaDescriptor item;
+
+        public int index;
+    }
+
+    /* media discoverer */
+    public class media_media_discoverer_started extends Structure
+    {
+
+        public Pointer unused;
+    }
+
+    public class media_media_discoverer_ended extends Structure
+    {
+
+        public Pointer unused;
+    }
+
+    public class event_type_specific extends Union
+    {
+        public media_descriptor_meta_changed media_descriptor_meta_changed;
+        public media_descriptor_subitem_added media_descriptor_subitem_added;
+        public media_descriptor_duration_changed media_descriptor_duration_changed;
+        public media_descriptor_preparsed_changed media_descriptor_preparsed_changed;
+        public media_descriptor_freed media_descriptor_freed;
+        public media_descriptor_state_changed media_descriptor_state_changed;
+        public media_instance_position_changed media_instance_position_changed;
+        public media_instance_time_changed media_instance_time_changed;
+        public media_list_item_added media_list_item_added;
+        public media_list_will_add_item media_list_will_add_item;
+        public media_list_item_deleted media_list_item_deleted;
+        public media_list_will_delete_item media_list_will_delete_item;
+        public media_list_view_item_added media_list_view_item_added;
+        public media_list_view_will_add_item media_list_view_will_add_item;
+        public media_list_view_item_deleted media_list_view_item_deleted;
+        public media_list_view_will_delete_item media_list_view_will_delete_item;
+    }
+
+    public class LibVlcInstance extends PointerType
+    {
+    }
+
+    public class LibVlcMediaDescriptor extends PointerType
+    {
+    }
+
+    public class LibVlcMediaInstance extends PointerType
+    {
+    }
+
+    public class LibVlcMediaList extends PointerType
+    {
+    }
+
+    public class LibVlcMediaListPlayer extends PointerType
+    {
+    }
+
+    public class LibVlcEventManager extends PointerType
+    {
+    }
+
+    // exception handling
+    void libvlc_exception_init(libvlc_exception_t exception);
+
+    int libvlc_exception_raised(final libvlc_exception_t exception);
+
+    void libvlc_exception_raise(libvlc_exception_t exception, String format, Object... args);
+
+    void libvlc_exception_clear(libvlc_exception_t exception);
+
+    String libvlc_exception_get_message(libvlc_exception_t exception);
+
+    // core
+    LibVlcInstance libvlc_new(int argc, String[] argv, libvlc_exception_t exception);
+
+    void libvlc_release(LibVlcInstance libvlc_instance_t);
+
+    // video
+
+    void libvlc_video_set_parent(LibVlcInstance libvlc_instance, long drawable, libvlc_exception_t exception);
+
+    void libvlc_toggle_fullscreen(LibVlcMediaInstance libvlc_instance);
+
+    void libvlc_set_fullscreen(LibVlcMediaInstance instance, int fullscreen, libvlc_exception_t exception);
+
+    int libvlc_get_fullscreen(LibVlcMediaInstance instance, libvlc_exception_t exception);
+
+    int libvlc_video_get_height(LibVlcMediaInstance instance, libvlc_exception_t exception);
+
+    int libvlc_video_get_width(LibVlcMediaInstance instance, libvlc_exception_t exception);
+
+    String libvlc_video_get_aspect_ration(LibVlcMediaInstance instance, libvlc_exception_t exception);
+
+    void libvlc_video_set_aspect_ration(LibVlcMediaInstance instance, String ratio, libvlc_exception_t exception);
+
+    int libvlc_video_get_spu(LibVlcMediaInstance instance, libvlc_exception_t exception);
+
+    int libvlc_video_set_spu(LibVlcMediaInstance instance, int spu, libvlc_exception_t exception);
+
+    String libvlc_video_get_crop_geometry(LibVlcMediaInstance instance, libvlc_exception_t exception);
+
+    void libvlc_video_set_crop_geometry(LibVlcMediaInstance instance, String geometry, libvlc_exception_t exception);
+
+    void libvlc_video_take_snapshot(LibVlcMediaInstance instance, String filename, int width, int height,
+        libvlc_exception_t exception);
+
+    void libvlc_video_destroy(LibVlcMediaInstance instance, libvlc_exception_t exception);
+
+    void libvlc_video_resize(LibVlcMediaInstance instance, int width, int height, libvlc_exception_t exception);
+
+    void libvlc_video_reparent(LibVlcMediaInstance instance, long drawable, libvlc_exception_t exception);
+
+    void libvlc_video_set_size(LibVlcInstance instance, int width, int height, libvlc_exception_t exception);
+
+    // audio
+
+    void libvlc_audio_toggle_mute(LibVlcInstance instance, libvlc_exception_t exception);
+
+    void libvlc_audio_set_mute(LibVlcInstance instance, int mute, libvlc_exception_t exception);
+
+    int libvlc_audio_get_mute(LibVlcInstance instance, libvlc_exception_t exception);
+
+    int libvlc_audio_get_volume(LibVlcInstance instance, libvlc_exception_t exception);
+
+    int libvlc_audio_set_volume(LibVlcInstance instance, int volume, libvlc_exception_t exception);
+
+    int libvlc_audio_get_track_count(LibVlcMediaInstance mediaInstance,  libvlc_exception_t exception );
+
+    int libvlc_audio_get_track(LibVlcMediaInstance mediaInstance, libvlc_exception_t exception );
+    
+    void libvlc_audio_set_track(LibVlcMediaInstance mediaInstance, int channel, libvlc_exception_t exception);
+    
+    int libvlc_audio_get_channel(LibVlcInstance instance, libvlc_exception_t exception );
+    
+    void libvlc_audio_set_channel(LibVlcInstance instance, int channel, libvlc_exception_t exception);
+    
+    // playlist
+
+    void libvlc_playlist_loop(LibVlcInstance instance, int loop, libvlc_exception_t exception);
+
+    void libvlc_playlist_play(LibVlcInstance instance, int itemIndex, int optionsCount, String[] options,
+        libvlc_exception_t exception);
+
+    void libvlc_playlist_pause(LibVlcInstance instance, libvlc_exception_t exception);
+
+    void libvlc_playlist_stop(LibVlcInstance instance, libvlc_exception_t exception);
+
+    int libvlc_playlist_isplaying(LibVlcInstance instance, libvlc_exception_t exception);
+
+    int libvlc_playlist_items_count(LibVlcInstance instance, libvlc_exception_t exception);
+
+    void libvlc_playlist_next(LibVlcInstance instance, libvlc_exception_t exception);
+
+    void libvlc_playlist_prev(LibVlcInstance instance, libvlc_exception_t exception);
+
+    void libvlc_playlist_clear(LibVlcInstance instance, libvlc_exception_t exception);
+
+    int libvlc_playlist_add(LibVlcInstance instance, String uri, String name, libvlc_exception_t exception);
+
+    int libvlc_playlist_delete_item(LibVlcInstance instance, int itemIndex, libvlc_exception_t exception);
+
+    LibVlcMediaInstance libvlc_playlist_get_media_instance(LibVlcInstance instance, libvlc_exception_t exception);
+
+    int libvlc_media_instance_is_seekable(LibVlcMediaInstance instance, libvlc_exception_t exception);
+
+    int libvlc_media_instance_can_pause(LibVlcMediaInstance instance, libvlc_exception_t exception);
+
+    // media descriptor
+
+    LibVlcMediaDescriptor libvlc_media_descriptor_new(LibVlcInstance libvlc_instance, String mrl,
+        libvlc_exception_t exception);
+
+    void libvlc_media_descriptor_add_option(LibVlcMediaDescriptor media_descriptor, String option,
+        libvlc_exception_t exception);
+
+    String libvlc_media_descriptor_get_mrl(LibVlcMediaDescriptor media_descriptor);
+
+    void libvlc_media_descriptor_release(LibVlcMediaDescriptor media_descriptor);
+
+    LibVlcEventManager libvlc_media_descriptor_event_manager(LibVlcMediaDescriptor media_descriptor,
+        libvlc_exception_t exception);
+
+    // media instance
+
+    LibVlcMediaInstance libvlc_media_instance_new(LibVlcInstance instance, libvlc_exception_t exception);
+
+    LibVlcMediaInstance libvlc_media_instance_new_from_media_descriptor(LibVlcMediaDescriptor media_descriptor,
+        libvlc_exception_t exception);
+
+    void libvlc_media_instance_play(LibVlcMediaInstance media_instance, libvlc_exception_t exception);
+
+    void libvlc_media_instance_pause(LibVlcMediaInstance media_instance, libvlc_exception_t exception);
+
+    void libvlc_media_instance_stop(LibVlcMediaInstance media_instance, libvlc_exception_t exception);
+
+    void libvlc_media_instance_set_drawable(LibVlcMediaInstance libvlc_media_instance, long drawable,
+        libvlc_exception_t exception);
+
+    long libvlc_media_instance_get_length(LibVlcMediaInstance instance, libvlc_exception_t exception);
+
+    long libvlc_media_instance_get_time(LibVlcMediaInstance instance, libvlc_exception_t exception);
+
+    void libvlc_media_instance_set_time(LibVlcMediaInstance instance, long time, libvlc_exception_t exception);
+
+    float libvlc_media_instance_get_position(LibVlcMediaInstance instance, libvlc_exception_t exception);
+
+    void libvlc_media_instance_set_position(LibVlcMediaInstance instance, float position, libvlc_exception_t exception);
+
+    int libvlc_media_instance_will_play(LibVlcMediaInstance instance, libvlc_exception_t exception);
+
+    void libvlc_media_instance_set_rate(LibVlcMediaInstance instance, float rate, libvlc_exception_t exception);
+
+    float libvlc_media_instance_get_rate(LibVlcMediaInstance instance, libvlc_exception_t exception);
+
+    int libvlc_media_instance_has_vout(LibVlcMediaInstance instance2, libvlc_exception_t exception);
+
+    float libvlc_media_instance_get_fps(LibVlcMediaInstance instance2, libvlc_exception_t exception);
+
+    void libvlc_media_instance_release(LibVlcMediaInstance instance);
+
+    LibVlcEventManager libvlc_media_instance_event_manager(LibVlcMediaInstance media_instance,
+        libvlc_exception_t exception);
+
+    // media list
+
+    LibVlcMediaList libvlc_media_list_new(LibVlcInstance libvlc_instance, libvlc_exception_t exception);
+
+    void libvlc_media_list_release(LibVlcMediaList libVlcMediaList);
+
+    void libvlc_media_list_add_file_content(LibVlcMediaList libvlc_media_list, String fileName,
+        libvlc_exception_t exception);
+
+    void libvlc_media_list_set_media_descriptor(LibVlcMediaList libvlc_media_list,
+        LibVlcMediaDescriptor libvlc_media_descriptor, libvlc_exception_t exception);
+
+    LibVlcMediaDescriptor libvlc_media_list_media_descriptor(LibVlcMediaList libvlc_media_list,
+        libvlc_exception_t exception);
+
+    void libvlc_media_list_add_media_descriptor(LibVlcMediaList libvlc_media_list,
+        LibVlcMediaDescriptor libvlc_media_descriptor, libvlc_exception_t exception);
+
+    void libvlc_media_list_insert_media_descriptor(LibVlcMediaList libvlc_media_list,
+        LibVlcMediaDescriptor libvlc_media_descriptor, int position, libvlc_exception_t exception);
+
+    void libvlc_media_list_remove_index(LibVlcMediaList libvlc_media_list, int position, libvlc_exception_t exception);
+
+    int libvlc_media_list_count(LibVlcMediaList libvlc_media_list, libvlc_exception_t exception);
+
+    LibVlcMediaDescriptor libvlc_media_list_item_at_index(LibVlcMediaList libvlc_media_list, int position,
+        libvlc_exception_t exception);
+
+    int libvlc_media_list_index_of_item(LibVlcMediaList libvlc_media_list,
+        LibVlcMediaDescriptor libvlc_media_descriptor, libvlc_exception_t exception);
+
+    int libvlc_media_list_is_readonly(LibVlcMediaList libvlc_media_list);
+
+    LibVlcEventManager libvlc_media_list_event_manager(LibVlcMediaList libvlc_media_list, libvlc_exception_t exception);
+
+    // libvlc_media_list_player
+
+    LibVlcMediaListPlayer libvlc_media_list_player_new(LibVlcInstance libvlc_media_instance,
+        libvlc_exception_t exception);
+
+    void libvlc_media_list_player_release(LibVlcMediaListPlayer libvlc_media_list_player);
+
+    void libvlc_media_list_player_set_media_instance(LibVlcMediaListPlayer libvlc_media_list_player,
+        LibVlcMediaInstance libvlc_media_instance, libvlc_exception_t exception);
+
+    void libvlc_media_list_player_set_media_list(LibVlcMediaListPlayer libvlc_media_list_player,
+        LibVlcMediaList libvlc_media_list, libvlc_exception_t exception);
+
+    void libvlc_media_list_player_play(LibVlcMediaListPlayer libvlc_media_list_player, libvlc_exception_t exception);
+
+    void libvlc_media_list_player_pause(LibVlcMediaListPlayer libvlc_media_list_player, libvlc_exception_t exception);
+
+    int libvlc_media_list_player_is_playing(LibVlcMediaListPlayer libvlc_media_list_player, libvlc_exception_t exception);
+
+    int libvlc_media_list_player_get_state(LibVlcMediaListPlayer libvlc_media_list_player, libvlc_exception_t exception);
+
+    void libvlc_media_list_player_play_item_at_index(LibVlcMediaListPlayer libvlc_media_list_player, int position,
+        libvlc_exception_t exception);
+
+    void libvlc_media_list_player_play_item(LibVlcMediaListPlayer libvlc_media_list_player,
+        LibVlcMediaDescriptor libvlc_media_descriptor, libvlc_exception_t exception);
+
+    void libvlc_media_list_player_stop(LibVlcMediaListPlayer libvlc_media_list_player, libvlc_exception_t exception);
+
+    void libvlc_media_list_player_next(LibVlcMediaListPlayer libvlc_media_list_player, libvlc_exception_t exception);
+
+    // event manager
+
+    public static interface LibVlcCallback extends Callback
+    {
+
+        void callback(libvlc_event_t libvlc_event, Pointer userData);
+    }
+
+    void libvlc_event_attach(LibVlcEventManager event_manager, int event_type, LibVlcCallback callback,
+        Pointer userData, libvlc_exception_t exception);
+
+    void libvlc_event_detach(LibVlcEventManager event_manager, int event_type, LibVlcCallback callback,
+        Pointer userData, libvlc_exception_t excecption);
+
+    void libvlc_toggle_fullscreen(LibVlcMediaInstance instance, libvlc_exception_t exception);
+
+}
diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlcEventType.java b/bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlcEventType.java
new file mode 100644 (file)
index 0000000..776c84b
--- /dev/null
@@ -0,0 +1,43 @@
+/*****************************************************************************
+ * LibVlcEventType.java: VLC Java Bindings event types enum
+ *****************************************************************************
+ * Copyright (C) 1998-2008 the VideoLAN team
+ *
+ * Authors: Filippo Carone <filippo@carone.org>
+ *
+ *
+ * $Id $
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+package org.videolan.jvlc.internal;
+
+
+public enum LibVlcEventType {
+
+    libvlc_MediaDescriptorMetaChanged,
+    libvlc_MediaDescriptorSubItemAdded,
+    libvlc_MediaDescriptorDurationChanged,
+    libvlc_MediaDescriptorPreparsedChanged,
+    libvlc_MediaDescriptorFreed,
+    libvlc_MediaDescriptorStateChanged,
+    libvlc_MediaInstancePlayed,
+    libvlc_MediaInstancePaused,
+    libvlc_MediaInstanceReachedEnd,
+    libvlc_MediaInstanceEncounteredError,
+    libvlc_MediaInstanceTimeChanged,
+    libvlc_MediaInstancePositionChanged;
+}
diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlcImpl.java b/bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlcImpl.java
new file mode 100644 (file)
index 0000000..39dbf0d
--- /dev/null
@@ -0,0 +1,125 @@
+/*****************************************************************************
+ * ${file_name}: VLC Java Bindings
+ *****************************************************************************
+ * Copyright (C) 1998-2007 the VideoLAN team
+ *
+ * Authors: Filippo Carone <filippo@carone.org>
+ *
+ *
+ * $Id $
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+package org.videolan.jvlc.internal;
+
+import java.awt.Canvas;
+import java.awt.Component;
+
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+
+import org.videolan.jvlc.internal.LibVlc.LibVlcCallback;
+import org.videolan.jvlc.internal.LibVlc.LibVlcEventManager;
+import org.videolan.jvlc.internal.LibVlc.LibVlcInstance;
+import org.videolan.jvlc.internal.LibVlc.LibVlcMediaDescriptor;
+import org.videolan.jvlc.internal.LibVlc.LibVlcMediaInstance;
+import org.videolan.jvlc.internal.LibVlc.libvlc_event_t;
+import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t;
+
+import com.sun.jna.Pointer;
+
+
+public class LibVlcImpl
+{
+
+    public static boolean done;
+
+    public static void main(String[] args) throws InterruptedException
+    {
+        LibVlc libVlc = LibVlc.INSTANCE;
+        libvlc_exception_t exception = new libvlc_exception_t();
+        libVlc.libvlc_exception_init(exception);
+
+        final Object lock = new Object();
+
+        System.out.println("Starting vlc");
+        LibVlcInstance libvlc_instance_t = libVlc.libvlc_new(0, new String[] {"/usr/local/bin/vlc"}, exception);
+
+        LibVlcMediaDescriptor mediaDescriptor = libVlc
+            .libvlc_media_descriptor_new(libvlc_instance_t, "/home/carone/a.avi", exception);
+
+        LibVlcMediaInstance mediaInstance = libVlc.libvlc_media_instance_new_from_media_descriptor(mediaDescriptor, exception);
+
+        LibVlcEventManager mediaInstanceEventManager = libVlc.libvlc_media_instance_event_manager(mediaInstance, exception);
+
+        LibVlcCallback played = new LibVlcCallback()
+        {
+
+            @Override
+            public void callback(libvlc_event_t libvlc_event_t, Pointer pointer)
+            {
+                System.out.println("Playing started.");
+            }
+        };
+
+        LibVlcCallback endReached = new LibVlcCallback()
+        {
+
+            @Override
+            public void callback(libvlc_event_t libvlc_event_t, Pointer pointer)
+            {
+                synchronized (lock)
+                {
+                    System.out.println("Playing finished.");
+                    LibVlcImpl.done = true;
+                }
+            }
+        };
+
+        libVlc.libvlc_event_attach(
+            mediaInstanceEventManager,
+            LibVlcEventType.libvlc_MediaInstancePlayed.ordinal(),
+            played,
+            null,
+            exception);
+
+        libVlc.libvlc_event_attach(
+            mediaInstanceEventManager,
+            LibVlcEventType.libvlc_MediaInstanceReachedEnd.ordinal(),
+            endReached,
+            null,
+            exception);
+        
+        JFrame frame = new JFrame("title");
+        frame.setVisible(true);
+        frame.setLocation(100, 100);
+        frame.setSize(500, 500);
+        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        
+        JPanel panel = new JPanel();
+        Canvas canvas = new Canvas();
+        canvas.setSize(500, 500);
+        panel.add(canvas);
+        frame.getContentPane().add(panel);
+        frame.pack();
+        
+        long drawable = com.sun.jna.Native.getComponentID(canvas);
+        
+        libVlc.libvlc_video_set_parent(libvlc_instance_t, drawable, exception);
+
+        libVlc.libvlc_media_instance_play(mediaInstance, exception);
+    }
+}
diff --git a/bindings/java/core/src/main/resources/.gitignore b/bindings/java/core/src/main/resources/.gitignore
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcCoreTest.java b/bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcCoreTest.java
new file mode 100644 (file)
index 0000000..38da716
--- /dev/null
@@ -0,0 +1,56 @@
+/*****************************************************************************
+ * LibVlcCoreTest.java: VLC Java Bindings
+ *****************************************************************************
+ * Copyright (C) 1998-2008 the VideoLAN team
+ *
+ * Authors: Filippo Carone <filippo@carone.org>
+ *
+ *
+ * $Id $
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+package org.videolan.jvlc.internal;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.videolan.jvlc.internal.LibVlc.LibVlcInstance;
+import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t;
+
+
+public class LibVlcCoreTest
+{
+
+    private LibVlc instance = LibVlc.INSTANCE;
+    
+    @Test
+    public void testNew() throws Exception
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        LibVlcInstance libvlcInstance = instance.libvlc_new(0, new String[] {}, exception);
+        Assert.assertNotNull(libvlcInstance);
+        Assert.assertEquals(0, exception.raised);
+    }
+    
+    @Test
+    public void testRelease() throws Exception
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        LibVlcInstance libvlcInstance = instance.libvlc_new(0, new String[] {}, exception);
+        instance.libvlc_release(libvlcInstance);
+    }
+    
+}
diff --git a/bindings/java/core/src/test/java/org/videolan/jvlc/internal/MediaListTest.java b/bindings/java/core/src/test/java/org/videolan/jvlc/internal/MediaListTest.java
new file mode 100644 (file)
index 0000000..d68e194
--- /dev/null
@@ -0,0 +1,77 @@
+/*****************************************************************************
+ * MediaListTest.java: VLC Java Bindings
+ *****************************************************************************
+ * Copyright (C) 1998-2008 the VideoLAN team
+ *
+ * Authors: Filippo Carone <filippo@carone.org>
+ *
+ *
+ * $Id $
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+package org.videolan.jvlc.internal;
+
+import junit.framework.Assert;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.videolan.jvlc.internal.LibVlc.LibVlcInstance;
+import org.videolan.jvlc.internal.LibVlc.LibVlcMediaDescriptor;
+import org.videolan.jvlc.internal.LibVlc.LibVlcMediaList;
+import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t;
+
+
+
+public class MediaListTest
+{
+    private LibVlc libvlc = LibVlc.INSTANCE;
+    private LibVlcInstance libvlcInstance;
+    
+    @Before
+    public void testSetup()
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        libvlcInstance = libvlc.libvlc_new(0, new String[] {}, exception );
+    }
+    
+    @After
+    public void tearDown()
+    {
+        libvlc.libvlc_release(libvlcInstance);
+    }
+    
+    @Test
+    public void mediaListNew()
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        LibVlcMediaList mediaList = libvlc.libvlc_media_list_new(libvlcInstance, exception);
+        Assert.assertNotNull(mediaList);
+        Assert.assertEquals(0, exception.raised);
+    }
+    
+    @Test
+    public void mediaListAddMediaDescriptor()
+    {
+        libvlc_exception_t exception = new libvlc_exception_t();
+        LibVlcMediaList mediaList = libvlc.libvlc_media_list_new(libvlcInstance, exception);
+        String mrl = this.getClass().getResource("/raffa_voice.ogg").getPath();
+        LibVlcMediaDescriptor libvlc_media_descriptor = libvlc.libvlc_media_descriptor_new(libvlcInstance, mrl, exception);
+        libvlc.libvlc_media_list_add_media_descriptor(mediaList, libvlc_media_descriptor , exception);
+        Assert.assertEquals(0, exception.raised);
+    }
+}
diff --git a/bindings/java/core/src/test/resources/raffa_voice.ogg b/bindings/java/core/src/test/resources/raffa_voice.ogg
new file mode 100644 (file)
index 0000000..019f364
Binary files /dev/null and b/bindings/java/core/src/test/resources/raffa_voice.ogg differ
index 8b7c394..5cc7f05 100644 (file)
@@ -2,48 +2,19 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd ">
   <modelVersion>4.0.0</modelVersion>
   <groupId>org.videolan</groupId>
-  <artifactId>jvlc</artifactId>
-  <packaging>jar</packaging>
+  <artifactId>jvlc-parent</artifactId>
+  <packaging>pom</packaging>
   <name>JVLC</name>
   <description>Java Bindings for VideoLAN</description>
   <version>0.9.0-SNAPSHOT</version>
-   <build>
-    <plugins>
-      <plugin>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.6</source>
-          <target>1.6</target>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
   <licenses>
-       <license>
-               <name>GPLv2</name>
-               <url>http://www.gnu.org/licenses/old-licenses/gpl-2.0.html</url>
-       </license>
+    <license>
+      <name>GPLv2</name>
+      <url>http://www.gnu.org/licenses/old-licenses/gpl-2.0.html</url>
+    </license>
   </licenses>
-  <dependencies>
-    <dependency>
-      <groupId>com.jna</groupId>
-      <artifactId>jna</artifactId>
-      <version>3.0.2</version>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>4.4</version>
-      <scope>test</scope>
-    </dependency>
-  </dependencies>
-  <repositories>
-    <repository>
-      <id>jvlc</id>
-      <name>JVLC Maven Repository</name>
-      <url>http://jvlc.ihack.it/maven2</url>
-      <snapshots>
-        <enabled>false</enabled>
-      </snapshots>
-    </repository>
-  </repositories></project>
+  <modules>
+    <module>core</module>
+    <module>samples</module>
+  </modules>
+</project>
diff --git a/bindings/java/samples/client/pom.xml b/bindings/java/samples/client/pom.xml
new file mode 100644 (file)
index 0000000..86f171f
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd ">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.videolan</groupId>
+    <artifactId>jvlc-samples</artifactId>
+    <version>0.9.0-SNAPSHOT</version>
+  </parent>
+  <groupId>org.videolan</groupId>
+  <artifactId>jvlc-samples-client</artifactId>
+  <packaging>jar</packaging>
+  <name>JVLC - Client sample</name>
+  <description>Java Bindings for VideoLAN - Client sample</description>
+  <version>0.9.0-SNAPSHOT</version>
+
+   <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <source>1.6</source>
+          <target>1.6</target>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>exec-maven-plugin</artifactId>
+        <executions>
+          <execution>
+            <goals>
+              <goal>java</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <mainClass>VlcClient</mainClass>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.videolan</groupId>
+      <artifactId>jvlc-core</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+  </dependencies>
+
+</project>
diff --git a/bindings/java/samples/client/src/main/java/VlcClient.java b/bindings/java/samples/client/src/main/java/VlcClient.java
new file mode 100644 (file)
index 0000000..a1b6692
--- /dev/null
@@ -0,0 +1,231 @@
+/*****************************************************************************
+ * VlcClient.java: Sample Swing player
+ *****************************************************************************
+ * Copyright (C) 1998-2006 the VideoLAN team
+ * 
+ * Created on 28-feb-2006
+ *
+ * $Id: AudioIntf.java 8 2006-02-28 12:03:47Z little $
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+ * 
+ */
+
+import java.awt.Canvas;
+import java.awt.Frame;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+
+import javax.swing.JPanel;
+
+import org.videolan.jvlc.JVLC;
+import org.videolan.jvlc.Playlist;
+import org.videolan.jvlc.VLCException;
+
+
+class VLCPlayerFrame extends Frame
+{
+
+    private Playlist playlist;
+
+    public Canvas jvcanvas;
+
+    public VLCPlayerFrame()
+    {
+        initComponents();
+    }
+
+    private void initComponents()
+    {
+
+        java.awt.GridBagConstraints gridBagConstraints;
+
+        fullScreenButton = new javax.swing.JButton();
+        jTextField1 = new javax.swing.JTextField();
+        setButton = new javax.swing.JButton();
+        pauseButton = new javax.swing.JButton();
+        stopButton = new javax.swing.JButton();
+
+        jvcc = new JPanel();
+        jvcanvas = new java.awt.Canvas();
+        jvcanvas.setSize(200, 200);
+        jvcc.add(jvcanvas);
+        
+        jvlc = new JVLC();
+        
+        playlist = new Playlist(jvlc);
+
+        setLayout(new java.awt.GridBagLayout());
+
+        gridBagConstraints = new java.awt.GridBagConstraints();
+        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.CENTER;
+        gridBagConstraints.gridx = 0;
+        gridBagConstraints.gridy = 0;
+        add(jvcc, gridBagConstraints);
+
+        fullScreenButton.setText("FullScreen");
+        fullScreenButton.addActionListener(new java.awt.event.ActionListener()
+        {
+
+            public void actionPerformed(java.awt.event.ActionEvent evt)
+            {
+                fullScreenButtonActionPerformed(evt);
+            }
+        });
+
+        gridBagConstraints = new java.awt.GridBagConstraints();
+        gridBagConstraints.gridx = 0;
+        gridBagConstraints.gridy = 2;
+        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
+        add(fullScreenButton, gridBagConstraints);
+
+        jTextField1.setText("file://a.avi");
+        gridBagConstraints = new java.awt.GridBagConstraints();
+        gridBagConstraints.gridx = 0;
+        gridBagConstraints.gridy = 1;
+        gridBagConstraints.gridwidth = 2;
+        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+        add(jTextField1, gridBagConstraints);
+
+        setButton.setText("Set item");
+        setButton.addActionListener(new java.awt.event.ActionListener()
+        {
+
+            public void actionPerformed(java.awt.event.ActionEvent evt)
+            {
+                setButtonActionPerformed(evt);
+            }
+        });
+        gridBagConstraints = new java.awt.GridBagConstraints();
+        gridBagConstraints.gridx = 2;
+        gridBagConstraints.gridy = 1;
+        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
+        add(setButton, gridBagConstraints);
+
+        pauseButton.setText("Play/Pause");
+        pauseButton.addActionListener(new java.awt.event.ActionListener()
+        {
+
+            public void actionPerformed(java.awt.event.ActionEvent evt)
+            {
+                pauseButtonActionPerformed(evt);
+            }
+        });
+        gridBagConstraints = new java.awt.GridBagConstraints();
+        gridBagConstraints.gridx = 1;
+        gridBagConstraints.gridy = 2;
+        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
+        add(pauseButton, gridBagConstraints);
+
+        stopButton.setText("Stop");
+        stopButton.addActionListener(new java.awt.event.ActionListener()
+        {
+
+            public void actionPerformed(java.awt.event.ActionEvent evt)
+            {
+                stopButtonActionPerformed(evt);
+            }
+        });
+        gridBagConstraints = new java.awt.GridBagConstraints();
+        gridBagConstraints.gridx = 2;
+        gridBagConstraints.gridy = 2;
+        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
+        add(stopButton, gridBagConstraints);
+
+        pack();
+
+    }
+
+    private void stopButtonActionPerformed(java.awt.event.ActionEvent evt)
+    {
+        try
+        {
+            playlist.stop();
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+    private void pauseButtonActionPerformed(java.awt.event.ActionEvent evt)
+    {
+        try
+        {
+            playlist.togglePause();
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+    private void setButtonActionPerformed(java.awt.event.ActionEvent evt)
+    {
+        try
+        {
+            jvlc.setVideoOutput(jvcanvas);
+            playlist.add(jTextField1.getText(), "a.avi");
+            playlist.play();
+        }
+        catch (VLCException e)
+        {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+    }
+
+    private void fullScreenButtonActionPerformed(java.awt.event.ActionEvent evt)
+    {
+        // jvlc.fullScreen();
+    }
+
+    private javax.swing.JButton setButton;
+
+    private javax.swing.JButton pauseButton;
+
+    private javax.swing.JButton stopButton;
+
+    private javax.swing.JButton fullScreenButton;
+
+    private javax.swing.JTextField jTextField1;
+
+    private JPanel jvcc;
+
+    public JVLC jvlc;
+    // MediaControlInstance mci;
+
+}
+
+
+public class VlcClient
+{
+
+    public static void main(String[] args)
+    {
+        Frame f = new VLCPlayerFrame();
+        f.setBounds(0, 0, 500, 500);
+        f.addWindowListener(new WindowAdapter()
+        {
+
+            @Override
+            public void windowClosing(WindowEvent ev)
+            {
+                System.exit(0);
+            }
+        });
+        f.setVisible(true);
+    }
+}
diff --git a/bindings/java/samples/pom.xml b/bindings/java/samples/pom.xml
new file mode 100644 (file)
index 0000000..bb0b942
--- /dev/null
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd ">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.videolan</groupId>
+    <artifactId>jvlc-parent</artifactId>
+    <version>0.9.0-SNAPSHOT</version>
+  </parent>
+  <artifactId>jvlc-samples</artifactId>
+  <packaging>pom</packaging>
+  <name>JVLC - Samples</name>
+  <description>Java Bindings for VideoLAN - Samples</description>
+  <version>0.9.0-SNAPSHOT</version>
+
+  <modules>
+    <module>client</module>
+  </modules>
+
+</project>
diff --git a/bindings/java/src/main/java/org/videolan/jvlc/Audio.java b/bindings/java/src/main/java/org/videolan/jvlc/Audio.java
deleted file mode 100644 (file)
index 09cf270..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-/*****************************************************************************
- * Audio.java: VLC Java Bindings, audio methods
- *****************************************************************************
- *
- * Copyright (C) 1998-2008 the VideoLAN team
- * 
- * Author: Filippo Carone <filippo@carone.org>
- *
- *
- * $Id: $
- *
- * This program is free software; you can redistribute it
- * and/or modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- * 
- */
-
-package org.videolan.jvlc;
-
-import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t;
-
-
-public class Audio
-{
-
-    private final JVLC jvlc;
-
-    /**
-     * Constant for left channel audio
-     */
-    public static final int LEFT_CHANNEL = 3;
-
-    /**
-     * Constant for right channel audio
-     */
-    public static final int RIGHT_CHANNEL = 4;
-
-    /**
-     * Constant for reverse channel audio
-     */
-    public static final int REVERSE_CHANNEL = 2;
-
-    /**
-     * Constant for stereo channel audio
-     */
-    public static final int STEREO_CHANNEL = 1;
-
-    /**
-     * Constant for dolby channel audio
-     */
-    public final int DOLBY_CHANNEL = 5;
-
-    
-    public Audio(JVLC jvlc)
-    {
-        this.jvlc = jvlc;
-    }
-
-    public int getTrack(MediaInstance mediaInstance)
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        return jvlc.getLibvlc().libvlc_audio_get_track(mediaInstance.getInstance(), exception);
-    }
-
-    public void setTrack(MediaInstance mediaInstance, int track)
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        jvlc.getLibvlc().libvlc_audio_set_track(mediaInstance.getInstance(), track, exception);
-    }
-
-    public int getChannel()
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        return jvlc.getLibvlc().libvlc_audio_get_channel(jvlc.getInstance(), exception);
-    }
-
-    public void setChannel(int channel)
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        jvlc.getLibvlc().libvlc_audio_set_channel(jvlc.getInstance(), channel, exception);
-    }
-
-    public boolean getMute()
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        return jvlc.getLibvlc().libvlc_audio_get_mute(jvlc.getInstance(), exception) == 1 ? true : false;
-    }
-
-    public void setMute(boolean value)
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        jvlc.getLibvlc().libvlc_audio_set_mute(jvlc.getInstance(), value ? 1 : 0, exception);
-    }
-
-    public void toggleMute()
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        jvlc.getLibvlc().libvlc_audio_toggle_mute(jvlc.getInstance(), exception);
-    }
-
-    public int getVolume()
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        return jvlc.getLibvlc().libvlc_audio_get_volume(jvlc.getInstance(), exception);
-    }
-
-    public void setVolume(int volume)
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        jvlc.getLibvlc().libvlc_audio_set_volume(jvlc.getInstance(), volume, exception);
-    }
-}
diff --git a/bindings/java/src/main/java/org/videolan/jvlc/JVLC.java b/bindings/java/src/main/java/org/videolan/jvlc/JVLC.java
deleted file mode 100644 (file)
index 7ffaa18..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-/*****************************************************************************
- * JVLC.java: Main Java Class, represents a libvlc_instance_t object
- *****************************************************************************
- *
- * Copyright (C) 1998-2008 the VideoLAN team
- * 
- * Author: Filippo Carone <filippo@carone.org>
- *         Philippe Morin <phmorin@free.fr>
- *
- * Created on 28-feb-2006
- *
- * $Id: JVLC.java 20141 2007-05-16 19:31:35Z littlejohn $
- *
- * This program is free software; you can redistribute it
- * and/or modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- * 
- */
-
-package org.videolan.jvlc;
-
-import org.videolan.jvlc.internal.LibVlc;
-import org.videolan.jvlc.internal.LibVlc.LibVlcInstance;
-import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t;
-
-import com.sun.jna.Native;
-
-import java.awt.Canvas;
-
-public class JVLC
-{
-
-    private final LibVlcInstance instance;
-
-    private final LibVlc libvlc = LibVlc.SYNC_INSTANCE;
-    
-    public JVLC()
-    {
-        String[] args = new String[1];
-        args[0] = "jvlc";
-        instance = createInstance(args);
-    }
-
-    public JVLC(String[] args)
-    {
-        String[] myargs = new String[args.length + 1];
-        myargs[0] = "jvlc";
-        System.arraycopy(args, 0, myargs, 1, args.length);
-        instance = createInstance(myargs);
-    }
-
-    public MediaInstance play(String media)
-    {
-        MediaDescriptor mediaDescriptor = new MediaDescriptor(this, media);
-        MediaInstance mediaInstance = new MediaInstance(mediaDescriptor);
-        mediaInstance.play();
-        return mediaInstance;
-    }
-
-    public void setVideoOutput(Canvas canvas)
-    {
-        long drawable = Native.getComponentID(canvas);
-        libvlc_exception_t exception = new libvlc_exception_t();
-        libvlc.libvlc_video_set_parent(instance, drawable, exception );
-    }
-
-    /*
-     * Core methods
-     */
-    private LibVlcInstance createInstance(String[] args)
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        libvlc.libvlc_exception_init(exception);
-
-        return libvlc.libvlc_new(args.length, args, exception);
-    }
-
-    /**
-     * Returns the _instance.
-     * @return the _instance
-     */
-    LibVlcInstance getInstance()
-    {
-        return instance;
-    }
-
-    /**
-     * Returns the libvlc.
-     * @return the libvlc
-     */
-    LibVlc getLibvlc()
-    {
-        return libvlc;
-    }
-
-    /*
-     * (non-Javadoc)
-     * @see java.lang.Object#finalize()
-     */
-    @Override
-    protected void finalize() throws Throwable
-    {
-        libvlc.libvlc_release(instance);
-        super.finalize();
-    }
-}
diff --git a/bindings/java/src/main/java/org/videolan/jvlc/MediaDescriptor.java b/bindings/java/src/main/java/org/videolan/jvlc/MediaDescriptor.java
deleted file mode 100644 (file)
index a248d58..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/*****************************************************************************
- * MediaDescriptor.java: VLC Java Bindings Media Descriptor
- *****************************************************************************
- * Copyright (C) 1998-2008 the VideoLAN team
- *
- * Authors: Filippo Carone <filippo@carone.org>
- *
- *
- * $Id $
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
- *****************************************************************************/
-
-package org.videolan.jvlc;
-
-import org.videolan.jvlc.internal.LibVlc;
-import org.videolan.jvlc.internal.LibVlc.LibVlcEventManager;
-import org.videolan.jvlc.internal.LibVlc.LibVlcMediaDescriptor;
-import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t;
-
-
-public class MediaDescriptor
-{
-    private LibVlcMediaDescriptor instance;
-    private LibVlc libvlc;
-    private LibVlcEventManager eventManager;
-    
-    /**
-     * @param jvlc The jvlc instance to create the media descriptor for.
-     * @param media The media string
-     */
-    public MediaDescriptor(JVLC jvlc, String media)
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        libvlc = jvlc.getLibvlc();
-        instance = libvlc.libvlc_media_descriptor_new(jvlc.getInstance(), media, exception);
-        eventManager = libvlc.libvlc_media_descriptor_event_manager(instance, exception);
-    }
-
-    MediaDescriptor(JVLC jvlc, LibVlcMediaDescriptor instance)
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        libvlc = jvlc.getLibvlc();
-        this.instance = instance;
-        eventManager = libvlc.libvlc_media_descriptor_event_manager(instance, exception);
-    }
-
-    public void addOption(String option)
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        libvlc.libvlc_media_descriptor_add_option(instance, option, exception );
-    }
-    
-    public String getMrl()
-    {
-        return libvlc.libvlc_media_descriptor_get_mrl(instance);
-    }
-    
-    public MediaInstance getMediaInstance()
-    {
-        return new MediaInstance(this);
-    }
-    
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    protected void finalize() throws Throwable
-    {
-        libvlc.libvlc_media_descriptor_release(instance);
-        super.finalize();
-    }
-
-    
-    /**
-     * Returns the instance.
-     * @return the instance
-     */
-    LibVlcMediaDescriptor getInstance()
-    {
-        return instance;
-    }
-    
-    /**
-     * Returns the libvlc.
-     * @return the libvlc
-     */
-    LibVlc getLibvlc()
-    {
-        return libvlc;
-    }
-}
diff --git a/bindings/java/src/main/java/org/videolan/jvlc/MediaInstance.java b/bindings/java/src/main/java/org/videolan/jvlc/MediaInstance.java
deleted file mode 100644 (file)
index d2ceee9..0000000
+++ /dev/null
@@ -1,196 +0,0 @@
-/*****************************************************************************
- * MediaInstance.java: VLC Java Bindings Media Instance
- *****************************************************************************
- * Copyright (C) 1998-2008 the VideoLAN team
- *
- * Authors: Filippo Carone <filippo@carone.org>
- *
- *
- * $Id $
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
- *****************************************************************************/
-
-package org.videolan.jvlc;
-
-import java.util.ArrayList;
-import java.util.EnumSet;
-import java.util.List;
-
-import org.videolan.jvlc.event.MediaInstanceCallback;
-import org.videolan.jvlc.event.MediaInstanceListener;
-import org.videolan.jvlc.internal.LibVlc;
-import org.videolan.jvlc.internal.LibVlcEventType;
-import org.videolan.jvlc.internal.LibVlc.LibVlcEventManager;
-import org.videolan.jvlc.internal.LibVlc.LibVlcMediaInstance;
-import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t;
-
-
-public class MediaInstance
-{
-
-    private final LibVlcMediaInstance instance;
-
-    private final LibVlc libvlc;
-
-    private final LibVlcEventManager eventManager;
-
-    private List<MediaInstanceCallback> callbacks = new ArrayList<MediaInstanceCallback>();
-
-    private MediaDescriptor mediaDescriptor;
-
-    MediaInstance(JVLC jvlc, LibVlcMediaInstance instance)
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        this.instance = instance;
-        libvlc = jvlc.getLibvlc();
-        eventManager = libvlc.libvlc_media_instance_event_manager(instance, exception);
-    }
-
-    public MediaInstance(MediaDescriptor mediaDescriptor)
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        libvlc = mediaDescriptor.getLibvlc();
-        instance = libvlc.libvlc_media_instance_new_from_media_descriptor(mediaDescriptor.getInstance(), exception);
-        eventManager = libvlc.libvlc_media_instance_event_manager(instance, exception);
-        this.mediaDescriptor = mediaDescriptor;
-    }
-
-    public MediaDescriptor getMediaDescriptor()
-    {
-        return mediaDescriptor;
-    }
-
-    public void play()
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        libvlc.libvlc_media_instance_play(instance, exception);
-    }
-
-    public void stop()
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        libvlc.libvlc_media_instance_stop(instance, exception);
-    }
-
-    public void pause()
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        libvlc.libvlc_media_instance_pause(instance, exception);
-    }
-
-    public long getLength()
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        return libvlc.libvlc_media_instance_get_length(instance, exception);
-    }
-
-    public long getTime()
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        return libvlc.libvlc_media_instance_get_time(instance, exception);
-    }
-
-    public void setTime(long time)
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        libvlc.libvlc_media_instance_set_time(instance, time, exception);
-    }
-
-    public float getPosition()
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        return libvlc.libvlc_media_instance_get_position(instance, exception);
-    }
-
-    public void setPosition(float position)
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        libvlc.libvlc_media_instance_set_position(instance, position, exception);
-    }
-
-    public boolean willPlay()
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        return (libvlc.libvlc_media_instance_will_play(instance, exception) == 1);
-    }
-
-    public float getRate()
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        return libvlc.libvlc_media_instance_get_rate(instance, exception);
-    }
-
-    public void setRate(float rate)
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        libvlc.libvlc_media_instance_set_rate(instance, rate, exception);
-    }
-
-    public boolean hasVideoOutput()
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        return (libvlc.libvlc_media_instance_has_vout(instance, exception) == 1);
-    }
-
-    public float getFPS()
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        return libvlc.libvlc_media_instance_get_fps(instance, exception);
-    }
-
-    public void addListener(final MediaInstanceListener listener)
-    {
-        MediaInstanceCallback callback = new MediaInstanceCallback(this, listener);
-        libvlc_exception_t exception = new libvlc_exception_t();
-        for (LibVlcEventType event : EnumSet.range(
-            LibVlcEventType.libvlc_MediaInstancePlayed,
-            LibVlcEventType.libvlc_MediaInstanceTimeChanged))
-        {
-            libvlc.libvlc_event_attach(eventManager, event.ordinal(), callback, null, exception);
-        }
-        callbacks.add(callback);
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    protected void finalize() throws Throwable
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        for (MediaInstanceCallback callback : callbacks)
-        {
-            for (LibVlcEventType event : EnumSet.range(
-                LibVlcEventType.libvlc_MediaInstancePlayed,
-                LibVlcEventType.libvlc_MediaInstancePositionChanged))
-            {
-                libvlc.libvlc_event_detach(eventManager, event.ordinal(), callback, null, exception);
-            }
-        }
-        libvlc.libvlc_media_instance_release(instance);
-        super.finalize();
-    }
-
-    /**
-     * Returns the instance.
-     * @return the instance
-     */
-    LibVlcMediaInstance getInstance()
-    {
-        return instance;
-    }
-
-}
diff --git a/bindings/java/src/main/java/org/videolan/jvlc/MediaList.java b/bindings/java/src/main/java/org/videolan/jvlc/MediaList.java
deleted file mode 100644 (file)
index bef31c4..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-/*****************************************************************************
- * MediaList.java: VLC Java Bindings, MediaList
- *****************************************************************************
- * Copyright (C) 1998-2008 the VideoLAN team
- *
- * Authors: Filippo Carone <filippo@carone.org>
- *
- *
- * $Id $
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
- *****************************************************************************/
-
-package org.videolan.jvlc;
-
-import org.videolan.jvlc.internal.LibVlc.LibVlcEventManager;
-import org.videolan.jvlc.internal.LibVlc.LibVlcMediaDescriptor;
-import org.videolan.jvlc.internal.LibVlc.LibVlcMediaList;
-import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t;
-
-
-public class MediaList
-{
-
-    private final JVLC jvlc;
-
-    private final LibVlcMediaList instance;
-
-    private final LibVlcEventManager eventManager;
-
-    public MediaList(JVLC jvlc)
-    {
-        this.jvlc = jvlc;
-        libvlc_exception_t exception = new libvlc_exception_t();
-        instance = jvlc.getLibvlc().libvlc_media_list_new(jvlc.getInstance(), exception);
-        eventManager = jvlc.getLibvlc().libvlc_media_list_event_manager(instance, exception);
-    }
-
-    public void addMedia(String media)
-    {
-        MediaDescriptor descriptor = new MediaDescriptor(jvlc, media);
-        addMediaDescriptor(descriptor);
-    }
-
-    public void addMediaDescriptor(MediaDescriptor descriptor)
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        jvlc.getLibvlc().libvlc_media_list_add_media_descriptor(instance, descriptor.getInstance(), exception);
-    }
-
-    public int itemsCount()
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        return jvlc.getLibvlc().libvlc_media_list_count(instance, exception);
-    }
-
-    public int indexOf(MediaDescriptor descriptor)
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        return jvlc.getLibvlc().libvlc_media_list_index_of_item(instance, descriptor.getInstance(), exception);
-    }
-
-    public MediaDescriptor getMediaDescriptorAtIndex(int index)
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        LibVlcMediaDescriptor descriptor = jvlc.getLibvlc().libvlc_media_list_item_at_index(instance, index, exception);
-        return new MediaDescriptor(jvlc, descriptor);
-    }
-
-    public void remove(int index)
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        jvlc.getLibvlc().libvlc_media_list_remove_index(instance, index, exception);
-    }
-
-    public void insertMediaDescriptor(MediaDescriptor descriptor, int index)
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        jvlc
-            .getLibvlc()
-            .libvlc_media_list_insert_media_descriptor(instance, descriptor.getInstance(), index, exception);
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    protected void finalize() throws Throwable
-    {
-        jvlc.getLibvlc().libvlc_media_list_release(instance);
-        super.finalize();
-    }
-
-    /**
-     * Returns the instance.
-     * @return the instance
-     */
-    LibVlcMediaList getInstance()
-    {
-        return instance;
-    }
-
-}
diff --git a/bindings/java/src/main/java/org/videolan/jvlc/MediaListPlayer.java b/bindings/java/src/main/java/org/videolan/jvlc/MediaListPlayer.java
deleted file mode 100644 (file)
index 28bda15..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-/*****************************************************************************
- * MediaListPlayer.java: VLC Java Bindings, MediaList player
- *****************************************************************************
- * Copyright (C) 1998-2008 the VideoLAN team
- *
- * Authors: Filippo Carone <filippo@carone.org>
- *
- *
- * $Id $
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
- *****************************************************************************/
-
-package org.videolan.jvlc;
-
-import org.videolan.jvlc.internal.LibVlc.LibVlcMediaListPlayer;
-import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t;
-
-
-public class MediaListPlayer
-{
-
-    private final LibVlcMediaListPlayer instance;
-
-    private final JVLC jvlc;
-
-    public MediaListPlayer(JVLC jvlc)
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        this.jvlc = jvlc;
-        instance = jvlc.getLibvlc().libvlc_media_list_player_new(jvlc.getInstance(), exception);
-    }
-
-    public void setMediaList(MediaList list)
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        jvlc.getLibvlc().libvlc_media_list_player_set_media_list(instance, list.getInstance(), exception);
-    }
-
-    public boolean isPlaying()
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        return jvlc.getLibvlc().libvlc_media_list_player_is_playing(instance, exception) == 1;
-    }
-
-    public void play()
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        jvlc.getLibvlc().libvlc_media_list_player_play(instance, exception);
-    }
-
-    public void stop()
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        jvlc.getLibvlc().libvlc_media_list_player_stop(instance, exception);
-    }
-
-    public void pause()
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        jvlc.getLibvlc().libvlc_media_list_player_pause(instance, exception);
-    }
-
-    
-    public void playItem(MediaDescriptor descriptor)
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        jvlc.getLibvlc().libvlc_media_list_player_play_item(instance, descriptor.getInstance(), exception);
-    }
-
-    public void playItem(int index)
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        jvlc.getLibvlc().libvlc_media_list_player_play_item_at_index(instance, index, exception);
-    }
-    
-    public void setMediaInstance(MediaInstance mediaInstance)
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        jvlc.getLibvlc().libvlc_media_list_player_set_media_instance(instance, mediaInstance.getInstance(), exception);        
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    protected void finalize() throws Throwable
-    {
-        jvlc.getLibvlc().libvlc_media_list_player_release(instance);
-        super.finalize();
-    }
-
-}
diff --git a/bindings/java/src/main/java/org/videolan/jvlc/Playlist.java b/bindings/java/src/main/java/org/videolan/jvlc/Playlist.java
deleted file mode 100644 (file)
index 140dc36..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
- /*****************************************************************************
- * Playlist.java: PlaylistIntf implementation class
- *****************************************************************************
- *
- * Copyright (C) 1998-2008 the VideoLAN team
- * 
- * Author: Filippo Carone <filippo@carone.org>
- *
- * Created on 28-feb-2006
- *
- * $Id: Playlist.java 17089 2006-10-15 10:54:15Z littlejohn $
- *
- * This program is free software; you can redistribute it
- * and/or modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- * 
- */
-
-
-package org.videolan.jvlc;
-
-import org.videolan.jvlc.internal.LibVlc;
-import org.videolan.jvlc.internal.LibVlc.LibVlcInstance;
-import org.videolan.jvlc.internal.LibVlc.LibVlcMediaInstance;
-import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t;
-
-/**
- * The playlist is deprecated and will be removed. Use MediaList and MediaListPlayer instead.
- */
-@Deprecated
-public class Playlist {
-    
-    
-    private final LibVlcInstance libvlcInstance;
-    private final LibVlc libvlc;
-    private final JVLC jvlc;
-
-    public Playlist(JVLC jvlc) {
-        this.jvlc = jvlc;
-        this.libvlcInstance = jvlc.getInstance();
-        this.libvlc = jvlc.getLibvlc();
-    }
-    
-    public synchronized void play(int id, String[] options) throws VLCException {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        libvlc.libvlc_playlist_play(libvlcInstance, id, options.length, options, exception);
-    }
-
-    public synchronized void play() throws VLCException {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        libvlc.libvlc_playlist_play(libvlcInstance, -1, 0, new String[] {}, exception);
-    }
-
-    public synchronized void togglePause() throws VLCException {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        libvlc.libvlc_playlist_pause(libvlcInstance, exception);
-    }
-
-    public synchronized void stop() throws VLCException {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        libvlc.libvlc_playlist_stop(libvlcInstance, exception);
-    }
-
-    public boolean isRunning() throws VLCException {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        return libvlc.libvlc_playlist_isplaying(libvlcInstance, exception) == 0? false : true;
-    }
-
-    public synchronized int itemsCount() throws VLCException {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        return libvlc.libvlc_playlist_items_count(libvlcInstance, exception);
-    }
-
-    public synchronized void next() throws VLCException {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        if (! isRunning())
-            play();
-        libvlc.libvlc_playlist_next(libvlcInstance, exception);
-    }
-
-    public synchronized void prev() throws VLCException {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        if (! isRunning())
-            play();
-        libvlc.libvlc_playlist_prev(libvlcInstance, exception);
-    }
-
-    public synchronized void clear() throws VLCException {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        libvlc.libvlc_playlist_clear(libvlcInstance, exception);
-    }
-    
-    public synchronized int add(String uri, String name) throws VLCException {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        return libvlc.libvlc_playlist_add(libvlcInstance, uri, name, exception);
-    }
-
-
-    public synchronized void deleteItem(int itemID) throws VLCException {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        libvlc.libvlc_playlist_delete_item(libvlcInstance, itemID, exception);
-    }
-    
-    public synchronized void setLoop(boolean loop) {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        libvlc.libvlc_playlist_loop(libvlcInstance, loop? 1 : 0, exception);
-    }
-    
-    public MediaInstance getMediaInstance()
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        LibVlcMediaInstance mi = libvlc.libvlc_playlist_get_media_instance(libvlcInstance, exception);
-        return new MediaInstance(jvlc, mi);
-        
-    }
-}
diff --git a/bindings/java/src/main/java/org/videolan/jvlc/VLCException.java b/bindings/java/src/main/java/org/videolan/jvlc/VLCException.java
deleted file mode 100644 (file)
index e239e98..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*****************************************************************************
- * JVLC.java: Main Java Class, represents a libvlc_instance_t object
- *****************************************************************************
- *
- * Copyright (C) 1998-2006 the VideoLAN team
- * 
- * Author: Philippe Morin <phmorin@free.fr>
- *
- * Created on 18-jul-2006
- *
- * $Id $
- *
- * This program is free software; you can redistribute it
- * and/or modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- * 
- */
-
-package org.videolan.jvlc;
-
-import java.lang.Exception;
-
-public class VLCException extends Exception {
-       public VLCException() {
-          super();
-       }
-       public VLCException(String message) {
-          super(message);
-       }
-       public VLCException(String message,Throwable cause) {
-          super(message,cause);
-       }
-       public VLCException(Throwable cause) {
-          super(cause);
-       }
-}
diff --git a/bindings/java/src/main/java/org/videolan/jvlc/Video.java b/bindings/java/src/main/java/org/videolan/jvlc/Video.java
deleted file mode 100644 (file)
index 4020830..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-/*****************************************************************************
- * Video.java: JVLC Video Output
- *****************************************************************************
- *
- * Copyright (C) 1998-2008 the VideoLAN team
- * 
- * Author: Filippo Carone <filippo@carone.org>
- *         Philippe Morin <phmorin@free.fr>
- *
- * Created on 28-feb-2006
- *
- * $Id: JVLC.java 20141 2007-05-16 19:31:35Z littlejohn $
- *
- * This program is free software; you can redistribute it
- * and/or modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- * 
- */
-package org.videolan.jvlc;
-
-import java.awt.Dimension;
-
-import org.videolan.jvlc.internal.LibVlc;
-import org.videolan.jvlc.internal.LibVlc.LibVlcInstance;
-import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t;
-
-public class Video
-{
-       
-       private final LibVlcInstance libvlcInstance;
-       
-    private final LibVlc libvlc;
-    
-       public Video( JVLC jvlc) {
-               this.libvlcInstance = jvlc.getInstance();
-               this.libvlc = jvlc.getLibvlc();
-       }
-
-       /* (non-Javadoc)
-        * @see org.videolan.jvlc.VideoIntf#destroyVideo()
-        */
-       public void destroyVideo(MediaInstance media)
-       {
-               libvlc_exception_t exception = new libvlc_exception_t();
-        libvlc.libvlc_video_destroy(media.getInstance(), exception );
-               
-       }
-
-       /* (non-Javadoc)
-        * @see org.videolan.jvlc.VideoIntf#getFullscreen()
-        */
-       public boolean getFullscreen(MediaInstance media)  {
-           libvlc_exception_t exception = new libvlc_exception_t();
-           return libvlc.libvlc_get_fullscreen(media.getInstance(), exception) == 1 ? true : false;
-       }
-
-       /* (non-Javadoc)
-        * @see org.videolan.jvlc.VideoIntf#getSnapshot(java.lang.String)
-        */
-       public void getSnapshot(MediaInstance media, String filepath, int width, int height)  {
-           libvlc_exception_t exception = new libvlc_exception_t();
-           libvlc.libvlc_video_take_snapshot(media.getInstance(), filepath, width, height, exception);
-       }
-
-       /* (non-Javadoc)
-        * @see org.videolan.jvlc.VideoIntf#getVideoHeight()
-        */
-       public int getHeight(MediaInstance media)  {
-           libvlc_exception_t exception = new libvlc_exception_t();
-           return libvlc.libvlc_video_get_height(media.getInstance(), exception);
-       }
-
-       /* (non-Javadoc)
-        * @see org.videolan.jvlc.VideoIntf#getVideoWidth()
-        */
-       public int getWidth(MediaInstance media)  {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        return libvlc.libvlc_video_get_height(media.getInstance(), exception);
-       }
-
-       /* (non-Javadoc)
-        * @see org.videolan.jvlc.VideoIntf#reparentVideo(java.awt.Component)
-        */
-       public void reparent(MediaInstance media, java.awt.Canvas canvas)  {
-           libvlc_exception_t exception = new libvlc_exception_t();
-        long drawable = com.sun.jna.Native.getComponentID(canvas);
-           libvlc.libvlc_video_reparent(media.getInstance(), drawable, exception);
-       }
-
-       /* (non-Javadoc)
-        * @see org.videolan.jvlc.VideoIntf#resizeVideo(int, int)
-        */
-       public void setSize(int width, int height)  {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        libvlc.libvlc_video_set_size(libvlcInstance, width, height, exception);
-       }
-
-       /* (non-Javadoc)
-        * @see org.videolan.jvlc.VideoIntf#setFullscreen(boolean)
-        */
-       public void setFullscreen(MediaInstance media, boolean fullscreen)  {
-           libvlc_exception_t exception = new libvlc_exception_t();
-           libvlc.libvlc_set_fullscreen(media.getInstance(), fullscreen? 1 : 0, exception);
-       }
-
-       /* (non-Javadoc)
-        * @see org.videolan.jvlc.VideoIntf#toggleFullscreen()
-        */
-       public void toggleFullscreen(MediaInstance media)  {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        libvlc.libvlc_toggle_fullscreen(media.getInstance(), exception);
-       }
-       
-       /* (non-Javadoc)
-        * @see org.videolan.jvlc.VideoIntf#getSize()
-        */
-       public Dimension getSize(MediaInstance media)  {
-               return new Dimension (getWidth(media), getHeight(media));
-       }
-
-       /* (non-Javadoc)
-        * @see org.videolan.jvlc.VideoIntf#setSize(java.awt.Dimension)
-        */
-       public void setSize(Dimension d)  {
-               setSize(d.width, d.height);
-       }
-}
diff --git a/bindings/java/src/main/java/org/videolan/jvlc/event/MediaInstanceCallback.java b/bindings/java/src/main/java/org/videolan/jvlc/event/MediaInstanceCallback.java
deleted file mode 100644 (file)
index c5f5329..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/*****************************************************************************
- * MediaInstancePlayCallback.java: VLC Java Bindings
- *****************************************************************************
- * Copyright (C) 1998-2008 the VideoLAN team
- *
- * Authors: Filippo Carone <filippo@carone.org>
- *
- *
- * $Id $
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
- *****************************************************************************/
-
-package org.videolan.jvlc.event;
-
-import org.videolan.jvlc.MediaInstance;
-import org.videolan.jvlc.internal.LibVlc;
-import org.videolan.jvlc.internal.LibVlcEventType;
-import org.videolan.jvlc.internal.LibVlc.LibVlcCallback;
-import org.videolan.jvlc.internal.LibVlc.libvlc_event_t;
-import org.videolan.jvlc.internal.LibVlc.media_instance_time_changed;
-
-import com.sun.jna.Pointer;
-
-
-public class MediaInstanceCallback implements LibVlcCallback
-{
-
-    private MediaInstanceListener listener;
-    private MediaInstance mediaInstance;
-
-    public MediaInstanceCallback(MediaInstance mediaInstance, MediaInstanceListener listener)
-    {
-        this.mediaInstance = mediaInstance;
-        this.listener = listener;
-    }
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public void callback(libvlc_event_t libvlc_event, Pointer userData)
-    {
-        if (libvlc_event.type == LibVlcEventType.libvlc_MediaInstancePlayed.ordinal())
-        {
-            listener.played(mediaInstance);
-        }
-        else if (libvlc_event.type == LibVlcEventType.libvlc_MediaInstancePaused.ordinal())
-        {
-            listener.paused(mediaInstance);
-        }
-        else if (libvlc_event.type == LibVlcEventType.libvlc_MediaInstanceReachedEnd.ordinal())
-        {
-            listener.endReached(mediaInstance);
-        }
-        else if (libvlc_event.type == LibVlcEventType.libvlc_MediaInstancePositionChanged.ordinal())
-        {
-            listener.positionChanged(mediaInstance);
-        }
-        else if (libvlc_event.type == LibVlcEventType.libvlc_MediaInstanceTimeChanged.ordinal())
-        {
-            libvlc_event.event_type_specific.setType(LibVlc.media_instance_time_changed.class);
-            LibVlc.media_instance_time_changed timeChanged = (media_instance_time_changed) libvlc_event.event_type_specific
-                .readField("media_instance_time_changed");
-            listener.timeChanged(mediaInstance, timeChanged.new_time);
-        }
-        else
-        {
-            throw new RuntimeException("Unsupported event error. Event id: " + libvlc_event.type);
-        }
-    }
-}
diff --git a/bindings/java/src/main/java/org/videolan/jvlc/event/MediaInstanceListener.java b/bindings/java/src/main/java/org/videolan/jvlc/event/MediaInstanceListener.java
deleted file mode 100644 (file)
index 784aa94..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*****************************************************************************
- * MediaInstancePlayListener.java: VLC Java Bindings
- *****************************************************************************
- * Copyright (C) 1998-2008 the VideoLAN team
- *
- * Authors: Filippo Carone <filippo@carone.org>
- *
- *
- * $Id $
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
- *****************************************************************************/
-
-package org.videolan.jvlc.event;
-
-import org.videolan.jvlc.MediaInstance;
-
-
-public interface MediaInstanceListener
-{
-
-    void played(MediaInstance mediaInstance);
-    
-    void paused(MediaInstance mediaInstance);
-    
-    void endReached(MediaInstance mediaInstance);
-    
-    void timeChanged(MediaInstance mediaInstance, long newTime);
-    
-    void positionChanged(MediaInstance mediaInstance);
-    
-}
diff --git a/bindings/java/src/main/java/org/videolan/jvlc/example/VLCExample.java b/bindings/java/src/main/java/org/videolan/jvlc/example/VLCExample.java
deleted file mode 100644 (file)
index c0597e9..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-package org.videolan.jvlc.example;
-
-import org.videolan.jvlc.Audio;
-import org.videolan.jvlc.JVLC;
-import org.videolan.jvlc.MediaDescriptor;
-import org.videolan.jvlc.MediaInstance;
-import org.videolan.jvlc.VLCException;
-import org.videolan.jvlc.Video;
-import org.videolan.jvlc.event.MediaInstanceListener;
-
-
-public class VLCExample
-{
-
-    public static void main(String[] args) throws InterruptedException
-    {
-        System.out.println("== Starting VLCExample ==");
-        if (args.length == 0)
-        {
-            System.out.print("Creating a JVLC instance without args");
-        }
-        else
-        {
-            System.out.println("Creating a JVLC instance with args: ");
-            for (int i = 0; i < args.length; i++)
-            {
-                System.out.println(i + ") " + args[i]);
-            }
-        }
-        JVLC jvlc = new JVLC(args);
-        System.out.println("... done.");
-
-        MediaDescriptor mediaDescriptor = new MediaDescriptor(jvlc, "/home/carone/apps/a.avi");
-        MediaInstance mediaInstance = mediaDescriptor.getMediaInstance();
-
-        mediaInstance.addListener(new MediaInstanceListener()
-        {
-
-            @Override
-            public void endReached(MediaInstance mediaInstance)
-            {
-                System.out.println("Media instance end reached. MRL: " + mediaInstance.getMediaDescriptor().getMrl());
-            }
-
-            @Override
-            public void paused(MediaInstance mediaInstance)
-            {
-                System.out.println("Media instance paused. MRL: " + mediaInstance.getMediaDescriptor().getMrl());
-            }
-
-            @Override
-            public void played(MediaInstance mediaInstance)
-            {
-                System.out.println("Media instance played. MRL: " + mediaInstance.getMediaDescriptor().getMrl());
-            }
-
-            @Override
-            public void positionChanged(MediaInstance mediaInstance)
-            {
-                // TODO Auto-generated method stub
-            }
-
-            @Override
-            public void timeChanged(MediaInstance mediaInstance, long newTime)
-            {
-                System.out.println("new time: " + newTime);
-            }
-        });
-        mediaInstance.play();
-
-        while (!mediaInstance.hasVideoOutput())
-        {
-            Thread.sleep(100);
-        }
-
-        Video video = new Video(jvlc);
-        System.out.print(video.getWidth(mediaInstance));
-        System.out.print("x");
-        System.out.println(video.getHeight(mediaInstance));
-        System.out.print("Fullscreen... ");
-        video.setFullscreen(mediaInstance, true);
-        Thread.sleep(3000);
-        System.out.println("real size.");
-        video.setFullscreen(mediaInstance, false);
-        System.out.print("Taking snapshot... ");
-        video.getSnapshot(mediaInstance, System.getProperty("user.dir") + "/snap.png", 0, 0);
-        System.out.println("taken. (see " + System.getProperty("user.dir") + "/snap.png )");
-        Thread.sleep(2000);
-        System.out.println("Resizing to 300x300");
-        video.setSize(300, 300);
-
-        System.out.print("Muting...");
-        Audio audio = new Audio(jvlc);
-        audio.setMute(true);
-        Thread.sleep(3000);
-        System.out.println("unmuting.");
-        audio.setMute(false);
-        Thread.sleep(3000);
-        System.out.println("Volume is: " + audio.getVolume());
-        System.out.print("Setting volume to 150... ");
-        audio.setVolume(150);
-        System.out.println("done");
-        System.out.println("== AUDIO INFO ==");
-        System.out.println("Audio track number: " + audio.getTrack(mediaInstance));
-        System.out.println("Audio channel info: " + audio.getChannel());
-        Thread.sleep(3000);
-        System.out.println("MEDIA INSTANCE INFORMATION");
-        System.out.println("--------------------------");
-        System.out.println("Total length (ms) :\t" + mediaInstance.getLength());
-        System.out.println("Input time (ms) :\t" + mediaInstance.getTime());
-        System.out.println("Input position [0-1]:\t" + mediaInstance.getPosition());
-        System.out.println("Input FPS :\t" + mediaInstance.getFPS());
-
-        System.out.println("Everything fine ;)");
-        return;
-    }
-}
diff --git a/bindings/java/src/main/java/org/videolan/jvlc/internal/LibVlc.java b/bindings/java/src/main/java/org/videolan/jvlc/internal/LibVlc.java
deleted file mode 100644 (file)
index b8d2015..0000000
+++ /dev/null
@@ -1,484 +0,0 @@
-/*****************************************************************************
- * LibVlc.java: VLC Java Bindings JNA Glue
- *****************************************************************************
- * Copyright (C) 1998-2008 the VideoLAN team
- *
- * Authors: Filippo Carone <filippo@carone.org>
- *
- *
- * $Id $
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
- *****************************************************************************/
-
-package org.videolan.jvlc.internal;
-
-import com.sun.jna.Callback;
-import com.sun.jna.Library;
-import com.sun.jna.Native;
-import com.sun.jna.NativeLong;
-import com.sun.jna.Pointer;
-import com.sun.jna.PointerType;
-import com.sun.jna.Structure;
-import com.sun.jna.Union;
-
-
-public interface LibVlc extends Library
-{
-
-    LibVlc INSTANCE = (LibVlc) Native.loadLibrary("vlc-control", LibVlc.class);
-    LibVlc SYNC_INSTANCE = (LibVlc) Native.synchronizedLibrary(INSTANCE);
-
-    public static class libvlc_exception_t extends Structure
-    {
-
-        public int raised;
-
-        public int code;
-
-        public String message;
-    }
-
-    public static class libvlc_event_t extends Structure
-    {
-
-        public int type;
-
-        public Pointer obj;
-
-        public event_type_specific event_type_specific;
-
-    }
-
-    public class media_descriptor_meta_changed extends Structure
-    {
-
-        public Pointer meta_type;
-    }
-
-    public class media_descriptor_subitem_added extends Structure
-    {
-
-        public LibVlcMediaDescriptor new_child;
-    }
-
-    public class media_descriptor_duration_changed extends Structure
-    {
-
-        public NativeLong new_duration;
-    }
-
-    public class media_descriptor_preparsed_changed extends Structure
-    {
-
-        public int new_status;
-    }
-
-    public class media_descriptor_freed extends Structure
-    {
-
-        public LibVlcMediaDescriptor md;
-    }
-
-    public class media_descriptor_state_changed extends Structure
-    {
-
-        // @todo: check this one
-        public int new_state;
-    }
-
-    /* media instance */
-
-    public class media_instance_position_changed extends Structure
-    {
-
-        public float new_position;
-    }
-
-    public class media_instance_time_changed extends Structure
-    {
-
-        // @todo: check this one
-        public long new_time;
-    }
-
-    /* media list */
-    public class media_list_item_added extends Structure
-    {
-
-        public LibVlcMediaDescriptor item;
-
-        public int index;
-    }
-
-    public class media_list_will_add_item extends Structure
-    {
-
-        public LibVlcMediaDescriptor item;
-
-        public int index;
-    }
-
-    public class media_list_item_deleted extends Structure
-    {
-        
-        public LibVlcMediaDescriptor item;
-
-        public int index;
-    }
-
-    public class media_list_will_delete_item extends Structure
-    {
-
-        public LibVlcMediaDescriptor item;
-
-        public int index;
-    }
-
-    /* media list view */
-    public class media_list_view_item_added extends Structure
-    {
-
-        public LibVlcMediaDescriptor item;
-
-        public int index;
-    }
-
-    public class media_list_view_will_add_item extends Structure
-    {
-
-        public LibVlcMediaDescriptor item;
-
-        public int index;
-    }
-
-    public class media_list_view_item_deleted extends Structure
-    {
-
-        public LibVlcMediaDescriptor item;
-
-        public int index;
-    }
-
-    public class media_list_view_will_delete_item extends Structure
-    {
-
-        public LibVlcMediaDescriptor item;
-
-        public int index;
-    }
-
-    /* media discoverer */
-    public class media_media_discoverer_started extends Structure
-    {
-
-        public Pointer unused;
-    }
-
-    public class media_media_discoverer_ended extends Structure
-    {
-
-        public Pointer unused;
-    }
-
-    public class event_type_specific extends Union
-    {
-        public media_descriptor_meta_changed media_descriptor_meta_changed;
-        public media_descriptor_subitem_added media_descriptor_subitem_added;
-        public media_descriptor_duration_changed media_descriptor_duration_changed;
-        public media_descriptor_preparsed_changed media_descriptor_preparsed_changed;
-        public media_descriptor_freed media_descriptor_freed;
-        public media_descriptor_state_changed media_descriptor_state_changed;
-        public media_instance_position_changed media_instance_position_changed;
-        public media_instance_time_changed media_instance_time_changed;
-        public media_list_item_added media_list_item_added;
-        public media_list_will_add_item media_list_will_add_item;
-        public media_list_item_deleted media_list_item_deleted;
-        public media_list_will_delete_item media_list_will_delete_item;
-        public media_list_view_item_added media_list_view_item_added;
-        public media_list_view_will_add_item media_list_view_will_add_item;
-        public media_list_view_item_deleted media_list_view_item_deleted;
-        public media_list_view_will_delete_item media_list_view_will_delete_item;
-    }
-
-    public class LibVlcInstance extends PointerType
-    {
-    }
-
-    public class LibVlcMediaDescriptor extends PointerType
-    {
-    }
-
-    public class LibVlcMediaInstance extends PointerType
-    {
-    }
-
-    public class LibVlcMediaList extends PointerType
-    {
-    }
-
-    public class LibVlcMediaListPlayer extends PointerType
-    {
-    }
-
-    public class LibVlcEventManager extends PointerType
-    {
-    }
-
-    // exception handling
-    void libvlc_exception_init(libvlc_exception_t exception);
-
-    int libvlc_exception_raised(final libvlc_exception_t exception);
-
-    void libvlc_exception_raise(libvlc_exception_t exception, String format, Object... args);
-
-    void libvlc_exception_clear(libvlc_exception_t exception);
-
-    String libvlc_exception_get_message(libvlc_exception_t exception);
-
-    // core
-    LibVlcInstance libvlc_new(int argc, String[] argv, libvlc_exception_t exception);
-
-    void libvlc_release(LibVlcInstance libvlc_instance_t);
-
-    // video
-
-    void libvlc_video_set_parent(LibVlcInstance libvlc_instance, long drawable, libvlc_exception_t exception);
-
-    void libvlc_toggle_fullscreen(LibVlcMediaInstance libvlc_instance);
-
-    void libvlc_set_fullscreen(LibVlcMediaInstance instance, int fullscreen, libvlc_exception_t exception);
-
-    int libvlc_get_fullscreen(LibVlcMediaInstance instance, libvlc_exception_t exception);
-
-    int libvlc_video_get_height(LibVlcMediaInstance instance, libvlc_exception_t exception);
-
-    int libvlc_video_get_width(LibVlcMediaInstance instance, libvlc_exception_t exception);
-
-    String libvlc_video_get_aspect_ration(LibVlcMediaInstance instance, libvlc_exception_t exception);
-
-    void libvlc_video_set_aspect_ration(LibVlcMediaInstance instance, String ratio, libvlc_exception_t exception);
-
-    int libvlc_video_get_spu(LibVlcMediaInstance instance, libvlc_exception_t exception);
-
-    int libvlc_video_set_spu(LibVlcMediaInstance instance, int spu, libvlc_exception_t exception);
-
-    String libvlc_video_get_crop_geometry(LibVlcMediaInstance instance, libvlc_exception_t exception);
-
-    void libvlc_video_set_crop_geometry(LibVlcMediaInstance instance, String geometry, libvlc_exception_t exception);
-
-    void libvlc_video_take_snapshot(LibVlcMediaInstance instance, String filename, int width, int height,
-        libvlc_exception_t exception);
-
-    void libvlc_video_destroy(LibVlcMediaInstance instance, libvlc_exception_t exception);
-
-    void libvlc_video_resize(LibVlcMediaInstance instance, int width, int height, libvlc_exception_t exception);
-
-    void libvlc_video_reparent(LibVlcMediaInstance instance, long drawable, libvlc_exception_t exception);
-
-    void libvlc_video_set_size(LibVlcInstance instance, int width, int height, libvlc_exception_t exception);
-
-    // audio
-
-    void libvlc_audio_toggle_mute(LibVlcInstance instance, libvlc_exception_t exception);
-
-    void libvlc_audio_set_mute(LibVlcInstance instance, int mute, libvlc_exception_t exception);
-
-    int libvlc_audio_get_mute(LibVlcInstance instance, libvlc_exception_t exception);
-
-    int libvlc_audio_get_volume(LibVlcInstance instance, libvlc_exception_t exception);
-
-    int libvlc_audio_set_volume(LibVlcInstance instance, int volume, libvlc_exception_t exception);
-
-    int libvlc_audio_get_track_count(LibVlcMediaInstance mediaInstance,  libvlc_exception_t exception );
-
-    int libvlc_audio_get_track(LibVlcMediaInstance mediaInstance, libvlc_exception_t exception );
-    
-    void libvlc_audio_set_track(LibVlcMediaInstance mediaInstance, int channel, libvlc_exception_t exception);
-    
-    int libvlc_audio_get_channel(LibVlcInstance instance, libvlc_exception_t exception );
-    
-    void libvlc_audio_set_channel(LibVlcInstance instance, int channel, libvlc_exception_t exception);
-    
-    // playlist
-
-    void libvlc_playlist_loop(LibVlcInstance instance, int loop, libvlc_exception_t exception);
-
-    void libvlc_playlist_play(LibVlcInstance instance, int itemIndex, int optionsCount, String[] options,
-        libvlc_exception_t exception);
-
-    void libvlc_playlist_pause(LibVlcInstance instance, libvlc_exception_t exception);
-
-    void libvlc_playlist_stop(LibVlcInstance instance, libvlc_exception_t exception);
-
-    int libvlc_playlist_isplaying(LibVlcInstance instance, libvlc_exception_t exception);
-
-    int libvlc_playlist_items_count(LibVlcInstance instance, libvlc_exception_t exception);
-
-    void libvlc_playlist_next(LibVlcInstance instance, libvlc_exception_t exception);
-
-    void libvlc_playlist_prev(LibVlcInstance instance, libvlc_exception_t exception);
-
-    void libvlc_playlist_clear(LibVlcInstance instance, libvlc_exception_t exception);
-
-    int libvlc_playlist_add(LibVlcInstance instance, String uri, String name, libvlc_exception_t exception);
-
-    int libvlc_playlist_delete_item(LibVlcInstance instance, int itemIndex, libvlc_exception_t exception);
-
-    LibVlcMediaInstance libvlc_playlist_get_media_instance(LibVlcInstance instance, libvlc_exception_t exception);
-
-    int libvlc_media_instance_is_seekable(LibVlcMediaInstance instance, libvlc_exception_t exception);
-
-    int libvlc_media_instance_can_pause(LibVlcMediaInstance instance, libvlc_exception_t exception);
-
-    // media descriptor
-
-    LibVlcMediaDescriptor libvlc_media_descriptor_new(LibVlcInstance libvlc_instance, String mrl,
-        libvlc_exception_t exception);
-
-    void libvlc_media_descriptor_add_option(LibVlcMediaDescriptor media_descriptor, String option,
-        libvlc_exception_t exception);
-
-    String libvlc_media_descriptor_get_mrl(LibVlcMediaDescriptor media_descriptor);
-
-    void libvlc_media_descriptor_release(LibVlcMediaDescriptor media_descriptor);
-
-    LibVlcEventManager libvlc_media_descriptor_event_manager(LibVlcMediaDescriptor media_descriptor,
-        libvlc_exception_t exception);
-
-    // media instance
-
-    LibVlcMediaInstance libvlc_media_instance_new(LibVlcInstance instance, libvlc_exception_t exception);
-
-    LibVlcMediaInstance libvlc_media_instance_new_from_media_descriptor(LibVlcMediaDescriptor media_descriptor,
-        libvlc_exception_t exception);
-
-    void libvlc_media_instance_play(LibVlcMediaInstance media_instance, libvlc_exception_t exception);
-
-    void libvlc_media_instance_pause(LibVlcMediaInstance media_instance, libvlc_exception_t exception);
-
-    void libvlc_media_instance_stop(LibVlcMediaInstance media_instance, libvlc_exception_t exception);
-
-    void libvlc_media_instance_set_drawable(LibVlcMediaInstance libvlc_media_instance, long drawable,
-        libvlc_exception_t exception);
-
-    long libvlc_media_instance_get_length(LibVlcMediaInstance instance, libvlc_exception_t exception);
-
-    long libvlc_media_instance_get_time(LibVlcMediaInstance instance, libvlc_exception_t exception);
-
-    void libvlc_media_instance_set_time(LibVlcMediaInstance instance, long time, libvlc_exception_t exception);
-
-    float libvlc_media_instance_get_position(LibVlcMediaInstance instance, libvlc_exception_t exception);
-
-    void libvlc_media_instance_set_position(LibVlcMediaInstance instance, float position, libvlc_exception_t exception);
-
-    int libvlc_media_instance_will_play(LibVlcMediaInstance instance, libvlc_exception_t exception);
-
-    void libvlc_media_instance_set_rate(LibVlcMediaInstance instance, float rate, libvlc_exception_t exception);
-
-    float libvlc_media_instance_get_rate(LibVlcMediaInstance instance, libvlc_exception_t exception);
-
-    int libvlc_media_instance_has_vout(LibVlcMediaInstance instance2, libvlc_exception_t exception);
-
-    float libvlc_media_instance_get_fps(LibVlcMediaInstance instance2, libvlc_exception_t exception);
-
-    void libvlc_media_instance_release(LibVlcMediaInstance instance);
-
-    LibVlcEventManager libvlc_media_instance_event_manager(LibVlcMediaInstance media_instance,
-        libvlc_exception_t exception);
-
-    // media list
-
-    LibVlcMediaList libvlc_media_list_new(LibVlcInstance libvlc_instance, libvlc_exception_t exception);
-
-    void libvlc_media_list_release(LibVlcMediaList libVlcMediaList);
-
-    void libvlc_media_list_add_file_content(LibVlcMediaList libvlc_media_list, String fileName,
-        libvlc_exception_t exception);
-
-    void libvlc_media_list_set_media_descriptor(LibVlcMediaList libvlc_media_list,
-        LibVlcMediaDescriptor libvlc_media_descriptor, libvlc_exception_t exception);
-
-    LibVlcMediaDescriptor libvlc_media_list_media_descriptor(LibVlcMediaList libvlc_media_list,
-        libvlc_exception_t exception);
-
-    void libvlc_media_list_add_media_descriptor(LibVlcMediaList libvlc_media_list,
-        LibVlcMediaDescriptor libvlc_media_descriptor, libvlc_exception_t exception);
-
-    void libvlc_media_list_insert_media_descriptor(LibVlcMediaList libvlc_media_list,
-        LibVlcMediaDescriptor libvlc_media_descriptor, int position, libvlc_exception_t exception);
-
-    void libvlc_media_list_remove_index(LibVlcMediaList libvlc_media_list, int position, libvlc_exception_t exception);
-
-    int libvlc_media_list_count(LibVlcMediaList libvlc_media_list, libvlc_exception_t exception);
-
-    LibVlcMediaDescriptor libvlc_media_list_item_at_index(LibVlcMediaList libvlc_media_list, int position,
-        libvlc_exception_t exception);
-
-    int libvlc_media_list_index_of_item(LibVlcMediaList libvlc_media_list,
-        LibVlcMediaDescriptor libvlc_media_descriptor, libvlc_exception_t exception);
-
-    int libvlc_media_list_is_readonly(LibVlcMediaList libvlc_media_list);
-
-    LibVlcEventManager libvlc_media_list_event_manager(LibVlcMediaList libvlc_media_list, libvlc_exception_t exception);
-
-    // libvlc_media_list_player
-
-    LibVlcMediaListPlayer libvlc_media_list_player_new(LibVlcInstance libvlc_media_instance,
-        libvlc_exception_t exception);
-
-    void libvlc_media_list_player_release(LibVlcMediaListPlayer libvlc_media_list_player);
-
-    void libvlc_media_list_player_set_media_instance(LibVlcMediaListPlayer libvlc_media_list_player,
-        LibVlcMediaInstance libvlc_media_instance, libvlc_exception_t exception);
-
-    void libvlc_media_list_player_set_media_list(LibVlcMediaListPlayer libvlc_media_list_player,
-        LibVlcMediaList libvlc_media_list, libvlc_exception_t exception);
-
-    void libvlc_media_list_player_play(LibVlcMediaListPlayer libvlc_media_list_player, libvlc_exception_t exception);
-
-    void libvlc_media_list_player_pause(LibVlcMediaListPlayer libvlc_media_list_player, libvlc_exception_t exception);
-
-    int libvlc_media_list_player_is_playing(LibVlcMediaListPlayer libvlc_media_list_player, libvlc_exception_t exception);
-
-    int libvlc_media_list_player_get_state(LibVlcMediaListPlayer libvlc_media_list_player, libvlc_exception_t exception);
-
-    void libvlc_media_list_player_play_item_at_index(LibVlcMediaListPlayer libvlc_media_list_player, int position,
-        libvlc_exception_t exception);
-
-    void libvlc_media_list_player_play_item(LibVlcMediaListPlayer libvlc_media_list_player,
-        LibVlcMediaDescriptor libvlc_media_descriptor, libvlc_exception_t exception);
-
-    void libvlc_media_list_player_stop(LibVlcMediaListPlayer libvlc_media_list_player, libvlc_exception_t exception);
-
-    void libvlc_media_list_player_next(LibVlcMediaListPlayer libvlc_media_list_player, libvlc_exception_t exception);
-
-    // event manager
-
-    public static interface LibVlcCallback extends Callback
-    {
-
-        void callback(libvlc_event_t libvlc_event, Pointer userData);
-    }
-
-    void libvlc_event_attach(LibVlcEventManager event_manager, int event_type, LibVlcCallback callback,
-        Pointer userData, libvlc_exception_t exception);
-
-    void libvlc_event_detach(LibVlcEventManager event_manager, int event_type, LibVlcCallback callback,
-        Pointer userData, libvlc_exception_t excecption);
-
-    void libvlc_toggle_fullscreen(LibVlcMediaInstance instance, libvlc_exception_t exception);
-
-}
diff --git a/bindings/java/src/main/java/org/videolan/jvlc/internal/LibVlcEventType.java b/bindings/java/src/main/java/org/videolan/jvlc/internal/LibVlcEventType.java
deleted file mode 100644 (file)
index 776c84b..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*****************************************************************************
- * LibVlcEventType.java: VLC Java Bindings event types enum
- *****************************************************************************
- * Copyright (C) 1998-2008 the VideoLAN team
- *
- * Authors: Filippo Carone <filippo@carone.org>
- *
- *
- * $Id $
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
- *****************************************************************************/
-
-package org.videolan.jvlc.internal;
-
-
-public enum LibVlcEventType {
-
-    libvlc_MediaDescriptorMetaChanged,
-    libvlc_MediaDescriptorSubItemAdded,
-    libvlc_MediaDescriptorDurationChanged,
-    libvlc_MediaDescriptorPreparsedChanged,
-    libvlc_MediaDescriptorFreed,
-    libvlc_MediaDescriptorStateChanged,
-    libvlc_MediaInstancePlayed,
-    libvlc_MediaInstancePaused,
-    libvlc_MediaInstanceReachedEnd,
-    libvlc_MediaInstanceEncounteredError,
-    libvlc_MediaInstanceTimeChanged,
-    libvlc_MediaInstancePositionChanged;
-}
diff --git a/bindings/java/src/main/java/org/videolan/jvlc/internal/LibVlcImpl.java b/bindings/java/src/main/java/org/videolan/jvlc/internal/LibVlcImpl.java
deleted file mode 100644 (file)
index 39dbf0d..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*****************************************************************************
- * ${file_name}: VLC Java Bindings
- *****************************************************************************
- * Copyright (C) 1998-2007 the VideoLAN team
- *
- * Authors: Filippo Carone <filippo@carone.org>
- *
- *
- * $Id $
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
- *****************************************************************************/
-
-package org.videolan.jvlc.internal;
-
-import java.awt.Canvas;
-import java.awt.Component;
-
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-
-import org.videolan.jvlc.internal.LibVlc.LibVlcCallback;
-import org.videolan.jvlc.internal.LibVlc.LibVlcEventManager;
-import org.videolan.jvlc.internal.LibVlc.LibVlcInstance;
-import org.videolan.jvlc.internal.LibVlc.LibVlcMediaDescriptor;
-import org.videolan.jvlc.internal.LibVlc.LibVlcMediaInstance;
-import org.videolan.jvlc.internal.LibVlc.libvlc_event_t;
-import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t;
-
-import com.sun.jna.Pointer;
-
-
-public class LibVlcImpl
-{
-
-    public static boolean done;
-
-    public static void main(String[] args) throws InterruptedException
-    {
-        LibVlc libVlc = LibVlc.INSTANCE;
-        libvlc_exception_t exception = new libvlc_exception_t();
-        libVlc.libvlc_exception_init(exception);
-
-        final Object lock = new Object();
-
-        System.out.println("Starting vlc");
-        LibVlcInstance libvlc_instance_t = libVlc.libvlc_new(0, new String[] {"/usr/local/bin/vlc"}, exception);
-
-        LibVlcMediaDescriptor mediaDescriptor = libVlc
-            .libvlc_media_descriptor_new(libvlc_instance_t, "/home/carone/a.avi", exception);
-
-        LibVlcMediaInstance mediaInstance = libVlc.libvlc_media_instance_new_from_media_descriptor(mediaDescriptor, exception);
-
-        LibVlcEventManager mediaInstanceEventManager = libVlc.libvlc_media_instance_event_manager(mediaInstance, exception);
-
-        LibVlcCallback played = new LibVlcCallback()
-        {
-
-            @Override
-            public void callback(libvlc_event_t libvlc_event_t, Pointer pointer)
-            {
-                System.out.println("Playing started.");
-            }
-        };
-
-        LibVlcCallback endReached = new LibVlcCallback()
-        {
-
-            @Override
-            public void callback(libvlc_event_t libvlc_event_t, Pointer pointer)
-            {
-                synchronized (lock)
-                {
-                    System.out.println("Playing finished.");
-                    LibVlcImpl.done = true;
-                }
-            }
-        };
-
-        libVlc.libvlc_event_attach(
-            mediaInstanceEventManager,
-            LibVlcEventType.libvlc_MediaInstancePlayed.ordinal(),
-            played,
-            null,
-            exception);
-
-        libVlc.libvlc_event_attach(
-            mediaInstanceEventManager,
-            LibVlcEventType.libvlc_MediaInstanceReachedEnd.ordinal(),
-            endReached,
-            null,
-            exception);
-        
-        JFrame frame = new JFrame("title");
-        frame.setVisible(true);
-        frame.setLocation(100, 100);
-        frame.setSize(500, 500);
-        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
-        
-        JPanel panel = new JPanel();
-        Canvas canvas = new Canvas();
-        canvas.setSize(500, 500);
-        panel.add(canvas);
-        frame.getContentPane().add(panel);
-        frame.pack();
-        
-        long drawable = com.sun.jna.Native.getComponentID(canvas);
-        
-        libVlc.libvlc_video_set_parent(libvlc_instance_t, drawable, exception);
-
-        libVlc.libvlc_media_instance_play(mediaInstance, exception);
-    }
-}
diff --git a/bindings/java/src/main/resources/.gitignore b/bindings/java/src/main/resources/.gitignore
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/bindings/java/src/test/java/org/videolan/jvlc/internal/LibVlcCoreTest.java b/bindings/java/src/test/java/org/videolan/jvlc/internal/LibVlcCoreTest.java
deleted file mode 100644 (file)
index 38da716..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*****************************************************************************
- * LibVlcCoreTest.java: VLC Java Bindings
- *****************************************************************************
- * Copyright (C) 1998-2008 the VideoLAN team
- *
- * Authors: Filippo Carone <filippo@carone.org>
- *
- *
- * $Id $
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
- *****************************************************************************/
-
-package org.videolan.jvlc.internal;
-
-import org.junit.Assert;
-import org.junit.Test;
-import org.videolan.jvlc.internal.LibVlc.LibVlcInstance;
-import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t;
-
-
-public class LibVlcCoreTest
-{
-
-    private LibVlc instance = LibVlc.INSTANCE;
-    
-    @Test
-    public void testNew() throws Exception
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        LibVlcInstance libvlcInstance = instance.libvlc_new(0, new String[] {}, exception);
-        Assert.assertNotNull(libvlcInstance);
-        Assert.assertEquals(0, exception.raised);
-    }
-    
-    @Test
-    public void testRelease() throws Exception
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        LibVlcInstance libvlcInstance = instance.libvlc_new(0, new String[] {}, exception);
-        instance.libvlc_release(libvlcInstance);
-    }
-    
-}
diff --git a/bindings/java/src/test/java/org/videolan/jvlc/internal/MediaListTest.java b/bindings/java/src/test/java/org/videolan/jvlc/internal/MediaListTest.java
deleted file mode 100644 (file)
index d68e194..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*****************************************************************************
- * MediaListTest.java: VLC Java Bindings
- *****************************************************************************
- * Copyright (C) 1998-2008 the VideoLAN team
- *
- * Authors: Filippo Carone <filippo@carone.org>
- *
- *
- * $Id $
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
- *****************************************************************************/
-
-package org.videolan.jvlc.internal;
-
-import junit.framework.Assert;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.videolan.jvlc.internal.LibVlc.LibVlcInstance;
-import org.videolan.jvlc.internal.LibVlc.LibVlcMediaDescriptor;
-import org.videolan.jvlc.internal.LibVlc.LibVlcMediaList;
-import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t;
-
-
-
-public class MediaListTest
-{
-    private LibVlc libvlc = LibVlc.INSTANCE;
-    private LibVlcInstance libvlcInstance;
-    
-    @Before
-    public void testSetup()
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        libvlcInstance = libvlc.libvlc_new(0, new String[] {}, exception );
-    }
-    
-    @After
-    public void tearDown()
-    {
-        libvlc.libvlc_release(libvlcInstance);
-    }
-    
-    @Test
-    public void mediaListNew()
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        LibVlcMediaList mediaList = libvlc.libvlc_media_list_new(libvlcInstance, exception);
-        Assert.assertNotNull(mediaList);
-        Assert.assertEquals(0, exception.raised);
-    }
-    
-    @Test
-    public void mediaListAddMediaDescriptor()
-    {
-        libvlc_exception_t exception = new libvlc_exception_t();
-        LibVlcMediaList mediaList = libvlc.libvlc_media_list_new(libvlcInstance, exception);
-        String mrl = this.getClass().getResource("/raffa_voice.ogg").getPath();
-        LibVlcMediaDescriptor libvlc_media_descriptor = libvlc.libvlc_media_descriptor_new(libvlcInstance, mrl, exception);
-        libvlc.libvlc_media_list_add_media_descriptor(mediaList, libvlc_media_descriptor , exception);
-        Assert.assertEquals(0, exception.raised);
-    }
-}
diff --git a/bindings/java/src/test/resources/raffa_voice.ogg b/bindings/java/src/test/resources/raffa_voice.ogg
deleted file mode 100644 (file)
index 019f364..0000000
Binary files a/bindings/java/src/test/resources/raffa_voice.ogg and /dev/null differ