This commit is contained in:
BIN
lib/wiiuse.lib
BIN
lib/wiiuse.lib
Binary file not shown.
@@ -376,8 +376,9 @@ typedef struct ir_t {
|
|||||||
*/
|
*/
|
||||||
typedef struct speaker_t {
|
typedef struct speaker_t {
|
||||||
byte format;
|
byte format;
|
||||||
byte vol;
|
|
||||||
byte rate;
|
byte rate;
|
||||||
|
byte freq;
|
||||||
|
byte vol;
|
||||||
} speaker_t;
|
} speaker_t;
|
||||||
|
|
||||||
|
|
||||||
@@ -663,7 +664,7 @@ WIIUSE_EXPORT extern void wiiuse_speaker_activate(struct wiimote_t* wm);
|
|||||||
WIIUSE_EXPORT extern void wiiuse_speaker_deactivate(struct wiimote_t* wm);
|
WIIUSE_EXPORT extern void wiiuse_speaker_deactivate(struct wiimote_t* wm);
|
||||||
WIIUSE_EXPORT extern void wiiuse_speaker_format(struct wiimote_t* wm, byte format);
|
WIIUSE_EXPORT extern void wiiuse_speaker_format(struct wiimote_t* wm, byte format);
|
||||||
WIIUSE_EXPORT extern void wiiuse_speaker_volume(struct wiimote_t* wm, double vol);
|
WIIUSE_EXPORT extern void wiiuse_speaker_volume(struct wiimote_t* wm, double vol);
|
||||||
WIIUSE_EXPORT extern void wiiuse_speaker_rate(struct wiimote_t* wm, double freq);
|
WIIUSE_EXPORT extern void wiiuse_speaker_rate(struct wiimote_t* wm, byte rate, byte freq);
|
||||||
WIIUSE_EXPORT extern void wiiuse_speaker_config(struct wiimote_t* wm);
|
WIIUSE_EXPORT extern void wiiuse_speaker_config(struct wiimote_t* wm);
|
||||||
WIIUSE_EXPORT extern void wiiuse_speaker_data(struct wiimote_t* wm, byte* data, int len);
|
WIIUSE_EXPORT extern void wiiuse_speaker_data(struct wiimote_t* wm, byte* data, int len);
|
||||||
|
|
||||||
|
|||||||
@@ -710,38 +710,28 @@ JNIEXPORT void JNICALL Java_wiiusej_WiiUseApi_deactivateSpeaker(JNIEnv *env, job
|
|||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_wiiusej_WiiUseApi_setSpeakerFormat(JNIEnv *env, jobject obj, jint id, jbyte format) {
|
JNIEXPORT void JNICALL Java_wiiusej_WiiUseApi_setSpeakerFormat(JNIEnv *env, jobject obj, jint id, jbyte format) {
|
||||||
struct wiimote_t* wm = wiiuse_get_by_id(wiimotes, nbMaxWiimotes, id);
|
wiiuse_speaker_format(wiiuse_get_by_id(wiimotes, nbMaxWiimotes, id), format);
|
||||||
wiiuse_speaker_config(wm);
|
|
||||||
wiiuse_speaker_format(wm, format);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_wiiusej_WiiUseApi_setSpeakerRate(JNIEnv *env, jobject obj, jint id, jint rate) {
|
JNIEXPORT void JNICALL Java_wiiusej_WiiUseApi_setSpeakerRate(JNIEnv *env, jobject obj, jint id, jbyte rate, jbyte freq) {
|
||||||
struct wiimote_t* wm = wiiuse_get_by_id(wiimotes, nbMaxWiimotes, id);
|
wiiuse_speaker_rate(wiiuse_get_by_id(wiimotes, nbMaxWiimotes, id), rate, freq);
|
||||||
wiiuse_speaker_rate(wm, rate);
|
|
||||||
wiiuse_speaker_config(wm);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_wiiusej_WiiUseApi_setSpeakerVolume(JNIEnv *env, jobject obj, jint id, jdouble vol) {
|
JNIEXPORT void JNICALL Java_wiiusej_WiiUseApi_setSpeakerVolume(JNIEnv *env, jobject obj, jint id, jdouble vol) {
|
||||||
struct wiimote_t* wm = wiiuse_get_by_id(wiimotes, nbMaxWiimotes, id);
|
wiiuse_speaker_volume(wiiuse_get_by_id(wiimotes, nbMaxWiimotes, id), vol);
|
||||||
wiiuse_speaker_volume(wm, vol);
|
|
||||||
wiiuse_speaker_config(wm);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_wiiusej_WiiUseApi_setSpeakerConfig(JNIEnv *env, jobject obj, jint id, jbyte format, jint rate, jdouble vol) {
|
JNIEXPORT void JNICALL Java_wiiusej_WiiUseApi_setSpeakerConfig(JNIEnv *env, jobject obj, jint id) {
|
||||||
struct wiimote_t* wm = wiiuse_get_by_id(wiimotes, nbMaxWiimotes, id);
|
wiiuse_speaker_config(wiiuse_get_by_id(wiimotes, nbMaxWiimotes, id));
|
||||||
wiiuse_speaker_format(wm, format);
|
|
||||||
wiiuse_speaker_rate(wm, rate);
|
|
||||||
wiiuse_speaker_volume(wm, vol);
|
|
||||||
wiiuse_speaker_config(wm);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_wiiusej_WiiUseApi_streamSpeakerData(JNIEnv *env, jobject obj, jint id, jbyteArray jbArray) {
|
JNIEXPORT void JNICALL Java_wiiusej_WiiUseApi_streamSpeakerData(JNIEnv *env, jobject obj, jint id, jbyteArray jbArray) {
|
||||||
jbyte *jbData = (*env)->GetByteArrayElements(env, jbArray, JNI_FALSE);
|
jbyte *jbData = (*env)->GetByteArrayElements(env, jbArray, JNI_FALSE);
|
||||||
/* Todo: Check for data loss by using signed vs unsigned bytes */
|
/* Todo: Check for data loss by using signed vs unsigned bytes */
|
||||||
int len = (int) (*env)->GetArrayLength(env, jbArray);
|
int len = (int) (*env)->GetArrayLength(env, jbArray);
|
||||||
/*byte data[length];
|
/*byte data[len];
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (i = 0; i < length; ++i) {
|
for (i = 0; i < len; ++i) {
|
||||||
data[i] = (byte) jbData[i];
|
data[i] = (byte) jbData[i];
|
||||||
}*/
|
}*/
|
||||||
wiiuse_speaker_data(wiiuse_get_by_id(wiimotes, nbMaxWiimotes, id), (byte*) jbData, len);
|
wiiuse_speaker_data(wiiuse_get_by_id(wiimotes, nbMaxWiimotes, id), (byte*) jbData, len);
|
||||||
|
|||||||
@@ -333,7 +333,7 @@ JNIEXPORT void JNICALL Java_wiiusej_WiiUseApi_setSpeakerFormat
|
|||||||
* Signature: (II)V
|
* Signature: (II)V
|
||||||
*/
|
*/
|
||||||
JNIEXPORT void JNICALL Java_wiiusej_WiiUseApi_setSpeakerRate
|
JNIEXPORT void JNICALL Java_wiiusej_WiiUseApi_setSpeakerRate
|
||||||
(JNIEnv *, jobject, jint, jint);
|
(JNIEnv *, jobject, jint, jbyte, jbyte);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: wiiusej_WiiUseApi
|
* Class: wiiusej_WiiUseApi
|
||||||
@@ -349,7 +349,7 @@ JNIEXPORT void JNICALL Java_wiiusej_WiiUseApi_setSpeakerVolume
|
|||||||
* Signature: (IBID)V
|
* Signature: (IBID)V
|
||||||
*/
|
*/
|
||||||
JNIEXPORT void JNICALL Java_wiiusej_WiiUseApi_setSpeakerConfig
|
JNIEXPORT void JNICALL Java_wiiusej_WiiUseApi_setSpeakerConfig
|
||||||
(JNIEnv *, jobject, jint, jbyte, jint, jdouble);
|
(JNIEnv *, jobject, jint);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: wiiusej_WiiUseApi
|
* Class: wiiusej_WiiUseApi
|
||||||
|
|||||||
Reference in New Issue
Block a user