All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rui Nuno Capela <rncbc@rncbc.org>
To: alsa-devel@lists.sourceforge.net
Cc: Takashi Iwai <tiwai@suse.de>,
	Karsten Wiese <annabellesgarden@yahoo.de>,
	Karsten Wiese <fzu@wemgehoertderstaat.de>
Subject: [PATCH] us428control 0.4.6
Date: Fri, 16 Feb 2007 17:13:53 +0000	[thread overview]
Message-ID: <45D5E651.3020305@rncbc.org> (raw)
In-Reply-To: <45CDE6B9.80804@rncbc.org>

[-- Attachment #1: Type: text/plain, Size: 495 bytes --]

Hi again,

After some more fun playing with my US-224, properly fitted to the new
command-line `us428control -m us224`, I'll take this chance and submit
this minor maintenance patch, yet bumping us428control version to 0.4.6
already.

Applies to alsa-tools/us428control, on top of that last one and already
applied to alsa-tools hg tree. Standalone tarball is also provided [1].

[1] http://www.rncbc.org/usx2y/us428control-0.4.6-2.tar.gz

Cheers.
-- 
rncbc aka Rui Nuno Capela
rncbc@rncbc.org


[-- Attachment #2: us428control-0.4.6-2.patch --]
[-- Type: text/x-patch, Size: 4426 bytes --]

diff -dupr us428control-0.4.5-5/configure us428control-0.4.6-2/configure
--- us428control-0.4.5-5/configure	2007-02-09 18:19:26.000000000 +0000
+++ us428control-0.4.6-2/configure	2007-02-16 16:26:35.000000000 +0000
@@ -1994,7 +1994,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE=us428control
- VERSION=0.4.5
+ VERSION=0.4.6
 
 
 cat >>confdefs.h <<_ACEOF
diff -dupr us428control-0.4.5-5/configure.in us428control-0.4.6-2/configure.in
--- us428control-0.4.5-5/configure.in	2007-02-09 18:01:59.000000000 +0000
+++ us428control-0.4.6-2/configure.in	2007-02-16 16:26:11.000000000 +0000
@@ -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
diff -dupr us428control-0.4.5-5/Cus428State.cc us428control-0.4.6-2/Cus428State.cc
--- us428control-0.4.5-5/Cus428State.cc	2007-02-14 18:18:53.000000000 +0000
+++ us428control-0.4.6-2/Cus428State.cc	2007-02-16 16:26:11.000000000 +0000
@@ -207,68 +207,14 @@ void Cus428State::UserKnobChangedTo(eKno
 	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();
 }
 
 
diff -dupr us428control-0.4.5-5/Cus428State.h us428control-0.4.6-2/Cus428State.h
--- us428control-0.4.5-5/Cus428State.h	2007-02-14 18:15:55.000000000 +0000
+++ us428control-0.4.6-2/Cus428State.h	2007-02-16 16:26:11.000000000 +0000
@@ -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.
Only in us428control-0.4.6-2: .deps

[-- Attachment #3: Type: text/plain, Size: 345 bytes --]

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

[-- Attachment #4: Type: text/plain, Size: 161 bytes --]

_______________________________________________
Alsa-devel mailing list
Alsa-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-devel

  parent reply	other threads:[~2007-02-16 17:13 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-05  6:56 v2.6.20-rt1, yum/rpm Ingo Molnar
2007-02-05  9:18 ` Serge Belyshev
2007-02-05  9:02   ` Ingo Molnar
2007-02-05 10:36 ` Sunil Naidu
2007-02-05 10:42   ` Peter Zijlstra
2007-02-05 10:22     ` Ingo Molnar
2007-02-05 11:15     ` Sunil Naidu
2007-02-05 12:59 ` Michal Piotrowski
2007-02-05 13:47   ` Ingo Molnar
2007-02-05 21:29     ` Michal Piotrowski
2007-02-05 14:25 ` Karsten Wiese
2007-02-05 21:46   ` USX2Y 2.6.20-rt2 Oops on disconnect Rui Nuno Capela
2007-02-05 22:27     ` Karsten Wiese
2007-02-06 11:53       ` Takashi Iwai
2007-02-07  0:54       ` USX2Y 2.6.20-rt2 Oops on disconnect [SOLVED] Rui Nuno Capela
2007-02-07 10:26         ` Takashi Iwai
2007-02-10  1:29   ` us428control 0.4.5 [RFC] Rui Nuno Capela
2007-02-10 15:37     ` Rui Nuno Capela
2007-02-13 16:07       ` Q: How to detect which USx2y is connected? Rui Nuno Capela
2007-02-13 17:36         ` Karsten Wiese
2007-02-13 17:47           ` Karsten Wiese
2007-02-13 17:48           ` Takashi Iwai
2007-02-13 18:08             ` Rui Nuno Capela
2007-02-13 18:13               ` Rui Nuno Capela
2007-02-13 19:03               ` Karsten Wiese
2007-02-13 21:01                 ` Rui Nuno Capela
2007-02-14 12:59                   ` Takashi Iwai
2007-02-14 14:30                     ` Rui Nuno Capela
2007-02-14 14:36                       ` Takashi Iwai
2007-02-14 14:57                         ` Rui Nuno Capela
2007-02-14 15:01                           ` Takashi Iwai
2007-02-14 15:08                             ` Rui Nuno Capela
2007-02-14 22:43       ` [PATCH] us428control 0.4.5 Rui Nuno Capela
2007-02-14 23:23         ` Takashi Iwai
2007-02-16 17:13       ` Rui Nuno Capela [this message]
2007-02-16 17:46         ` [PATCH] us428control 0.4.6 Takashi Iwai
2007-02-05 15:17 ` v2.6.20-rt1, yum/rpm Parag Warudkar
2007-02-05 21:50 ` Michal Piotrowski
2007-02-06  0:11 ` Michal Piotrowski
2007-02-06  1:14 ` Daniel Walker
2007-02-06 10:05 ` Pre-packaged version Alessio Igor Bogani
2007-02-06 10:10 ` v2.6.20-rt1, yum/rpm Arjan van de Ven
2007-02-07 12:32   ` Ingo Molnar
2007-02-06 10:30 ` Sunil Naidu
2007-02-06 19:38 ` Chuck Harding
2007-02-06 20:08   ` K.R. Foley
2007-02-27 17:39 ` K.R. Foley
2007-02-28  8:11   ` Ingo Molnar
2007-02-28 10:16     ` K.R. Foley
2007-04-26 13:57 ` v2.6.21-rt1 Ingo Molnar
2007-04-26 20:53   ` v2.6.21-rt1 Free Ekanayaka
2007-05-03 19:16   ` v2.6.21-rt1 - bug in asm-mips/atomic.h Tim Bird
2007-05-03 19:35     ` v2.6.21-rt1 - mips compile bugs Tim Bird
2007-05-17 18:46   ` v2.6.21-rt1 emin ak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45D5E651.3020305@rncbc.org \
    --to=rncbc@rncbc.org \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=annabellesgarden@yahoo.de \
    --cc=fzu@wemgehoertderstaat.de \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.