1
0
Fork 0
forked from len0rd/rockbox

Initial maemo platform support

Adds Nokia N900, N810 and N800 support.

Features:
- Introduce maemo specific platform defines
- Play audio in silent mode
- Stop playback on incoming calls
- Battery level readout
- Bluetooth headset support
- Save CPU by disabling screen updates if the display
  is off or the app doesn't have input focus
- N900: GStreamer audio backend

Kudos to kugel for the code review.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29248 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Thomas Jarosch 2011-02-08 20:05:25 +00:00
parent 4d12904439
commit 5f037ac015
22 changed files with 970 additions and 22 deletions

View file

@ -67,6 +67,8 @@ struct event_queue button_queue;
static int btn = 0; /* Hopefully keeps track of currently pressed keys... */
int sdl_app_has_input_focus = 1;
#ifdef HAS_BUTTON_HOLD
bool hold_button_state = false;
bool button_hold(void) {
@ -209,11 +211,34 @@ static void mouse_event(SDL_MouseButtonEvent *event, bool button_up)
static bool event_handler(SDL_Event *event)
{
SDLKey ev_key;
switch(event->type)
{
case SDL_ACTIVEEVENT:
if (event->active.state & SDL_APPINPUTFOCUS)
{
if (event->active.gain == 1)
sdl_app_has_input_focus = 1;
else
sdl_app_has_input_focus = 0;
}
break;
case SDL_KEYDOWN:
case SDL_KEYUP:
button_event(event->key.keysym.sym, event->type == SDL_KEYDOWN);
ev_key = event->key.keysym.sym;
#if (CONFIG_PLATFORM & PLATFORM_MAEMO5)
/* N900 with shared up/down cursor mapping. Seen on the German,
Finnish, Italian, French and Russian version. Probably more. */
if (event->key.keysym.mod & KMOD_MODE)
{
if (ev_key == SDLK_LEFT)
ev_key = SDLK_UP;
else if (ev_key == SDLK_RIGHT)
ev_key = SDLK_DOWN;
}
#endif
button_event(ev_key, event->type == SDL_KEYDOWN);
break;
#ifdef HAVE_TOUCHSCREEN
case SDL_MOUSEMOTION: