]> git.sesse.net Git - vlc/blob - bindings/java/src/audio-jni.cc
6d90b925154f44139e72d0c04791de8d6635bfb2
[vlc] / bindings / java / src / audio-jni.cc
1 /*****************************************************************************
2  * audio-jni.cc: JNI native audio functions for VLC Java Bindings
3  *****************************************************************************
4  * Copyright (C) 1998-2006 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 /* These are a must*/
27 #include <jni.h>
28
29 #include <vlc/libvlc.h>
30
31 /* JVLC internal imports, generated by gcjh */
32 #include "../includes/Audio.h"
33 #include "utils.h"
34
35 JNIEXPORT jboolean JNICALL Java_org_videolan_jvlc_Audio__1getMute (JNIEnv *env, jobject _this) 
36 {
37     INIT_FUNCTION;
38     jboolean res;
39
40     res = (jboolean) libvlc_audio_get_mute( ( libvlc_instance_t * ) instance, exception );
41
42     CHECK_EXCEPTION;
43
44     return res;
45     
46 }
47
48 JNIEXPORT void JNICALL Java_org_videolan_jvlc_Audio__1setMute (JNIEnv *env, jobject _this, jboolean value) 
49 {
50     INIT_FUNCTION;
51
52     libvlc_audio_set_mute( ( libvlc_instance_t * ) instance, value, exception );
53
54     CHECK_EXCEPTION;
55 }
56
57 JNIEXPORT void JNICALL Java_org_videolan_jvlc_Audio__1toggleMute (JNIEnv *env, jobject _this) 
58 {
59     INIT_FUNCTION;
60
61     libvlc_audio_get_mute( ( libvlc_instance_t * ) instance, exception );
62     
63     CHECK_EXCEPTION;
64 }
65
66 JNIEXPORT jint JNICALL Java_org_videolan_jvlc_Audio__1getVolume (JNIEnv *env, jobject _this)
67 {
68     INIT_FUNCTION;
69     jint res = 0;
70
71     res = libvlc_audio_get_volume( ( libvlc_instance_t * ) instance, exception );
72
73     CHECK_EXCEPTION;
74
75     return res;
76 }
77
78 JNIEXPORT void JNICALL Java_org_videolan_jvlc_Audio__1setVolume (JNIEnv *env, jobject _this, jint volume)
79 {
80     INIT_FUNCTION;
81
82     libvlc_audio_set_volume( ( libvlc_instance_t * ) instance, volume, exception );
83
84     CHECK_EXCEPTION;
85 }
86