On Saturday 15 December 2007 01:35:31 Robin Sheat wrote:
> I've spent the past week hacking on the Herc, trying to get more than one
> LED to light (using the HID interface, rather than libdjconsole, still
> can't make that work). Tonight I finally made real progress!
OK, as a followup, I've attached a diff against head that makes the headphone 
lights light appropriately when used with my kernel patch[0].

As far as I can tell, the only remaining important thing for the hercules code 
now is the pitch knobs don't work quite right...they always cause the pitch 
to jump to where the knob was last set, which causes confusion if you use 
sync. I'll look into that during the week.

One other thing, now the leds are working...what should they do? There are the 
following, a left and right for each: cue button, master tempo, autobeat 
(sync) button, and as a group, Fx, Cue, and Loop. These last ones are 
supposed to show up the mode you're in that applies the '1,2,3' buttons at 
the top I think. I guess the cue button is supposed to show up when you have 
a cue point set, right? But mixxx always has one set, even if it's just the 
start of the track. Can we tell if one's been explicitly set for this track, 
or is there anything else that can be done with it? I don't much like the 
idea of just lighting up when you press it as you already know you're 
pressing it.

Any suggestions about what I should make them do?

[0] the kernel patch is here: http://www.kallisti.net.nz/~robin/mixxx/ along 
with the modules built for my Ubuntu 7.10 i386 system (2.6.22-14-generic).

-- 
Robin <[EMAIL PROTECTED]> JabberID: <[EMAIL PROTECTED]>

Hostes alienigeni me abduxerunt. Qui annus est?

PGP Key 0xA99CEB6D = 5957 6D23 8B16 EFAB FEF8  7175 14D3 6485 A99C EB6D
Index: herculeslinux.h
===================================================================
--- herculeslinux.h	(revision 1679)
+++ herculeslinux.h	(working copy)
@@ -98,22 +98,22 @@
 const int kiHerculesCrossfade = 0x28;
 
 // TODO: 1.5.0+ investigate and revise led codes
-const int kiHerculesLedRightSync = 0;
-const int kiHerculesLedLeftLoop = 1;
-const int kiHerculesLedRightLoop = 2;
-const int kiHerculesLedLeftMasterTempo = 3;
-const int kiHerculesLedRightMasterTempo = 4;
-const int kiHerculesLedLeftFx = 5;
-const int kiHerculesLedRightFx = 6;
-const int kiHerculesLedRightCueLamp = 7;
-const int kiHerculesLedRightCueBtn = 8;
-const int kiHerculesLedRightPlay = 9;
-const int kiHerculesLedLeftCueLamp = 10;
-const int kiHerculesLedLeftPlay = 11;
-const int kiHerculesLedLeftHeadphone = 12;
-const int kiHerculesLedRightHeadphone = 13;
-const int kiHerculesLedLeftCueBtn = 14;
-const int kiHerculesLedLeftSync = 15;
+const int kiHerculesLedRightSync = 0x0D;
+const int kiHerculesLedLeftLoop = 0x0E;
+const int kiHerculesLedRightLoop = 0x0F;
+const int kiHerculesLedLeftMasterTempo = 0x00;
+const int kiHerculesLedRightMasterTempo = 0x01;
+const int kiHerculesLedLeftFx = 0x02;
+const int kiHerculesLedRightFx = 0x03;
+const int kiHerculesLedRightCueLamp = 0x04;
+const int kiHerculesLedRightCueBtn = 0x05;
+//const int kiHerculesLedRightPlay = 9; // doesn't exist
+const int kiHerculesLedLeftCueLamp = 0x07;
+//const int kiHerculesLedLeftPlay = 11; // doesn't exist
+const int kiHerculesLedLeftHeadphone = 0x09;
+const int kiHerculesLedRightHeadphone = 0x0A;
+const int kiHerculesLedLeftCueBtn = 0x05;
+const int kiHerculesLedLeftSync = 0x0C;
 
 #define __THOMAS_HERC__
 #ifdef __THOMAS_HERC__
Index: herculeslinuxlegacy.cpp
===================================================================
--- herculeslinuxlegacy.cpp	(revision 1679)
+++ herculeslinuxlegacy.cpp	(working copy)
@@ -35,12 +35,12 @@
         if (m_pControlObjectLeftBtnPlayProxy->get()!=m_bPlayLeft)
         {
             m_bPlayLeft=!m_bPlayLeft;
-            led_write(kiHerculesLedLeftPlay, m_bPlayLeft);
+//            led_write(kiHerculesLedLeftPlay, m_bPlayLeft);
         }
         if (m_pControlObjectRightBtnPlayProxy->get()!=m_bPlayRight)
         {
             m_bPlayRight=!m_bPlayRight;
-            led_write(kiHerculesLedRightPlay, m_bPlayRight);
+//            led_write(kiHerculesLedRightPlay, m_bPlayRight);
         }
         if (m_pControlObjectLeftBtnLoopProxy->get()!=m_bLoopLeft)
         {
@@ -52,8 +52,14 @@
             m_bLoopRight=!m_bLoopRight;
             led_write(kiHerculesLedRightCueBtn, m_bLoopRight);
         }
-	m_bHeadphoneLeft=m_pControlObjectLeftBtnHeadphoneProxy->get();
-	m_bHeadphoneRight=m_pControlObjectRightBtnHeadphoneProxy->get();
+        if (m_pControlObjectLeftBtnHeadphoneProxy->get() != m_bHeadphoneLeft) {
+	        m_bHeadphoneLeft=!m_bHeadphoneLeft;
+	        led_write(kiHerculesLedLeftHeadphone, m_bHeadphoneLeft);
+	    }
+        if (m_pControlObjectRightBtnHeadphoneProxy->get() != m_bHeadphoneRight) {
+	        m_bHeadphoneRight=!m_bHeadphoneRight;
+	        led_write(kiHerculesLedRightHeadphone, m_bHeadphoneRight);
+	    }
     }
 }
 
