System.out.print("Setting volume to 150... ");
jvlc.audio.setVolume(150);
System.out.println("done");
- System.out.println("Audio channel info: " + jvlc.audio.getChannel());
- System.out.println("Audio track info: " + jvlc.audio.getTrack());
- System.out.print("Setting left channel... ");
- jvlc.audio.setChannel("left");
- System.out.print("done.");
- Thread.sleep(3000);
- System.out.print("Setting right channel... ");
- jvlc.audio.setChannel(AudioIntf.RIGHT_CHANNEL);
- System.out.print("done.");
- Thread.sleep(3000);
+// System.out.println("Audio channel info: " + jvlc.audio.getChannel());
+// System.out.println("Audio track info: " + jvlc.audio.getTrack());
+// System.out.print("Setting left channel... ");
+// jvlc.audio.setChannel("left");
+// System.out.print("done.");
+// Thread.sleep(3000);
+// System.out.print("Setting right channel... ");
+// jvlc.audio.setChannel(AudioIntf.RIGHT_CHANNEL);
+// System.out.print("done.");
+// Thread.sleep(3000);
System.out.println("INPUT INFORMATION");
System.out.println("-----------------");
System.out.println("Total length (ms) :\t" + jvlc.input.getLength());
private native int _getTrack();
private native void _setTrack(int track);
- private native String _getChannel();
- private native void _setChannel(String channel);
+ private native int _getChannel();
+ private native void _setChannel(int channel);
private native boolean _getMute();
private native void _setMute( boolean value );
private native void _toggleMute();
_setTrack(track);
}
- public String getChannel() throws VLCException {
+ public int getChannel() throws VLCException {
return _getChannel();
}
- public void setChannel( String channel ) throws VLCException {
+ public void setChannel( int channel ) throws VLCException {
_setChannel(channel);
}
* @return channel
* @throws VLCException
*/
- String getChannel() throws VLCException;
+ int getChannel() throws VLCException;
/**
* @param channel
* @throws VLCException
*/
- void setChannel(String channel) throws VLCException;
+ void setChannel(int channel) throws VLCException;
/**
CHECK_EXCEPTION_FREE;
}
-JNIEXPORT jstring JNICALL Java_org_videolan_jvlc_Audio__1getChannel (JNIEnv *env, jobject _this)
+JNIEXPORT jint JNICALL Java_org_videolan_jvlc_Audio__1getChannel (JNIEnv *env, jobject _this)
{
INIT_FUNCTION;
- char* res;
-
- res = libvlc_audio_get_channel( ( libvlc_instance_t * ) instance, exception);
+ int res = libvlc_audio_get_channel( ( libvlc_instance_t * ) instance, exception);
CHECK_EXCEPTION_FREE;
- return env->NewStringUTF(res);
+ return res;
}
-JNIEXPORT void JNICALL Java_org_videolan_jvlc_Audio__1setChannel (JNIEnv *env, jobject _this, jstring channel)
+JNIEXPORT void JNICALL Java_org_videolan_jvlc_Audio__1setChannel (JNIEnv *env, jobject _this, jint channel)
{
INIT_FUNCTION;
- const char* value = env->GetStringUTFChars( channel, 0 );
+ libvlc_audio_set_channel( (libvlc_instance_t *) instance, channel, exception);
- libvlc_audio_set_channel( (libvlc_instance_t *) instance, (char *) value, exception);
-
- env->ReleaseStringUTFChars( channel, value );
-
CHECK_EXCEPTION_FREE;
}