maven2 project structure
authorFilippo Carone <littlejohn@videolan.org>
Thu, 13 Mar 2008 21:16:24 +0000 (22:16 +0100)
committerFilippo Carone <littlejohn@videolan.org>
Thu, 13 Mar 2008 21:45:04 +0000 (22:45 +0100)
29 files changed:
org/videolan/jvlc/Audio.java [deleted file]
org/videolan/jvlc/JVLC.java [deleted file]
org/videolan/jvlc/MediaDescriptor.java [deleted file]
org/videolan/jvlc/MediaInstance.java [deleted file]
org/videolan/jvlc/MediaList.java [deleted file]
org/videolan/jvlc/MediaListPlayer.java [deleted file]
org/videolan/jvlc/Playlist.java [deleted file]
org/videolan/jvlc/VLCException.java [deleted file]
org/videolan/jvlc/Video.java [deleted file]
org/videolan/jvlc/event/MediaInstanceCallback.java [deleted file]
org/videolan/jvlc/event/MediaInstanceListener.java [deleted file]
org/videolan/jvlc/internal/LibVlc.java [deleted file]
org/videolan/jvlc/internal/LibVlcEventType.java [deleted file]
org/videolan/jvlc/internal/LibVlcImpl.java [deleted file]
pom.xml [new file with mode: 0644]
src/main/java/org/videolan/jvlc/Audio.java [new file with mode: 0644]
src/main/java/org/videolan/jvlc/JVLC.java [new file with mode: 0644]
src/main/java/org/videolan/jvlc/MediaDescriptor.java [new file with mode: 0644]
src/main/java/org/videolan/jvlc/MediaInstance.java [new file with mode: 0644]
src/main/java/org/videolan/jvlc/MediaList.java [new file with mode: 0644]
src/main/java/org/videolan/jvlc/MediaListPlayer.java [new file with mode: 0644]
src/main/java/org/videolan/jvlc/Playlist.java [new file with mode: 0644]
src/main/java/org/videolan/jvlc/VLCException.java [new file with mode: 0644]
src/main/java/org/videolan/jvlc/Video.java [new file with mode: 0644]
src/main/java/org/videolan/jvlc/event/MediaInstanceCallback.java [new file with mode: 0644]
src/main/java/org/videolan/jvlc/event/MediaInstanceListener.java [new file with mode: 0644]
src/main/java/org/videolan/jvlc/internal/LibVlc.java [new file with mode: 0644]
src/main/java/org/videolan/jvlc/internal/LibVlcEventType.java [new file with mode: 0644]
src/main/java/org/videolan/jvlc/internal/LibVlcImpl.java [new file with mode: 0644]

diff --git a/org/videolan/jvlc/Audio.java b/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/org/videolan/jvlc/JVLC.java b/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/org/videolan/jvlc/MediaDescriptor.java b/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/org/videolan/jvlc/MediaInstance.java b/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/org/videolan/jvlc/MediaList.java b/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/org/videolan/jvlc/MediaListPlayer.java b/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/org/videolan/jvlc/Playlist.java b/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/org/videolan/jvlc/VLCException.java b/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/org/videolan/jvlc/Video.java b/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/org/videolan/jvlc/event/MediaInstanceCallback.java b/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/org/videolan/jvlc/event/MediaInstanceListener.java b/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/org/videolan/jvlc/internal/LibVlc.java b/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/org/videolan/jvlc/internal/LibVlcEventType.java b/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/org/videolan/jvlc/internal/LibVlcImpl.java b/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/pom.xml b/pom.xml
new file mode 100644 (file)
index 0000000..27cba5e
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,21 @@
+<?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>
+  <groupId>org.videolan</groupId>
+  <artifactId>jvlc</artifactId>
+  <packaging>jar</packaging>
+  <name>JVLC</name>
+  <description>Java Bindings for VideoLAN</description>
+  <version>0.0.1-SNAPSHOT</version>
+   <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <source>1.6</source>
+          <target>1.6</target>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build> 
+</project>
diff --git a/src/main/java/org/videolan/jvlc/Audio.java b/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/src/main/java/org/videolan/jvlc/JVLC.java b/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/src/main/java/org/videolan/jvlc/MediaDescriptor.java b/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/src/main/java/org/videolan/jvlc/MediaInstance.java b/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/src/main/java/org/videolan/jvlc/MediaList.java b/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/src/main/java/org/videolan/jvlc/MediaListPlayer.java b/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/src/main/java/org/videolan/jvlc/Playlist.java b/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/src/main/java/org/videolan/jvlc/VLCException.java b/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/src/main/java/org/videolan/jvlc/Video.java b/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/src/main/java/org/videolan/jvlc/event/MediaInstanceCallback.java b/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/src/main/java/org/videolan/jvlc/event/MediaInstanceListener.java b/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/src/main/java/org/videolan/jvlc/internal/LibVlc.java b/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/src/main/java/org/videolan/jvlc/internal/LibVlcEventType.java b/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/src/main/java/org/videolan/jvlc/internal/LibVlcImpl.java b/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);
+    }
+}