Commit 86e50bb4 authored by Filippo Carone's avatar Filippo Carone

Makefile typo fixed

VlcClient.java and VlcClient class now match.
parent 07d2edfc
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
if BUILD_JAVA if BUILD_JAVA
JVLCOBJECTS = org/videolan/jvlc/JVLCCanvas.class org/videolan/jvlc/JVLCPanel.class org/videolan/jvlc/AudioIntf.class org/videolan/jvlc/InputIntf.class org/videolan/jvlc/PlaylistIntf.class org/videolan/jvlc/VideoIntf.class org/videolan/jvlc/VLMIntf.class org/videolan/jvlc/Playlist.class org/videolan/jvlc/JLibVLC.class org/videolan/jvlc/JVLC.class org/videolan/jvlc/SWTVideoWidget.class OBJECTS = org/videolan/jvlc/JVLCCanvas.class org/videolan/jvlc/JVLCPanel.class org/videolan/jvlc/AudioIntf.class org/videolan/jvlc/InputIntf.class org/videolan/jvlc/PlaylistIntf.class org/videolan/jvlc/VideoIntf.class org/videolan/jvlc/VLMIntf.class org/videolan/jvlc/Playlist.class org/videolan/jvlc/JLibVLC.class org/videolan/jvlc/JVLC.class org/videolan/jvlc/SWTVideoWidget.class
JNIHEADERS = org_videolan_jvlc_JVLC.h org_videolan_jvlc_JVLCCanvas.h org_videolan_jvlc_JVLCPanel.h JNIHEADERS = org_videolan_jvlc_JVLC.h org_videolan_jvlc_JVLCCanvas.h org_videolan_jvlc_JVLCPanel.h
......
/***************************************************************************** import java.awt.Frame;
* JVLC.java: global class for vlc Java Bindings import java.awt.event.WindowAdapter;
***************************************************************************** import java.awt.event.WindowEvent;
* Copyright (C) 1998-2004 the VideoLAN team
* import org.videolan.jvlc.JVLCPanel;
* $Id$ import org.videolan.jvlc.JVLC;
*
* Authors: Filippo Carone <filippo@carone.org>
*
* 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.
*****************************************************************************/
import org.videolan.jvlc.*;
import java.awt.*;
import java.awt.event.*;
class VLCPlayerFrame extends Frame { class VLCPlayerFrame extends Frame {
public VLCPlayerFrame() { public VLCPlayerFrame() {
...@@ -33,28 +11,26 @@ class VLCPlayerFrame extends Frame { ...@@ -33,28 +11,26 @@ class VLCPlayerFrame extends Frame {
} }
private void initComponents() { private void initComponents() {
java.awt.GridBagConstraints gridBagConstraints;
fullScreenButton = new javax.swing.JButton(); java.awt.GridBagConstraints gridBagConstraints;
jTextField1 = new javax.swing.JTextField();
setButton = new javax.swing.JButton(); fullScreenButton = new javax.swing.JButton();
pauseButton = new javax.swing.JButton(); jTextField1 = new javax.swing.JTextField();
stopButton = new javax.swing.JButton(); setButton = new javax.swing.JButton();
pauseButton = new javax.swing.JButton();
stopButton = new javax.swing.JButton();
jvcc = new JVLCCanvas(); jvcc = new JVLCPanel();
jvcc.setSize( 100, 100 ); jvlc = jvcc.getJVLCObject();
jvlc = jvcc.getJVLCObject();
// FIXME: Does not work with GridBagLayout setLayout(new java.awt.GridBagLayout());
setLayout(new java.awt.GridBagLayout());
gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints.gridwidth = java.awt.GridBagConstraints.CENTER;
gridBagConstraints.gridx = 0; gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 0; gridBagConstraints.gridy = 0;
add( jvcc , gridBagConstraints); add( jvcc , gridBagConstraints);
fullScreenButton.setText("FullScreen"); fullScreenButton.setText("FullScreen");
fullScreenButton.addActionListener(new java.awt.event.ActionListener() { fullScreenButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) { public void actionPerformed(java.awt.event.ActionEvent evt) {
...@@ -69,7 +45,7 @@ class VLCPlayerFrame extends Frame { ...@@ -69,7 +45,7 @@ class VLCPlayerFrame extends Frame {
add( fullScreenButton, gridBagConstraints); add( fullScreenButton, gridBagConstraints);
jTextField1.setText("URL"); jTextField1.setText("file:///home/little/a.avi");
gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0; gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 1; gridBagConstraints.gridy = 1;
...@@ -114,27 +90,38 @@ class VLCPlayerFrame extends Frame { ...@@ -114,27 +90,38 @@ class VLCPlayerFrame extends Frame {
gridBagConstraints.gridy = 2; gridBagConstraints.gridy = 2;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
add(stopButton, gridBagConstraints); add(stopButton, gridBagConstraints);
pack(); pack();
} }
private void stopButtonActionPerformed(java.awt.event.ActionEvent evt) { private void stopButtonActionPerformed(java.awt.event.ActionEvent evt) {
jvlc.stop(); try {
//mci.stop(new Position(10000, PositionOrigin.ABSOLUTE, PositionKey.MEDIATIME));
jvlc.playlist.stop();
} catch (Exception e) {
e.printStackTrace();
}
} }
private void pauseButtonActionPerformed(java.awt.event.ActionEvent evt) { private void pauseButtonActionPerformed(java.awt.event.ActionEvent evt) {
jvlc.pause(); try {
//System.out.println(mci.getMediaPosition(PositionOrigin.ABSOLUTE, PositionKey.BYTECOUNT));
jvlc.playlist.pause();
} catch (Exception e) {
e.printStackTrace();
}
} }
private void setButtonActionPerformed(java.awt.event.ActionEvent evt) { private void setButtonActionPerformed(java.awt.event.ActionEvent evt) {
jvlc.stop(); jvlc.playlist.add("file:///home/little/a.avi", "a.avi");
jvlc.playlistClear(); jvlc.playlist.play(-1, null);
jvlc.addTarget( jTextField1.getText(), null, 1, -666 );
jvlc.play();
} }
private void fullScreenButtonActionPerformed(java.awt.event.ActionEvent evt) { private void fullScreenButtonActionPerformed(java.awt.event.ActionEvent evt) {
jvlc.fullScreen(); //jvlc.fullScreen();
} }
private javax.swing.JButton setButton; private javax.swing.JButton setButton;
...@@ -142,22 +129,23 @@ class VLCPlayerFrame extends Frame { ...@@ -142,22 +129,23 @@ class VLCPlayerFrame extends Frame {
private javax.swing.JButton stopButton; private javax.swing.JButton stopButton;
private javax.swing.JButton fullScreenButton; private javax.swing.JButton fullScreenButton;
private javax.swing.JTextField jTextField1; private javax.swing.JTextField jTextField1;
private javax.swing.JPanel jPanel; private JVLCPanel jvcc;
private JVLCCanvas jvcc;
public JVLC jvlc; public JVLC jvlc;
//MediaControlInstance mci;
} }
public class VlcClient { public class VlcClient {
public static void main(String[] args) { public static void main(String[] args) {
Frame f = new VLCPlayerFrame(); Frame f = new VLCPlayerFrame();
f.setBounds(0, 0, 500, 500); f.setBounds(0, 0, 500, 500);
f.addWindowListener( new WindowAdapter() { f.addWindowListener( new WindowAdapter() {
public void windowClosing(WindowEvent ev) { public void windowClosing(WindowEvent ev) {
System.exit(0); System.exit(0);
} }
} ); } );
f.setVisible(true); f.setVisible(true);
} }
} }
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