diff options
Diffstat (limited to 'apps/misc.c')
-rw-r--r-- | apps/misc.c | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/apps/misc.c b/apps/misc.c index 8d0ca7922f..c41f63456c 100644 --- a/apps/misc.c +++ b/apps/misc.c | |||
@@ -529,6 +529,7 @@ long default_event_handler_ex(long event, void (*callback)(void *), void *parame | |||
529 | #if CONFIG_PLATFORM & PLATFORM_ANDROID | 529 | #if CONFIG_PLATFORM & PLATFORM_ANDROID |
530 | static bool resume = false; | 530 | static bool resume = false; |
531 | #endif | 531 | #endif |
532 | |||
532 | switch(event) | 533 | switch(event) |
533 | { | 534 | { |
534 | case SYS_BATTERY_UPDATE: | 535 | case SYS_BATTERY_UPDATE: |
@@ -629,11 +630,45 @@ long default_event_handler_ex(long event, void (*callback)(void *), void *parame | |||
629 | if (resume && playlist_resume() != -1) | 630 | if (resume && playlist_resume() != -1) |
630 | { | 631 | { |
631 | playlist_start(global_status.resume_index, | 632 | playlist_start(global_status.resume_index, |
632 | global_status.resume_offset); | 633 | global_status.resume_offset); |
633 | } | 634 | } |
634 | resume = false; | 635 | resume = false; |
635 | return SYS_CALL_HUNG_UP; | 636 | return SYS_CALL_HUNG_UP; |
636 | #endif | 637 | #endif |
638 | #ifdef HAVE_MULTIMEDIA_KEYS | ||
639 | /* multimedia keys on keyboards, headsets */ | ||
640 | case BUTTON_MULTIMEDIA_PLAYPAUSE: | ||
641 | { | ||
642 | int status = audio_status(); | ||
643 | if (status & AUDIO_STATUS_PLAY) | ||
644 | { | ||
645 | if (status & AUDIO_STATUS_PAUSE) | ||
646 | audio_resume(); | ||
647 | else | ||
648 | audio_pause(); | ||
649 | } | ||
650 | else | ||
651 | if (playlist_resume() != -1) | ||
652 | { | ||
653 | playlist_start(global_status.resume_index, | ||
654 | global_status.resume_offset); | ||
655 | } | ||
656 | return event; | ||
657 | } | ||
658 | case BUTTON_MULTIMEDIA_NEXT: | ||
659 | audio_next(); | ||
660 | return event; | ||
661 | case BUTTON_MULTIMEDIA_PREV: | ||
662 | audio_prev(); | ||
663 | return event; | ||
664 | case BUTTON_MULTIMEDIA_STOP: | ||
665 | list_stop_handler(); | ||
666 | return event; | ||
667 | case BUTTON_MULTIMEDIA_REW: | ||
668 | case BUTTON_MULTIMEDIA_FFWD: | ||
669 | /* not supported yet, needs to be done in the WPS */ | ||
670 | return 0; | ||
671 | #endif | ||
637 | } | 672 | } |
638 | return 0; | 673 | return 0; |
639 | } | 674 | } |