comparison jssmix.c @ 36:f3407a58e01e

Change DMFixedPoint types and appropriate JSS functions back to using signed integers, easier than trying to get unsigned sizes etc. to work properly in audio mixing.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 29 Sep 2012 20:41:36 +0300
parents 7908061da010
children 033c660c25f5
comparison
equal deleted inserted replaced
35:fb5200deeda8 36:f3407a58e01e
25 typedef struct 25 typedef struct
26 { 26 {
27 int mixerID; 27 int mixerID;
28 int outFormat; 28 int outFormat;
29 int outChannels; 29 int outChannels;
30 int (*jvmMixChannel_FW)(JSSMixer *, JSSChannel *, Sint32 *, const int, const Uint32); 30 int (*jvmMixChannel_FW)(JSSMixer *, JSSChannel *, Sint32 *, const int, const Sint32);
31 int (*jvmMixChannel_BW)(JSSMixer *, JSSChannel *, Sint32 *, const int, const Uint32); 31 int (*jvmMixChannel_BW)(JSSMixer *, JSSChannel *, Sint32 *, const int, const Sint32);
32 void (*jvmPostProcess)(Sint32 *, void *, const int); 32 void (*jvmPostProcess)(Sint32 *, void *, const int);
33 } JSSMixingRoutine; 33 } JSSMixingRoutine;
34 34
35 35
36 /* This table should be sorted from fastest to slowest, e.g. MMX/x86 36 /* This table should be sorted from fastest to slowest, e.g. MMX/x86
500 JSS_UNLOCK(mixer); 500 JSS_UNLOCK(mixer);
501 } 501 }
502 502
503 503
504 void jvmSetSample(JSSMixer * mixer, const int channel, 504 void jvmSetSample(JSSMixer * mixer, const int channel,
505 void *data, const Uint32 size, const Uint32 loopS, 505 void *data, const Sint32 size, const Sint32 loopS,
506 const Uint32 loopE, const int flags) 506 const Sint32 loopE, const int flags)
507 { 507 {
508 JSSChannel *c; 508 JSSChannel *c;
509 509
510 JSS_LOCK(mixer); 510 JSS_LOCK(mixer);
511 c = &mixer->channels[channel]; 511 c = &mixer->channels[channel];
575 575
576 return tmp; 576 return tmp;
577 } 577 }
578 578
579 579
580 void jvmSetPos(JSSMixer * mixer, const int channel, const Uint32 pos) 580 void jvmSetPos(JSSMixer * mixer, const int channel, const Sint32 pos)
581 { 581 {
582 JSS_LOCK(mixer); 582 JSS_LOCK(mixer);
583 FP_SETH(mixer->channels[channel].chPos, pos); 583 FP_SETH(mixer->channels[channel].chPos, pos);
584 FP_SETL(mixer->channels[channel].chPos, 0); 584 FP_SETL(mixer->channels[channel].chPos, 0);
585 JSS_UNLOCK(mixer); 585 JSS_UNLOCK(mixer);
586 } 586 }
587 587
588 588
589 Uint32 jvmGetPos(JSSMixer * mixer, const int channel) 589 Sint32 jvmGetPos(JSSMixer * mixer, const int channel)
590 { 590 {
591 Uint32 tmp; 591 Sint32 tmp;
592 592
593 JSS_LOCK(mixer); 593 JSS_LOCK(mixer);
594 tmp = FP_GETH(mixer->channels[channel].chPos); 594 tmp = FP_GETH(mixer->channels[channel].chPos);
595 JSS_UNLOCK(mixer); 595 JSS_UNLOCK(mixer);
596 596