Commit 7629cf1b authored by Filippo Carone's avatar Filippo Carone

Java classes for Java bindings added

parent 92fcb9b5
/*
* Created on 28-feb-2006
*
* $Id: AudioIntf.java 8 2006-02-28 12:03:47Z little $
*
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
*/
/**
* @author Filippo Carone <filippo@carone.org>
*/
package org.videolan.jvlc;
public interface AudioIntf {
void getMute();
void setMute();
void getVolume();
void setVolume();
}
/*
* Created on 28-feb-2006
*
* $Id: InputIntf.java 8 2006-02-28 12:03:47Z little $
*
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
*/
/**
* @author Filippo Carone <filippo@carone.org>
*/
package org.videolan.jvlc;
public interface InputIntf {
void getLength();
void getTime();
void getPosition();
void setTime();
double getFPS();
}
/*
* Created on 28-feb-2006
*
* $Id: JLibVLC.java 9 2006-02-28 18:30:52Z little $
*
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
*/
/**
* @author Filippo Carone <filippo@carone.org>
*/
package org.videolan.jvlc;
public interface JLibVLC extends AudioIntf, VideoIntf, InputIntf { }
/*
* Created on 28-feb-2006
*
* $Id: JVLCPlayer.java 10 2006-02-28 19:07:17Z little $
*
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
*/
/**
* @author Filippo Carone <filippo@carone.org>
*/
package org.videolan.jvlc;
public class JVLC implements JLibVLC {
static {
System.load(System.getProperty("user.dir") + "/libjvlc.so");
}
private long _instance;
public Playlist playlist;
public JVLC() {
_instance = createInstance();
playlist = new Playlist(_instance);
}
public JVLC(String[] args) {
_instance = createInstance(args);
playlist = new Playlist(_instance);
}
private native long createInstance();
private native long createInstance(String[] args);
public void getMute() {
// TODO Auto-generated method stub
}
public void setMute() {
// TODO Auto-generated method stub
}
public void getVolume() {
// TODO Auto-generated method stub
}
public void setVolume() {
// TODO Auto-generated method stub
}
public void toggleFullscreen() {
// TODO Auto-generated method stub
}
public void setFullscreen() {
// TODO Auto-generated method stub
}
public void getFullscreen() {
// TODO Auto-generated method stub
}
public void getLength() {
// TODO Auto-generated method stub
}
public void getTime() {
// TODO Auto-generated method stub
}
public void getPosition() {
// TODO Auto-generated method stub
}
public void setTime() {
// TODO Auto-generated method stub
}
public double getFPS() {
// TODO Auto-generated method stub
return 0;
}
public long getInstance() {
return _instance;
}
}
/*
* Created on 25-nov-2005
*
*
* $Id: JVLCCanvas.java 11 2006-02-28 19:15:51Z little $
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
*/
/**
* @author Filippo Carone <filippo@carone.org>
*/
package org.videolan.jvlc;
import java.awt.Canvas;
import java.awt.Graphics;
public class JVLCCanvas extends Canvas {
public native void paint(Graphics g);
private final JVLC jvlc = new JVLC();
/**
* Default constructor. The canvas is set a dimension of 200x200
*/
public JVLCCanvas() {
setSize(200, 200);
}
/**
* @param width The initial canvas width
* @param height The initial canvas height
*/
public JVLCCanvas(int width, int height) {
setSize(width, height);
}
public JVLC getJVLC() {
return jvlc;
}
}
/*
* Created on 28-nov-2005
*
*
* $Id: JVLCPanel.java 11 2006-02-28 19:15:51Z little $
*
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
*/
/**
* @author Filippo Carone <filippo@carone.org>
*/
package org.videolan.jvlc;
import javax.swing.JPanel;
public class JVLCPanel extends JPanel {
private final JVLCCanvas jvcc;
/**
* Default constructor. The initial size is 200x200
*/
public JVLCPanel() {
jvcc = new JVLCCanvas();
add(jvcc);
}
/**
* @param width The width of the panel
* @param height The height of the panel
*/
public JVLCPanel(int width, int height) {
jvcc = new JVLCCanvas(width, height);
add(jvcc);
}
public JVLC getJVLCObject() {
return jvcc.getJVLC();
}
public void setSize(int width, int height) {
super.setSize(width, height);
jvcc.setSize(width, height);
}
}
/*
* Created on 28-feb-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., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
*/
/**
* @author Filippo Carone <filippo@carone.org>
*/
package org.videolan.jvlc;
public class Playlist implements PlaylistIntf {
private long libvlcInstance;
public Playlist(long _libvlcInstance) {
this.libvlcInstance = _libvlcInstance;
}
native private int _playlist_add(String uri, String name);
native private void _play(int _id, String[] options);
native private void _pause();
native private void _stop();
native private void _next();
native private void _prev();
native private void _clear();
native private int _itemsCount();
native private int _isPlaying();
public void play(int id, String[] options) {
_play(id, options);
}
public void pause() {
_pause();
}
public void stop() {
_stop();
}
public boolean isPlaying() {
return (_isPlaying() == 1)? false : true ;
}
public int itemsCount() {
return _itemsCount();
}
public void next() {
_next();
}
public void prev() {
_prev();
}
public void clear() {
_clear();
}
public int add(String uri, String name) {
return _playlist_add(uri, name);
}
public void addExtended() {
// TODO Auto-generated method stub
}
public long getInstance() {
return libvlcInstance;
}
}
/*
* Created on 28-feb-2006
*
* $Id: PlaylistIntf.java 10 2006-02-28 19:07:17Z little $
*
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
*/
/**
* @author Filippo Carone <filippo@carone.org>
*/
package org.videolan.jvlc;
public interface PlaylistIntf {
void play(int id, String[] options);
void pause();
void stop();
boolean isPlaying();
int itemsCount();
void next();
void prev();
void clear();
int add(String uri, String name);
void addExtended();
}
/*
* Created on 31-mar-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., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
*/
/**
* @author Filippo Carone <filippo@carone.org>
*/
package org.videolan.jvlc;
import org.eclipse.swt.awt.SWT_AWT;
import org.eclipse.swt.widgets.Composite;
import java.awt.Frame;
public class SWTVideoWidget {
/*
* This class implements an SWTCanvas containing VLC Video Output
*/
/*
* The root SWT Frame we embed JVLCCanvas in
*/
public Frame rootFrame;
private JVLCCanvas jvlcCanvas;
/*
* This class 'installs' the VLC video output window
* in a Composite container such as a canvas.
*/
public SWTVideoWidget( Composite parent ) {
// allocate the new AWT Frame to embed in the Composite
rootFrame = SWT_AWT.new_Frame( parent );
// add the JVLCCanvas to the Frame
jvlcCanvas = new JVLCCanvas();
rootFrame.add( jvlcCanvas );
}
public JVLC getJVLC() {
return jvlcCanvas.getJVLC();
}
}
/*
* Created on 28-feb-2006
*
* $Id: VLMIntf.java 8 2006-02-28 12:03:47Z little $
*
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
*/
/**
* @author Filippo Carone <filippo@carone.org>
*/
package org.videolan.jvlc;
public interface VLMIntf {
void addBroadcast();
void deleteMedia();
void setEnabled();
void setOutput();
void setInput();
void setLoop();
void changeMedia();
}
/*
* Created on 28-feb-2006
*
* $Id: VideoIntf.java 8 2006-02-28 12:03:47Z little $
*
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
*/
/**
* @author Filippo Carone <filippo@carone.org>
*/
package org.videolan.jvlc;
public interface VideoIntf {
void toggleFullscreen();
void setFullscreen();
void getFullscreen();
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment