Karsten Wiese <annabellesgarden@yahoo.de>:

This has more features:
- PCM-Volume adjusted to MasteVolumeSlider setting at device start.
- Direct Monitoring Functions adjustable directly on the US428
- Alsa Sequencer Output port for applications to receive the US428 sliders
etc.
This commit is contained in:
Takashi Iwai 2003-10-24 14:01:45 +00:00
parent 08f4ff3ade
commit 4e978a5a7e
10 changed files with 369 additions and 52 deletions

View file

@ -31,27 +31,31 @@ Cus428_ctls::dump(int n)
for (int m = 0; m < n; m++)
printf(" ");
for (; n < sizeof(*this); n++)
printf("%02hhX ", ((char*)this)[ n]);
printf("%02hhX ", ((char*)this)[n]);
printf("\n");
}
void
Cus428_ctls::analyse(Cus428_ctls& Previous, unsigned n)
{
for (; n < 9; n++) { //Sliders
char Diff = ((unsigned char*)this)[ n] - ((unsigned char*)&Previous)[ n];
OneState->Set_us428_ctls(this);
for (; n < 9; n++) { //Sliders
char Diff = ((unsigned char*)this)[n] - ((unsigned char*)&Previous)[n];
if (Diff)
OneState->SliderChangedTo(n, ((unsigned char*)this)[ n]);
OneState->SliderChangedTo(n, ((unsigned char*)this)[n]);
}
for (; n < 16; n++) { //Knobs
unsigned char Diff = ((unsigned char*)this)[ n] ^ ((unsigned char*)&Previous)[ n];
for (; n < 16; n++) { //Knobs
unsigned char Diff = ((unsigned char*)this)[n] ^ ((unsigned char*)&Previous)[n];
unsigned o = 0;
while (o < 8) {
if (Diff & (1 << o))
OneState->KnobChangedTo((Cus428State::eKnobs)(8*n + o), ((unsigned char*)this)[ n] & (1 << o));
OneState->KnobChangedTo((Cus428State::eKnobs)(8*n + o), ((unsigned char*)this)[n] & (1 << o));
++o;
}
}
for (; n < sizeof(*this); n++)
; //wheels
for (; n < sizeof(*this); n++) { //wheels
char Diff = ((unsigned char*)this)[ n] - ((unsigned char*)&Previous)[n];
if (Diff)
OneState->WheelChangedTo((E_In84)n, Diff);
}
}