comparison Alc/backends/send.c @ 7:37f25cb34196

transferred native interface for send.c to this project
author Robert McIntyre <rlm@mit.edu>
date Wed, 26 Oct 2011 10:42:15 -0700
parents f9476ff7637e
children 92b416b4e027
comparison
equal deleted inserted replaced
6:99df34265b40 7:37f25cb34196
272 } 272 }
273 273
274 274
275 //////////////////// JNI Methods 275 //////////////////// JNI Methods
276 276
277 #include "com_aurellem_capture_AudioSend.h" 277 #include "com_aurellem_send_AudioSend.h"
278 278
279 /* 279 /*
280 * Class: com_aurellem_capture_AudioSend 280 * Class: com_aurellem_send_AudioSend
281 * Method: nstep 281 * Method: nstep
282 * Signature: (JI)V 282 * Signature: (JI)V
283 */ 283 */
284 JNIEXPORT void JNICALL Java_com_aurellem_capture_AudioSend_nstep 284 JNIEXPORT void JNICALL Java_com_aurellem_send_AudioSend_nstep
285 (JNIEnv *env, jclass clazz, jlong device, jint samples){ 285 (JNIEnv *env, jclass clazz, jlong device, jint samples){
286 UNUSED(env);UNUSED(clazz);UNUSED(device); 286 UNUSED(env);UNUSED(clazz);UNUSED(device);
287 renderData((ALCdevice*)((intptr_t)device), samples); 287 renderData((ALCdevice*)((intptr_t)device), samples);
288 } 288 }
289 289
290 /* 290 /*
291 * Class: com_aurellem_capture_AudioSend 291 * Class: com_aurellem_send_AudioSend
292 * Method: ngetSamples 292 * Method: ngetSamples
293 * Signature: (JLjava/nio/ByteBuffer;III)V 293 * Signature: (JLjava/nio/ByteBuffer;III)V
294 */ 294 */
295 JNIEXPORT void JNICALL Java_com_aurellem_capture_AudioSend_ngetSamples 295 JNIEXPORT void JNICALL Java_com_aurellem_send_AudioSend_ngetSamples
296 (JNIEnv *env, jclass clazz, jlong device, jobject buffer, jint position, 296 (JNIEnv *env, jclass clazz, jlong device, jobject buffer, jint position,
297 jint samples, jint n){ 297 jint samples, jint n){
298 UNUSED(clazz); 298 UNUSED(clazz);
299 299
300 ALvoid *buffer_address = 300 ALvoid *buffer_address =
307 } 307 }
308 memcpy(buffer_address, data->contexts[n]->renderBuffer, samples*sizeof(ALfloat)); 308 memcpy(buffer_address, data->contexts[n]->renderBuffer, samples*sizeof(ALfloat));
309 } 309 }
310 310
311 /* 311 /*
312 * Class: com_aurellem_capture_AudioSend 312 * Class: com_aurellem_send_AudioSend
313 * Method: naddListener 313 * Method: naddListener
314 * Signature: (J)V 314 * Signature: (J)V
315 */ 315 */
316 JNIEXPORT void JNICALL Java_com_aurellem_capture_AudioSend_naddListener 316 JNIEXPORT void JNICALL Java_com_aurellem_send_AudioSend_naddListener
317 (JNIEnv *env, jclass clazz, jlong device){ 317 (JNIEnv *env, jclass clazz, jlong device){
318 UNUSED(env); UNUSED(clazz); 318 UNUSED(env); UNUSED(clazz);
319 printf("creating new context via naddListener\n"); 319 printf("creating new context via naddListener\n");
320 ALCdevice *Device = (ALCdevice*) ((intptr_t)device); 320 ALCdevice *Device = (ALCdevice*) ((intptr_t)device);
321 ALCcontext *new = alcCreateContext(Device, NULL); 321 ALCcontext *new = alcCreateContext(Device, NULL);
322 addContext(Device, new); 322 addContext(Device, new);
323 } 323 }
324 324
325 /* 325 /*
326 * Class: com_aurellem_capture_AudioSend 326 * Class: com_aurellem_send_AudioSend
327 * Method: nsetNthListener3f 327 * Method: nsetNthListener3f
328 * Signature: (IFFFJI)V 328 * Signature: (IFFFJI)V
329 */ 329 */
330 JNIEXPORT void JNICALL Java_com_aurellem_capture_AudioSend_nsetNthListener3f 330 JNIEXPORT void JNICALL Java_com_aurellem_send_AudioSend_nsetNthListener3f
331 (JNIEnv *env, jclass clazz, jint param, 331 (JNIEnv *env, jclass clazz, jint param,
332 jfloat v1, jfloat v2, jfloat v3, jlong device, jint contextNum){ 332 jfloat v1, jfloat v2, jfloat v3, jlong device, jint contextNum){
333 UNUSED(env);UNUSED(clazz); 333 UNUSED(env);UNUSED(clazz);
334 334
335 ALCdevice *Device = (ALCdevice*) ((intptr_t)device); 335 ALCdevice *Device = (ALCdevice*) ((intptr_t)device);
341 alListener3f(param, v1, v2, v3); 341 alListener3f(param, v1, v2, v3);
342 alcMakeContextCurrent(current); 342 alcMakeContextCurrent(current);
343 } 343 }
344 344
345 /* 345 /*
346 * Class: com_aurellem_capture_AudioSend 346 * Class: com_aurellem_send_AudioSend
347 * Method: nsetNthListenerf 347 * Method: nsetNthListenerf
348 * Signature: (IFJI)V 348 * Signature: (IFJI)V
349 */ 349 */
350 JNIEXPORT void JNICALL Java_com_aurellem_capture_AudioSend_nsetNthListenerf 350 JNIEXPORT void JNICALL Java_com_aurellem_send_AudioSend_nsetNthListenerf
351 (JNIEnv *env, jclass clazz, jint param, jfloat v1, jlong device, 351 (JNIEnv *env, jclass clazz, jint param, jfloat v1, jlong device,
352 jint contextNum){ 352 jint contextNum){
353 353
354 UNUSED(env);UNUSED(clazz); 354 UNUSED(env);UNUSED(clazz);
355 355
362 alListenerf(param, v1); 362 alListenerf(param, v1);
363 alcMakeContextCurrent(current); 363 alcMakeContextCurrent(current);
364 } 364 }
365 365
366 /* 366 /*
367 * Class: com_aurellem_capture_AudioSend 367 * Class: com_aurellem_send_AudioSend
368 * Method: ninitDevice 368 * Method: ninitDevice
369 * Signature: (J)V 369 * Signature: (J)V
370 */ 370 */
371 JNIEXPORT void JNICALL Java_com_aurellem_capture_AudioSend_ninitDevice 371 JNIEXPORT void JNICALL Java_com_aurellem_send_AudioSend_ninitDevice
372 (JNIEnv *env, jclass clazz, jlong device){ 372 (JNIEnv *env, jclass clazz, jlong device){
373 UNUSED(env);UNUSED(clazz); 373 UNUSED(env);UNUSED(clazz);
374 374
375 ALCdevice *Device = (ALCdevice*) ((intptr_t)device); 375 ALCdevice *Device = (ALCdevice*) ((intptr_t)device);
376 init(Device); 376 init(Device);