mirror of
https://github.com/alsa-project/alsa-tools.git
synced 2025-10-28 05:40:23 -04:00
us428control 0.4.6
Minor clean ups. From: Rui Nuno Capela <rncbc@rncbc.org>
This commit is contained in:
parent
711d2aec15
commit
89dd8301d9
3 changed files with 45 additions and 57 deletions
|
|
@ -207,68 +207,14 @@ void Cus428State::UserKnobChangedTo(eKnobs K, bool V)
|
|||
case eK_BANK_L:
|
||||
if (verbose > 1)
|
||||
printf("Knob BANK_L now %i", V);
|
||||
if (V) {
|
||||
if (aBank > 0) {
|
||||
bool bInputMonitor = StateInputMonitor();
|
||||
bool bSolo = LightIs(eL_Solo);
|
||||
if (!bInputMonitor) {
|
||||
Select[aBank] = Light[0].Value;
|
||||
Rec[aBank] = Light[1].Value;
|
||||
if (bSolo) {
|
||||
Solo[aBank] = Light[2].Value;
|
||||
} else {
|
||||
Mute[aBank] = Light[2].Value;
|
||||
}
|
||||
}
|
||||
aBank--;
|
||||
if (!bInputMonitor) {
|
||||
Light[0].Value = Select[aBank];
|
||||
Light[1].Value = Rec[aBank];
|
||||
if (bSolo) {
|
||||
Light[2].Value = Solo[aBank];
|
||||
} else {
|
||||
Light[2].Value = Mute[aBank];
|
||||
}
|
||||
}
|
||||
}
|
||||
LightSet(eL_BankL, (aBank == 0));
|
||||
LightSet(eL_BankR, (aBank == cBanks - 1));
|
||||
LightSend();
|
||||
}
|
||||
if (V) BankSet(aBank - 1);
|
||||
if (verbose > 1)
|
||||
printf(" Light is %i\n", LightIs(eL_BankL));
|
||||
break;
|
||||
case eK_BANK_R:
|
||||
if (verbose > 1)
|
||||
printf("Knob BANK_R now %i", V);
|
||||
if (V) {
|
||||
if (aBank < 3) {
|
||||
bool bInputMonitor = StateInputMonitor();
|
||||
bool bSolo = LightIs(eL_Solo);
|
||||
if (!bInputMonitor) {
|
||||
Select[aBank] = Light[0].Value;
|
||||
Rec[aBank] = Light[1].Value;
|
||||
if (bSolo) {
|
||||
Solo[aBank] = Light[2].Value;
|
||||
} else {
|
||||
Mute[aBank] = Light[2].Value;
|
||||
}
|
||||
}
|
||||
aBank++;
|
||||
if (!bInputMonitor) {
|
||||
Light[0].Value = Select[aBank];
|
||||
Light[1].Value = Rec[aBank];
|
||||
if (bSolo) {
|
||||
Light[2].Value = Solo[aBank];
|
||||
} else {
|
||||
Light[2].Value = Mute[aBank];
|
||||
}
|
||||
}
|
||||
}
|
||||
LightSet(eL_BankL, (aBank == 0));
|
||||
LightSet(eL_BankR, (aBank == cBanks - 1));
|
||||
LightSend();
|
||||
}
|
||||
if (V) BankSet(aBank + 1);
|
||||
if (verbose > 1)
|
||||
printf(" Light is %i\n", LightIs(eL_BankR));
|
||||
break;
|
||||
|
|
@ -602,10 +548,48 @@ void Cus428State::TransportSend()
|
|||
}
|
||||
|
||||
|
||||
// Set new bank layer state.
|
||||
void Cus428State::BankSet( int B )
|
||||
{
|
||||
if (B >= 0 && B < cBanks) {
|
||||
if (!StateInputMonitor()) {
|
||||
bool bSolo = LightIs(eL_Solo);
|
||||
Select[aBank] = Light[0].Value;
|
||||
Rec[aBank] = Light[1].Value;
|
||||
if (bSolo) {
|
||||
Solo[aBank] = Light[2].Value;
|
||||
} else {
|
||||
Mute[aBank] = Light[2].Value;
|
||||
}
|
||||
Light[0].Value = Select[B];
|
||||
Light[1].Value = Rec[B];
|
||||
if (bSolo) {
|
||||
Light[2].Value = Solo[B];
|
||||
} else {
|
||||
Light[2].Value = Mute[B];
|
||||
}
|
||||
}
|
||||
aBank = B;
|
||||
}
|
||||
|
||||
BankSend();
|
||||
}
|
||||
|
||||
|
||||
// Update bank status lights.
|
||||
void Cus428State::BankSend()
|
||||
{
|
||||
LightSet(eL_BankL, (aBank == 0));
|
||||
LightSet(eL_BankR, (aBank == cBanks - 1));
|
||||
LightSend();
|
||||
}
|
||||
|
||||
|
||||
// Reset MMC state.
|
||||
void Cus428State::MmcReset()
|
||||
{
|
||||
W0 = 0;
|
||||
aBank = 0;
|
||||
aWheel = aWheel_L = aWheel_R = 0;
|
||||
aWheelSpeed = 0;
|
||||
bSetLocate = false;
|
||||
|
|
@ -614,6 +598,7 @@ void Cus428State::MmcReset()
|
|||
|
||||
TransportSend();
|
||||
LocateSend();
|
||||
BankSend();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -131,6 +131,9 @@ public:
|
|||
void TransportToggle(unsigned char T);
|
||||
void TransportSet(unsigned char T, bool V);
|
||||
void TransportSend();
|
||||
// Set bank layer state.
|
||||
void BankSet(int B);
|
||||
void BankSend();
|
||||
// Process masked-write sub-command.
|
||||
void MaskedWrite(unsigned char *data);
|
||||
// Reset internal MMC state.
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
AC_INIT(us428control.cc)
|
||||
AM_INIT_AUTOMAKE(us428control, 0.4.5)
|
||||
AM_INIT_AUTOMAKE(us428control, 0.4.6)
|
||||
AC_PROG_CXX
|
||||
AC_PROG_INSTALL
|
||||
AC_HEADER_STDC
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue