]> git.sesse.net Git - vlc/blob - bindings/java/org/videolan/jvlc/MediaInstance.java
fix dependancies
[vlc] / bindings / java / org / videolan / jvlc / MediaInstance.java
1 /*****************************************************************************
2  * MediaInstance.java: VLC Java Bindings
3  *****************************************************************************
4  * Copyright (C) 1998-2007 the VideoLAN team
5  *
6  * Authors: Filippo Carone <filippo@carone.org>
7  *
8  *
9  * $Id $
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
24  *****************************************************************************/
25
26 package org.videolan.jvlc;
27
28
29 public class MediaInstance
30 {
31     private long _media_instance;
32
33     private native long _new_media_instance();
34     private native long _new_from_media_descriptor(MediaDescriptor mediaDescriptor);
35     private native void _instance_release(long mediaInstance);
36     private native void _instance_retain();
37     private native void _set_media_descriptor();
38     private native MediaDescriptor _get_media_descriptor();
39     private native EventManager _event_manager();
40     private native void _play();
41     private native void _stop();
42     private native void _pause();
43     private native void _set_drawable();
44     private native long _get_length();
45     private native long _get_time();
46     private native void _set_time(long time);
47     private native float _get_position();
48     private native void _set_position(float position);
49     private native boolean _will_play();
50     private native float _get_rate();
51     private native void _set_rate(float rate);
52     private native void _get_state();
53     private native boolean _has_vout();
54     private native float _get_fps();
55     
56     public MediaInstance()
57     {
58         this._media_instance = _new_media_instance();
59     }
60     
61     public MediaInstance(MediaDescriptor mediaDescriptor)
62     {
63         this._media_instance = _new_from_media_descriptor(mediaDescriptor);
64     }
65     
66     public MediaDescriptor getMediaDescriptor()
67     {
68         return _get_media_descriptor();
69     }
70     
71     public void setMediaDescriptor(MediaDescriptor mediaDescriptor)
72     {
73         _new_from_media_descriptor(mediaDescriptor);
74     }
75     
76     public EventManager getEventManager()
77     {
78         return _event_manager();
79     }
80     
81     public void play()
82     {
83         _play();
84     }
85     
86     public void stop()
87     {
88         _stop();
89     }
90     
91     public void pause()
92     {
93         _pause();
94     }
95
96     public long getLength()
97     {
98         return _get_length();
99     }
100     
101     public long getTime()
102     {
103         return _get_time();
104     }
105     
106     public void setTime(long time)
107     {
108         _set_time(time);
109     }
110     
111     public float getPosition()
112     {
113         return _get_position();
114     }
115     
116     public void setPosition(float position)
117     {
118         _set_position(position);
119     }
120     
121     public boolean willPlay()
122     {
123         return _will_play();
124     }
125     
126     public float getRate()
127     {
128         return _get_rate();
129     }
130     
131     public void setRate(float rate)
132     {
133         _set_rate(rate);
134     }
135     
136     public boolean hasVideoOutput()
137     {
138         return _has_vout();
139     }
140     
141     public float getFPS()
142     {
143         return _get_fps();
144     }
145     
146     /**
147      * {@inheritDoc}
148      */
149     @Override
150     protected void finalize() throws Throwable
151     {
152         super.finalize();
153         _instance_release(_media_instance);
154     }
155     
156     
157     
158     
159 }