Author: titmuss
Date: Fri Oct 10 09:57:45 2008
New Revision: 3102

URL: http://svn.slimdevices.com?rev=3102&root=Jive&view=rev
Log:
 [EMAIL PROTECTED] (orig r3095):  awy | 2008-10-10 16:02:57 +0100
 (bug 9517) Only call FLAC decoder when likely to have enough data for a full 
frame (or end of stream).
 [EMAIL PROTECTED] (orig r3096):  tom | 2008-10-10 17:12:34 +0100
 For controller, replaced standard character key input translation to 
multimedia keys, added support for this in jive_framework.c
 
 [EMAIL PROTECTED] (orig r3098):  tom | 2008-10-10 17:14:08 +0100
 For controller, replaced standard character key input translation to 
multimedia keys, added support for this in jive_framework.c
 

Modified:
    7.4/trunk/   (props changed)
    7.4/trunk/squeezeos/src/s3c2412/linux-2.6.22/drivers/char/jive/jive_matrix.c
    7.4/trunk/squeezeplay/src/SDL-1.2.13/src/video/fbcon/SDL_fbevents.c
    7.4/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode_flac.c
    7.4/trunk/squeezeplay/src/squeezeplay/src/audio/streambuf.c
    7.4/trunk/squeezeplay/src/squeezeplay/src/audio/streambuf.h
    7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework.c

Propchange: 7.4/trunk/
------------------------------------------------------------------------------
--- svk:merge (original)
+++ svk:merge Fri Oct 10 09:57:45 2008
@@ -2,7 +2,7 @@
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.1/branches/discovery-refactor:2596
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.1/trunk:2920
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.2/trunk:2921
-bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.3/trunk:3086
+bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.3/trunk:3098
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/7.0:2013
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/SN:1083
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/scrolling:1378

Modified: 
7.4/trunk/squeezeos/src/s3c2412/linux-2.6.22/drivers/char/jive/jive_matrix.c
URL: 
http://svn.slimdevices.com/7.4/trunk/squeezeos/src/s3c2412/linux-2.6.22/drivers/char/jive/jive_matrix.c?rev=3102&root=Jive&r1=3101&r2=3102&view=diff
==============================================================================
--- 
7.4/trunk/squeezeos/src/s3c2412/linux-2.6.22/drivers/char/jive/jive_matrix.c 
(original)
+++ 
7.4/trunk/squeezeos/src/s3c2412/linux-2.6.22/drivers/char/jive/jive_matrix.c 
Fri Oct 10 09:57:45 2008
@@ -52,21 +52,21 @@
 
        // KEY_OUTPUT2
        KEY_UNKNOWN,
-       KEY_B, // SW10 Fwd
-       KEY_Z, // SW9 Rew
-       KEY_C, // SW8 Pause
+       KEY_NEXTSONG, // SW10 Fwd
+       KEY_PREVIOUSSONG, // SW9 Rew
+       KEY_PLAYPAUSE, // SW8 Pause
 
        // KEY_OUTPUT1
        KEY_UNKNOWN,
-       KEY_X, // SW5 Play
-       KEY_A, // SW6 Add
-       KEY_EQUAL, // SW7 Volume Up
+       KEY_PLAY, // SW5 Play
+       KEY_KPPLUS, // SW6 Add
+       KEY_VOLUMEUP, // SW7 Volume Up
 
        // KEY_OUTPUT0
-       KEY_H, // SW1 Home
+       KEY_HOME, // SW1 Home
        KEY_UNKNOWN,
        KEY_LEFT, // SW2 Back
-       KEY_MINUS, // SW3 Volume Down
+       KEY_VOLUMEDOWN, // SW3 Volume Down
 };
 
 #define IRQF_TRIGGER_BOTH (IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING)

