]> git.sesse.net Git - vlc/blob - bindings/java/core/src/main/java/org/videolan/jvlc/VLM.java
4f4c4161c22e6f0fb62ad2a3c39888a43180ebdc
[vlc] / bindings / java / core / src / main / java / org / videolan / jvlc / VLM.java
1 /*****************************************************************************
2  * VLM.java: VLC Java Bindings
3  *****************************************************************************
4  * Copyright (C) 1998-2008 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 import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t;
29
30
31 public class VLM
32 {
33     private JVLC jvlc;
34
35     public VLM(JVLC jvlc)
36     {
37         this.jvlc = jvlc;
38     }
39
40     public void addBroadcast(String name, String input, String output, String[] options, boolean enabled, boolean loop)
41     {
42         libvlc_exception_t exception = new libvlc_exception_t();
43         jvlc.getLibvlc().libvlc_vlm_add_broadcast(
44             jvlc.getInstance(),
45             name,
46             input,
47             output,
48             options.length,
49             options,
50             enabled ? 1 : 0,
51             loop ? 1 : 0,
52             exception);
53     }
54
55     public void deleteMedia(String name)
56     {
57         libvlc_exception_t exception = new libvlc_exception_t();
58         jvlc.getLibvlc().libvlc_vlm_del_media(jvlc.getInstance(), name, exception);
59     }
60
61     public void enableMedia(String name)
62     {
63         libvlc_exception_t exception = new libvlc_exception_t();
64         jvlc.getLibvlc().libvlc_vlm_set_enabled(jvlc.getInstance(), name, 1, exception);
65     }
66
67     public void disableMedia(String name)
68     {
69         libvlc_exception_t exception = new libvlc_exception_t();
70         jvlc.getLibvlc().libvlc_vlm_set_enabled(jvlc.getInstance(), name, 0, exception);
71     }
72
73     public void setMediaOutput(String name, String output)
74     {
75         libvlc_exception_t exception = new libvlc_exception_t();
76         jvlc.getLibvlc().libvlc_vlm_set_output(jvlc.getInstance(), name, output, exception);
77     }
78
79     public void setMediaInput(String name, String input)
80     {
81         libvlc_exception_t exception = new libvlc_exception_t();
82         jvlc.getLibvlc().libvlc_vlm_set_input(jvlc.getInstance(), name, input, exception);
83     }
84
85     public void addMediaInput(String name, String input)
86     {
87         libvlc_exception_t exception = new libvlc_exception_t();
88         jvlc.getLibvlc().libvlc_vlm_add_input(jvlc.getInstance(), name, input, exception);
89     }
90
91     public void setMediaLoop(String media, boolean loop)
92     {
93         libvlc_exception_t exception = new libvlc_exception_t();
94         jvlc.getLibvlc().libvlc_vlm_set_loop(jvlc.getInstance(), media, loop ? 1 : 0, exception);
95     }
96
97     public void changeMedia(String name, String input, String output, String[] options, boolean enabled, boolean loop)
98     {
99         libvlc_exception_t exception = new libvlc_exception_t();
100         jvlc.getLibvlc().libvlc_vlm_change_media(
101             jvlc.getInstance(),
102             name,
103             input,
104             output,
105             options.length,
106             options,
107             enabled ? 1 : 0,
108             loop ? 1 : 0,
109             exception);
110     }
111
112     public void playMedia(String name)
113     {
114         libvlc_exception_t exception = new libvlc_exception_t();
115         jvlc.getLibvlc().libvlc_vlm_play_media(jvlc.getInstance(), name, exception);
116     }
117     
118     public void stopMedia(String name)
119     {
120         libvlc_exception_t exception = new libvlc_exception_t();
121         jvlc.getLibvlc().libvlc_vlm_stop_media(jvlc.getInstance(), name, exception);
122     }
123     
124     public void pauseMedia(String name)
125     {
126         libvlc_exception_t exception = new libvlc_exception_t();
127         jvlc.getLibvlc().libvlc_vlm_pause_media(jvlc.getInstance(), name, exception);
128     }
129
130     public void seekMedia(String name, float percentage)
131     {
132         libvlc_exception_t exception = new libvlc_exception_t();
133         jvlc.getLibvlc().libvlc_vlm_seek_media(jvlc.getInstance(), name, percentage, exception);
134     }
135
136     public void showMedia(String name)
137     {
138         libvlc_exception_t exception = new libvlc_exception_t();
139         jvlc.getLibvlc().libvlc_vlm_show_media(jvlc.getInstance(), name, exception);
140     }
141
142     /**
143      * 
144      */
145     public void release()
146     {
147         libvlc_exception_t exception = new libvlc_exception_t();
148         jvlc.getLibvlc().libvlc_vlm_release(jvlc.getInstance(), exception);
149     }
150
151     
152 }