1 /*****************************************************************************
2 * audio-jni.cc: JNI native audio functions for VLC Java Bindings
3 *****************************************************************************
4 * Copyright (C) 1998-2006 the VideoLAN team
6 * Authors: Filippo Carone <filippo@carone.org>
7 * Philippe Morin <phmorin@free.fr>
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
25 *****************************************************************************/
30 #include <vlc/libvlc.h>
32 /* JVLC internal imports, generated by gcjh */
33 #include "../includes/Audio.h"
36 JNIEXPORT jint JNICALL Java_org_videolan_jvlc_Audio__1getTrack (JNIEnv *env, jobject _this)
41 res = libvlc_audio_get_track( ( libvlc_instance_t * ) instance, exception );
48 JNIEXPORT void JNICALL Java_org_videolan_jvlc_Audio__1setTrack (JNIEnv *env, jobject _this, jint value)
52 libvlc_audio_set_track( ( libvlc_instance_t * ) instance, value, exception );
57 JNIEXPORT jstring JNICALL Java_org_videolan_jvlc_Audio__1getChannel (JNIEnv *env, jobject _this)
63 res = libvlc_audio_get_channel( (libvlc_instance_t *) instance, exception);
67 return env->NewStringUTF(res);
70 JNIEXPORT void JNICALL Java_org_videolan_jvlc_Audio__1setChannel (JNIEnv *env, jobject _this, jstring channel)
74 const char* value = env->GetStringUTFChars( channel, 0 );
76 libvlc_audio_set_channel( (libvlc_instance_t *) instance, (char *) value, exception);
78 env->ReleaseStringUTFChars( channel, value );
84 JNIEXPORT jboolean JNICALL Java_org_videolan_jvlc_Audio__1getMute (JNIEnv *env, jobject _this)
89 res = (jboolean) libvlc_audio_get_mute( ( libvlc_instance_t * ) instance, exception );
97 JNIEXPORT void JNICALL Java_org_videolan_jvlc_Audio__1setMute (JNIEnv *env, jobject _this, jboolean value)
101 libvlc_audio_set_mute( ( libvlc_instance_t * ) instance, value, exception );
103 CHECK_EXCEPTION_FREE;
106 JNIEXPORT void JNICALL Java_org_videolan_jvlc_Audio__1toggleMute (JNIEnv *env, jobject _this)
110 libvlc_audio_get_mute( ( libvlc_instance_t * ) instance, exception );
112 CHECK_EXCEPTION_FREE;
115 JNIEXPORT jint JNICALL Java_org_videolan_jvlc_Audio__1getVolume (JNIEnv *env, jobject _this)
120 res = libvlc_audio_get_volume( ( libvlc_instance_t * ) instance, exception );
122 CHECK_EXCEPTION_FREE;
127 JNIEXPORT void JNICALL Java_org_videolan_jvlc_Audio__1setVolume (JNIEnv *env, jobject _this, jint volume)
131 libvlc_audio_set_volume( ( libvlc_instance_t * ) instance, volume, exception );
133 CHECK_EXCEPTION_FREE;