Modified: 7.4/trunk/squeezeplay/src/SDL-1.2.13/src/video/fbcon/SDL_fbevents.c
URL: 
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/SDL-1.2.13/src/video/fbcon/SDL_fbevents.c?rev=3102&root=Jive&r1=3101&r2=3102&view=diff
==============================================================================
--- 7.4/trunk/squeezeplay/src/SDL-1.2.13/src/video/fbcon/SDL_fbevents.c 
(original)
+++ 7.4/trunk/squeezeplay/src/SDL-1.2.13/src/video/fbcon/SDL_fbevents.c Fri Oct 
10 09:57:45 2008
@@ -61,8 +61,8 @@
 /* The translation tables from a console scancode to a SDL keysym */
 #define NUM_VGAKEYMAPS (1<<KG_CAPSSHIFT)
 static Uint16 vga_keymap[NUM_VGAKEYMAPS][NR_KEYS];
-static SDLKey keymap[128];
-static Uint16 keymap_temp[128]; /* only used at startup */
+static SDLKey keymap[210];
+static Uint16 keymap_temp[210]; /* only used at startup */
 static SDL_keysym *TranslateKey(int scancode, SDL_keysym *keysym);
 
 /* Ugh, we have to duplicate the kernel's keysym mapping code...
@@ -989,14 +989,27 @@
        int pressed;
        int scancode;
        SDL_keysym keysym;
-
        nread = read(keyboard_fd, keybuf, BUFSIZ);
-       for ( i=0; i<nread; ++i ) {
-               scancode = keybuf[i] & 0x7F;
-               if ( keybuf[i] & 0x80 ) {
-                       pressed = SDL_RELEASED;
+       for ( i = 0; i<nread; ++i ) {
+               if ( ((keybuf[i] == 0) || keybuf[i] == 128) && (nread-i >= 2) 
&& keybuf[i + 1] == 129) {
+                       /* is extended character (scancode>128), comes in as 
three codes,
+                       first code: 0(pressed) or 128(released), second code:129
+                       third code: actual extended scancode value */
+                       scancode = keybuf[i + 2];
+                       if (keybuf[i] == 0) {
+                               pressed = SDL_PRESSED;
+                       } else {
+                               pressed = SDL_RELEASED;
+                       }
+                       //push past next 2 since the set of 3 are the extended 
character representation
+                       i += 2;
                } else {
-                       pressed = SDL_PRESSED;
+                       scancode = keybuf[i] & 0x7F;
+                       if ( keybuf[i] & 0x80 ) {
+                               pressed = SDL_RELEASED;
+                       } else {
+                               pressed = SDL_PRESSED;
+                       }
                }
                TranslateKey(scancode, &keysym);
                /* Handle Ctrl-Alt-FN for vt switch */
@@ -1124,6 +1137,24 @@
          case 127:
            keymap[i] = SDLK_MENU;
            break;
+         case 114:
+           keymap[i] = SDLK_AudioLowerVolume;
+           break;
+         case 115:
+           keymap[i] = SDLK_AudioRaiseVolume;
+           break;
+         case 163:
+           keymap[i] = SDLK_AudioNext;
+           break;
+         case 164:
+           keymap[i] = SDLK_AudioPause;
+           break;
+         case 165:
+           keymap[i] = SDLK_AudioPrev;
+           break;
+         case 207:
+           keymap[i] = SDLK_AudioPlay;
+           break;
          /* this should take care of all standard ascii keys */
          default:
            keymap[i] = KVAL(vga_keymap[0][i]);

Modified: 7.4/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode_flac.c
URL: 
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode_flac.c?rev=3102&root=Jive&r1=3101&r2=3102&view=diff
==============================================================================
--- 7.4/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode_flac.c 
(original)
+++ 7.4/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode_flac.c Fri 
Oct 10 09:57:45 2008
@@ -157,6 +157,16 @@
        }
 
        if (! decode_output_can_write(2 * 4608 * sizeof(sample_t), 
self->sample_rate)) {
+               return FALSE;
+       }
+       
+       /* Because FLAC__stream_decoder_process_single() will keep calling the 
read
+        * callback, in a hard loop, until it gets a full frame, we want to 
avoid calling
+        * it unless it is likely to get a full frame. The absolute maximum 
size of a
+        * FLAC frame is too large to use that, so we pick a value that will 
work most
+        * of the time.
+        */
+       if (streambuf_would_wait_for(25000)) {
                return FALSE;
        }
 

