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