@@ -78,8 +84,8 @@
         // Turn off led
         led_write(kiHerculesLedLeftCueBtn, false);
         led_write(kiHerculesLedRightCueBtn, false);
-        led_write(kiHerculesLedLeftPlay, false);
-        led_write(kiHerculesLedRightPlay, false);
+//        led_write(kiHerculesLedLeftPlay, false);
+//        led_write(kiHerculesLedRightPlay, false);
         led_write(kiHerculesLedLeftSync, false);
         led_write(kiHerculesLedRightSync, false);
         led_write(kiHerculesLedLeftHeadphone, false);
@@ -336,13 +342,13 @@
 
                 case kiHerculesLeftBtnHeadphone: 
                     if (ev.value) {
-                      led_write(kiHerculesLedLeftHeadphone, !m_pControlObjectLeftBtnHeadphone->get());
+                      //led_write(kiHerculesLedLeftHeadphone, !m_pControlObjectLeftBtnHeadphone->get());
                       sendButtonEvent(!m_bHeadphoneLeft, m_pControlObjectLeftBtnHeadphone);
                     }
                     break;
                 case kiHerculesRightBtnHeadphone:
                     if (ev.value) {
-                      led_write(kiHerculesLedRightHeadphone, !m_pControlObjectRightBtnHeadphone->get());
+                      //led_write(kiHerculesLedRightHeadphone, !m_pControlObjectRightBtnHeadphone->get());
                       sendButtonEvent(!m_bHeadphoneRight, m_pControlObjectRightBtnHeadphone);
                     }
                     break;
@@ -454,15 +460,15 @@
     struct input_event ev;
     memset(&ev, 0, sizeof(struct input_event));
 
-    //ev.type = EV_LED;
-    ev.type = 0x0000;
+    ev.type = EV_LED;
+    //ev.type = 0x0000;
     ev.code = iLed;
     if (bOn)
-        ev.value = 3;
+        ev.value = 1;
     else
         ev.value = 0;
 
-    //qDebug("Hercules: led_write(iLed=%d, bOn=%d)", iLed, bOn);
+    //qDebug("Hercules: led_write(iLed=%d, value=%d)", iLed, ev.value);
 
     if (write(m_iFd, &ev, sizeof(struct input_event)) != sizeof(struct input_event))
         qDebug("Hercules: write(): %s", strerror(errno));

Attachment: signature.asc
Description: This is a digitally signed message part.

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Mixxx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mixxx-devel

Reply via email to