Modified: 7.4/trunk/squeezeplay/src/squeezeplay/src/audio/streambuf.c
URL: 
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/src/audio/streambuf.c?rev=3102&root=Jive&r1=3101&r2=3102&view=diff
==============================================================================
--- 7.4/trunk/squeezeplay/src/squeezeplay/src/audio/streambuf.c (original)
+++ 7.4/trunk/squeezeplay/src/squeezeplay/src/audio/streambuf.c Fri Oct 10 
09:57:45 2008
@@ -78,7 +78,22 @@
 
        return n;
 }
-
+/* returns true if the stream is still open but cannot yet supply the 
requested bytes */
+bool_t streambuf_would_wait_for(size_t bytes) {
+       size_t n;
+       
+       if (!streambuf_streaming) {
+               return TRUE;
+       }
+
+       fifo_lock(&streambuf_fifo);
+
+       n = fifo_bytes_used(&streambuf_fifo);
+
+       fifo_unlock(&streambuf_fifo);
+
+       return n < bytes;
+}
 
 void streambuf_get_status(size_t *size, size_t *usedbytes, u32_t *bytesL, 
u32_t *bytesH) {
 

Modified: 7.4/trunk/squeezeplay/src/squeezeplay/src/audio/streambuf.h
URL: 
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/src/audio/streambuf.h?rev=3102&root=Jive&r1=3101&r2=3102&view=diff
==============================================================================
--- 7.4/trunk/squeezeplay/src/squeezeplay/src/audio/streambuf.h (original)
+++ 7.4/trunk/squeezeplay/src/squeezeplay/src/audio/streambuf.h Fri Oct 10 
09:57:45 2008
@@ -10,6 +10,8 @@
 extern size_t streambuf_get_freebytes(void);
 
 extern size_t streambuf_get_usedbytes(void);
+
+extern bool_t streambuf_would_wait_for(size_t bytes);
 
 extern void streambuf_get_status(size_t *size, size_t *usedbytes, u32_t 
*bytesL, u32_t *bytesH);
 

Modified: 7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework.c
URL: 
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework.c?rev=3102&root=Jive&r1=3101&r2=3102&view=diff
==============================================================================
--- 7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework.c (original)
+++ 7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework.c Fri Oct 10 
09:57:45 2008
@@ -76,19 +76,26 @@
        { SDLK_k,               JIVE_KEY_DOWN },
        { SDLK_j,               JIVE_KEY_LEFT },
        { SDLK_l,               JIVE_KEY_RIGHT },
-       { SDLK_h,               JIVE_KEY_HOME },
+       { SDLK_HOME,            JIVE_KEY_HOME },
        { SDLK_p,               JIVE_KEY_PLAY },
        { SDLK_x,               JIVE_KEY_PLAY },
+       { SDLK_AudioPlay,       JIVE_KEY_PLAY },
        { SDLK_c,               JIVE_KEY_PAUSE },
        { SDLK_SPACE,           JIVE_KEY_PAUSE },
+       { SDLK_AudioPause,      JIVE_KEY_PAUSE },
        { SDLK_a,               JIVE_KEY_ADD },
+       { SDLK_KP_PLUS,         JIVE_KEY_ADD },
        { SDLK_z,               JIVE_KEY_REW },
        { SDLK_LESS,            JIVE_KEY_REW },
+       { SDLK_AudioPrev,       JIVE_KEY_REW },
        { SDLK_b,               JIVE_KEY_FWD },
        { SDLK_GREATER,         JIVE_KEY_FWD },
+       { SDLK_AudioNext,       JIVE_KEY_FWD },
        { SDLK_PLUS,            JIVE_KEY_VOLUME_UP },
        { SDLK_EQUALS,          JIVE_KEY_VOLUME_UP },
+       { SDLK_AudioRaiseVolume,JIVE_KEY_VOLUME_UP },
        { SDLK_MINUS,           JIVE_KEY_VOLUME_DOWN },
+       { SDLK_AudioLowerVolume,JIVE_KEY_VOLUME_DOWN },
        { SDLK_UNKNOWN,         JIVE_KEY_NONE },
 };
 

_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/cgi-bin/mailman/listinfo/jive-checkins

Reply via email to