diff options
author | Zakk Roberts <midk@rockbox.org> | 2006-03-21 07:59:23 +0000 |
---|---|---|
committer | Zakk Roberts <midk@rockbox.org> | 2006-03-21 07:59:23 +0000 |
commit | 87afd0b0507a59e0731a79662ab820f89bf5b585 (patch) | |
tree | 7accd874658fb2c5865703ef5d0a8c3e2a131a31 /apps | |
parent | dd521146b735790549dd91898ed814af994ef6ea (diff) | |
download | rockbox-87afd0b0507a59e0731a79662ab820f89bf5b585.tar.gz rockbox-87afd0b0507a59e0731a79662ab820f89bf5b585.zip |
Reworked pitch screen for easier adjustment and better looks. Added some button definitions for iPods - coming soon to a Sound Settings menu near you...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9146 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/gui/gwps.c | 54 | ||||
-rw-r--r-- | apps/lang/english.lang | 5 | ||||
-rw-r--r-- | apps/screens.c | 169 | ||||
-rw-r--r-- | apps/screens.h | 32 |
4 files changed, 128 insertions, 132 deletions
diff --git a/apps/gui/gwps.c b/apps/gui/gwps.c index 2ec1c4dcc7..5ffdf4e33f 100644 --- a/apps/gui/gwps.c +++ b/apps/gui/gwps.c | |||
@@ -134,7 +134,7 @@ long gui_wps_show(void) | |||
134 | while ( 1 ) | 134 | while ( 1 ) |
135 | { | 135 | { |
136 | bool audio_paused = (audio_status() & AUDIO_STATUS_PAUSE)?true:false; | 136 | bool audio_paused = (audio_status() & AUDIO_STATUS_PAUSE)?true:false; |
137 | 137 | ||
138 | /* did someone else (i.e power thread) change audio pause mode? */ | 138 | /* did someone else (i.e power thread) change audio pause mode? */ |
139 | if (wps_state.paused != audio_paused) { | 139 | if (wps_state.paused != audio_paused) { |
140 | wps_state.paused = audio_paused; | 140 | wps_state.paused = audio_paused; |
@@ -160,7 +160,7 @@ long gui_wps_show(void) | |||
160 | if(gui_wps[i].data->peak_meter_enabled) | 160 | if(gui_wps[i].data->peak_meter_enabled) |
161 | pm = true; | 161 | pm = true; |
162 | } | 162 | } |
163 | 163 | ||
164 | if (pm) { | 164 | if (pm) { |
165 | long next_refresh = current_tick; | 165 | long next_refresh = current_tick; |
166 | long next_big_refresh = current_tick + HZ / 5; | 166 | long next_big_refresh = current_tick + HZ / 5; |
@@ -171,7 +171,7 @@ long gui_wps_show(void) | |||
171 | break; | 171 | break; |
172 | } | 172 | } |
173 | peak_meter_peek(); | 173 | peak_meter_peek(); |
174 | sleep(0); /* Sleep until end of current tick. */ | 174 | sleep(0); /* Sleep until end of current tick. */ |
175 | 175 | ||
176 | if (TIME_AFTER(current_tick, next_refresh)) { | 176 | if (TIME_AFTER(current_tick, next_refresh)) { |
177 | FOR_NB_SCREENS(i) | 177 | FOR_NB_SCREENS(i) |
@@ -185,7 +185,7 @@ long gui_wps_show(void) | |||
185 | } | 185 | } |
186 | 186 | ||
187 | } | 187 | } |
188 | 188 | ||
189 | /* The peak meter is disabled | 189 | /* The peak meter is disabled |
190 | -> no additional screen updates needed */ | 190 | -> no additional screen updates needed */ |
191 | else { | 191 | else { |
@@ -408,7 +408,7 @@ long gui_wps_show(void) | |||
408 | if ((button == WPS_RC_PREV) && (lastbutton != WPS_RC_PREV_PRE)) | 408 | if ((button == WPS_RC_PREV) && (lastbutton != WPS_RC_PREV_PRE)) |
409 | break; | 409 | break; |
410 | #endif | 410 | #endif |
411 | #endif | 411 | #endif |
412 | left_lastclick = current_tick; | 412 | left_lastclick = current_tick; |
413 | update_track = true; | 413 | update_track = true; |
414 | 414 | ||
@@ -487,7 +487,7 @@ long gui_wps_show(void) | |||
487 | case WPS_NEXT: | 487 | case WPS_NEXT: |
488 | #ifdef WPS_NEXT_PRE | 488 | #ifdef WPS_NEXT_PRE |
489 | if (lastbutton != WPS_NEXT_PRE) | 489 | if (lastbutton != WPS_NEXT_PRE) |
490 | break; | 490 | break; |
491 | #endif | 491 | #endif |
492 | #ifdef WPS_RC_NEXT | 492 | #ifdef WPS_RC_NEXT |
493 | case WPS_RC_NEXT: | 493 | case WPS_RC_NEXT: |
@@ -607,15 +607,11 @@ long gui_wps_show(void) | |||
607 | /* pitch screen */ | 607 | /* pitch screen */ |
608 | #if CONFIG_KEYPAD == RECORDER_PAD || CONFIG_KEYPAD == IRIVER_H100_PAD \ | 608 | #if CONFIG_KEYPAD == RECORDER_PAD || CONFIG_KEYPAD == IRIVER_H100_PAD \ |
609 | || CONFIG_KEYPAD == IRIVER_H300_PAD | 609 | || CONFIG_KEYPAD == IRIVER_H300_PAD |
610 | case BUTTON_ON | BUTTON_UP: | 610 | case BUTTON_ON | BUTTON_REPEAT: |
611 | case BUTTON_ON | BUTTON_DOWN: | ||
612 | #if CONFIG_KEYPAD == IRIVER_H100_PAD || CONFIG_KEYPAD == IRIVER_H300_PAD | ||
613 | case BUTTON_ON | BUTTON_OFF: | ||
614 | #endif | ||
615 | #ifdef HAVE_LCD_COLOR | 611 | #ifdef HAVE_LCD_COLOR |
616 | lcd_set_backdrop(gui_wps[SCREEN_MAIN].data->old_backdrop); | 612 | lcd_set_backdrop(gui_wps[SCREEN_MAIN].data->old_backdrop); |
617 | #endif | 613 | #endif |
618 | if (2 == pitch_screen()) | 614 | if (1 == pitch_screen()) |
619 | return SYS_USB_CONNECTED; | 615 | return SYS_USB_CONNECTED; |
620 | #ifdef HAVE_LCD_COLOR | 616 | #ifdef HAVE_LCD_COLOR |
621 | if (gui_wps[SCREEN_MAIN].data->has_backdrop) | 617 | if (gui_wps[SCREEN_MAIN].data->has_backdrop) |
@@ -653,8 +649,8 @@ long gui_wps_show(void) | |||
653 | ab_set_A_marker(wps_state.id3->elapsed); | 649 | ab_set_A_marker(wps_state.id3->elapsed); |
654 | break; | 650 | break; |
655 | #endif | 651 | #endif |
656 | 652 | ||
657 | 653 | ||
658 | #ifdef WPS_AB_SET_A_MARKER | 654 | #ifdef WPS_AB_SET_A_MARKER |
659 | /* set A marker for A-B repeat */ | 655 | /* set A marker for A-B repeat */ |
660 | case WPS_AB_SET_A_MARKER: | 656 | case WPS_AB_SET_A_MARKER: |
@@ -717,7 +713,7 @@ long gui_wps_show(void) | |||
717 | restore = true; | 713 | restore = true; |
718 | break; | 714 | break; |
719 | #endif | 715 | #endif |
720 | 716 | ||
721 | case BUTTON_NONE: /* Timeout */ | 717 | case BUTTON_NONE: /* Timeout */ |
722 | update_track = true; | 718 | update_track = true; |
723 | break; | 719 | break; |
@@ -726,7 +722,7 @@ long gui_wps_show(void) | |||
726 | bookmark_autobookmark(); | 722 | bookmark_autobookmark(); |
727 | default_event_handler(SYS_POWEROFF); | 723 | default_event_handler(SYS_POWEROFF); |
728 | break; | 724 | break; |
729 | 725 | ||
730 | default: | 726 | default: |
731 | if(default_event_handler(button) == SYS_USB_CONNECTED) | 727 | if(default_event_handler(button) == SYS_USB_CONNECTED) |
732 | return SYS_USB_CONNECTED; | 728 | return SYS_USB_CONNECTED; |
@@ -748,7 +744,7 @@ long gui_wps_show(void) | |||
748 | if (global_settings.browse_current && | 744 | if (global_settings.browse_current && |
749 | wps_state.current_track_path[0] != '\0') | 745 | wps_state.current_track_path[0] != '\0') |
750 | set_current_file(wps_state.current_track_path); | 746 | set_current_file(wps_state.current_track_path); |
751 | 747 | ||
752 | return 0; | 748 | return 0; |
753 | } | 749 | } |
754 | update_track = false; | 750 | update_track = false; |
@@ -761,7 +757,7 @@ long gui_wps_show(void) | |||
761 | #endif | 757 | #endif |
762 | if (global_settings.fade_on_stop) | 758 | if (global_settings.fade_on_stop) |
763 | fade(0); | 759 | fade(0); |
764 | 760 | ||
765 | FOR_NB_SCREENS(i) | 761 | FOR_NB_SCREENS(i) |
766 | gui_wps[i].display->stop_scroll(); | 762 | gui_wps[i].display->stop_scroll(); |
767 | bookmark_autobookmark(); | 763 | bookmark_autobookmark(); |
@@ -778,10 +774,10 @@ long gui_wps_show(void) | |||
778 | if (global_settings.browse_current && | 774 | if (global_settings.browse_current && |
779 | wps_state.current_track_path[0] != '\0') | 775 | wps_state.current_track_path[0] != '\0') |
780 | set_current_file(wps_state.current_track_path); | 776 | set_current_file(wps_state.current_track_path); |
781 | 777 | ||
782 | return 0; | 778 | return 0; |
783 | } | 779 | } |
784 | 780 | ||
785 | if ( button ) | 781 | if ( button ) |
786 | ata_spin(); | 782 | ata_spin(); |
787 | 783 | ||
@@ -883,8 +879,8 @@ bool wps_data_load(struct wps_data *wps_data, | |||
883 | } | 879 | } |
884 | else | 880 | else |
885 | { | 881 | { |
886 | /* | 882 | /* |
887 | * Hardcode loading WPS_DEFAULTCFG to cause a reset ideally this | 883 | * Hardcode loading WPS_DEFAULTCFG to cause a reset ideally this |
888 | * wants to be a virtual file. Feel free to modify dirbrowse() | 884 | * wants to be a virtual file. Feel free to modify dirbrowse() |
889 | * if you're feeling brave. | 885 | * if you're feeling brave. |
890 | */ | 886 | */ |
@@ -893,7 +889,7 @@ bool wps_data_load(struct wps_data *wps_data, | |||
893 | wps_reset(wps_data); | 889 | wps_reset(wps_data); |
894 | global_settings.wps_file[0] = 0; | 890 | global_settings.wps_file[0] = 0; |
895 | return false; | 891 | return false; |
896 | } | 892 | } |
897 | 893 | ||
898 | #ifdef HAVE_REMOTE_LCD | 894 | #ifdef HAVE_REMOTE_LCD |
899 | if (! strcmp(buf, RWPS_DEFAULTCFG) ) | 895 | if (! strcmp(buf, RWPS_DEFAULTCFG) ) |
@@ -907,13 +903,13 @@ bool wps_data_load(struct wps_data *wps_data, | |||
907 | size_t bmpdirlen; | 903 | size_t bmpdirlen; |
908 | char *bmpdir = strrchr(buf, '.'); | 904 | char *bmpdir = strrchr(buf, '.'); |
909 | bmpdirlen = bmpdir - buf; | 905 | bmpdirlen = bmpdir - buf; |
910 | 906 | ||
911 | fd = open(buf, O_RDONLY); | 907 | fd = open(buf, O_RDONLY); |
912 | 908 | ||
913 | if (fd >= 0) | 909 | if (fd >= 0) |
914 | { | 910 | { |
915 | unsigned int start = 0; | 911 | unsigned int start = 0; |
916 | 912 | ||
917 | wps_reset(wps_data); | 913 | wps_reset(wps_data); |
918 | #ifdef HAVE_LCD_BITMAP | 914 | #ifdef HAVE_LCD_BITMAP |
919 | wps_data->img_buf_ptr = wps_data->img_buf; /* where in image buffer */ | 915 | wps_data->img_buf_ptr = wps_data->img_buf; /* where in image buffer */ |
@@ -928,7 +924,7 @@ bool wps_data_load(struct wps_data *wps_data, | |||
928 | buf, bmpdirlen)) | 924 | buf, bmpdirlen)) |
929 | { | 925 | { |
930 | start += strlen(&wps_data->format_buffer[start]); | 926 | start += strlen(&wps_data->format_buffer[start]); |
931 | 927 | ||
932 | if (start < sizeof(wps_data->format_buffer) - 1) | 928 | if (start < sizeof(wps_data->format_buffer) - 1) |
933 | { | 929 | { |
934 | wps_data->format_buffer[start++] = '\n'; | 930 | wps_data->format_buffer[start++] = '\n'; |
@@ -941,11 +937,11 @@ bool wps_data_load(struct wps_data *wps_data, | |||
941 | { | 937 | { |
942 | gui_wps_format(wps_data); | 938 | gui_wps_format(wps_data); |
943 | } | 939 | } |
944 | 940 | ||
945 | close(fd); | 941 | close(fd); |
946 | 942 | ||
947 | wps_data->wps_loaded = true; | 943 | wps_data->wps_loaded = true; |
948 | 944 | ||
949 | return start > 0; | 945 | return start > 0; |
950 | } | 946 | } |
951 | } | 947 | } |
diff --git a/apps/lang/english.lang b/apps/lang/english.lang index f2f12b51f7..b6113b6771 100644 --- a/apps/lang/english.lang +++ b/apps/lang/english.lang | |||
@@ -3827,3 +3827,8 @@ eng: "File/directory exists. Overwrite?" | |||
3827 | voice: "File or directory exists. Overwrite?" | 3827 | voice: "File or directory exists. Overwrite?" |
3828 | new: | 3828 | new: |
3829 | 3829 | ||
3830 | id: LANG_PITCH | ||
3831 | desc: "pitch" in the pitch screen | ||
3832 | eng: "Pitch" | ||
3833 | voice: "Pitch" | ||
3834 | new: | ||
diff --git a/apps/screens.c b/apps/screens.c index f9867a2526..4c71667a91 100644 --- a/apps/screens.c +++ b/apps/screens.c | |||
@@ -345,147 +345,120 @@ int charging_screen(void) | |||
345 | } | 345 | } |
346 | #endif /* HAVE_CHARGING && !HAVE_POWEROFF_WHILE_CHARGING */ | 346 | #endif /* HAVE_CHARGING && !HAVE_POWEROFF_WHILE_CHARGING */ |
347 | 347 | ||
348 | 348 | #if (CONFIG_KEYPAD != IAUDIO_X5_PAD) && (CONFIG_KEYPAD != PLAYER_PAD) | |
349 | #if CONFIG_KEYPAD == RECORDER_PAD || CONFIG_KEYPAD == IRIVER_H100_PAD \ | ||
350 | || CONFIG_KEYPAD == IRIVER_H300_PAD | ||
351 | /* returns: | 349 | /* returns: |
352 | 0 if no key was pressed | 350 | 0 if no key was pressed |
353 | 1 if a key was pressed (or if ON was held down long enough to repeat) | 351 | 1 if USB was connected */ |
354 | 2 if USB was connected */ | 352 | bool pitch_screen(void) |
355 | #if CONFIG_KEYPAD == RECORDER_PAD | ||
356 | #define PITCH_PAUSE BUTTON_PLAY | ||
357 | #elif CONFIG_KEYPAD == IRIVER_H100_PAD || CONFIG_KEYPAD == IRIVER_H300_PAD | ||
358 | #define PITCH_PAUSE BUTTON_SELECT | ||
359 | #endif | ||
360 | int pitch_screen(void) | ||
361 | { | 353 | { |
362 | int button; | 354 | int button; |
363 | int pitch = sound_get_pitch(); | 355 | int pitch = sound_get_pitch(); |
364 | bool exit = false; | 356 | bool exit = false; |
365 | bool used = false; | ||
366 | 357 | ||
367 | while (!exit) { | 358 | while (!exit) { |
359 | unsigned char* ptr; | ||
360 | unsigned char buf[32]; | ||
361 | int w, h; | ||
368 | 362 | ||
369 | if ( used ) { | 363 | lcd_clear_display(); |
370 | unsigned char* ptr; | 364 | lcd_setfont(FONT_SYSFIXED); |
371 | unsigned char buf[32]; | 365 | |
372 | int w, h; | 366 | /* UP: +0.1% */ |
373 | 367 | ptr = "+0.1%"; | |
374 | lcd_clear_display(); | 368 | lcd_getstringsize(ptr,&w,&h); |
375 | lcd_setfont(FONT_SYSFIXED); | 369 | lcd_putsxy((LCD_WIDTH-w)/2, 0, ptr); |
376 | 370 | lcd_mono_bitmap(bitmap_icons_7x8[Icon_UpArrow], | |
377 | ptr = str(LANG_PITCH_UP); | 371 | LCD_WIDTH/2 - 3, h, 7, 8); |
378 | lcd_getstringsize(ptr,&w,&h); | 372 | |
379 | lcd_putsxy((LCD_WIDTH-w)/2, 0, ptr); | 373 | /* DOWN: -0.1% */ |
380 | lcd_mono_bitmap(bitmap_icons_7x8[Icon_UpArrow], | 374 | ptr = "-0.1%"; |
381 | LCD_WIDTH/2 - 3, h*2, 7, 8); | 375 | lcd_getstringsize(ptr,&w,&h); |
382 | 376 | lcd_putsxy((LCD_WIDTH-w)/2, LCD_HEIGHT - h, ptr); | |
383 | snprintf((char *)buf, sizeof buf, "%d.%d%%", | 377 | lcd_mono_bitmap(bitmap_icons_7x8[Icon_DownArrow], |
384 | pitch / 10, pitch % 10 ); | 378 | LCD_WIDTH/2 - 3, LCD_HEIGHT - h*2, 7, 8); |
385 | lcd_getstringsize(buf,&w,&h); | 379 | |
386 | lcd_putsxy((LCD_WIDTH-w)/2, h, buf); | 380 | /* RIGHT: +2% */ |
387 | 381 | ptr = "+2%"; | |
388 | ptr = str(LANG_PITCH_DOWN); | 382 | lcd_getstringsize(ptr,&w,&h); |
389 | lcd_getstringsize(ptr,&w,&h); | 383 | lcd_putsxy(LCD_WIDTH-w, (LCD_HEIGHT-h)/2, ptr); |
390 | lcd_putsxy((LCD_WIDTH-w)/2, LCD_HEIGHT - h, ptr); | 384 | lcd_mono_bitmap(bitmap_icons_7x8[Icon_FastForward], |
391 | lcd_mono_bitmap(bitmap_icons_7x8[Icon_DownArrow], | 385 | LCD_WIDTH-w-8, (LCD_HEIGHT-h)/2, 7, 8); |
392 | LCD_WIDTH/2 - 3, LCD_HEIGHT - h*3, 7, 8); | 386 | |
393 | 387 | /* LEFT: -2% */ | |
394 | ptr = str(LANG_PAUSE); | 388 | ptr = "-2%"; |
395 | lcd_getstringsize(ptr,&w,&h); | 389 | lcd_getstringsize(ptr,&w,&h); |
396 | lcd_putsxy((LCD_WIDTH-(w/2))/2, LCD_HEIGHT/2 - h/2, ptr); | 390 | lcd_putsxy(0, (LCD_HEIGHT-h)/2, ptr); |
397 | lcd_mono_bitmap(bitmap_icons_7x8[Icon_Pause], | 391 | lcd_mono_bitmap(bitmap_icons_7x8[Icon_FastBackward], |
398 | (LCD_WIDTH-(w/2))/2-10, LCD_HEIGHT/2 - h/2, 7, 8); | 392 | w+1, (LCD_HEIGHT-h)/2, 7, 8); |
393 | |||
394 | /* "Pitch" */ | ||
395 | snprintf((char *)buf, sizeof(buf), str(LANG_PITCH)); | ||
396 | lcd_getstringsize(buf,&w,&h); | ||
397 | lcd_putsxy((LCD_WIDTH-w)/2, (LCD_HEIGHT/2)-h, buf); | ||
398 | /* "XX.X%" */ | ||
399 | snprintf((char *)buf, sizeof(buf), "%d.%d%%", | ||
400 | pitch / 10, pitch % 10 ); | ||
401 | lcd_getstringsize(buf,&w,&h); | ||
402 | lcd_putsxy((LCD_WIDTH-w)/2, LCD_HEIGHT/2, buf); | ||
399 | 403 | ||
400 | lcd_update(); | 404 | lcd_update(); |
401 | } | ||
402 | 405 | ||
403 | /* use lastbutton, so the main loop can decide whether to | 406 | /* use lastbutton, so the main loop can decide whether to |
404 | exit to browser or not */ | 407 | exit to browser or not */ |
405 | button = button_get(true); | 408 | button = button_get(true); |
406 | switch (button) { | 409 | switch (button) { |
407 | case BUTTON_UP: | 410 | case PITCH_UP: |
408 | case BUTTON_ON | BUTTON_UP: | 411 | case PITCH_UP | BUTTON_REPEAT: |
409 | case BUTTON_ON | BUTTON_UP | BUTTON_REPEAT: | ||
410 | used = true; | ||
411 | if ( pitch < 2000 ) | 412 | if ( pitch < 2000 ) |
412 | pitch++; | 413 | pitch++; |
413 | sound_set_pitch(pitch); | 414 | sound_set_pitch(pitch); |
414 | break; | 415 | break; |
415 | 416 | ||
416 | case BUTTON_DOWN: | 417 | case PITCH_DOWN: |
417 | case BUTTON_ON | BUTTON_DOWN: | 418 | case PITCH_DOWN | BUTTON_REPEAT: |
418 | case BUTTON_ON | BUTTON_DOWN | BUTTON_REPEAT: | ||
419 | used = true; | ||
420 | if ( pitch > 500 ) | 419 | if ( pitch > 500 ) |
421 | pitch--; | 420 | pitch--; |
422 | sound_set_pitch(pitch); | 421 | sound_set_pitch(pitch); |
423 | break; | 422 | break; |
424 | 423 | ||
425 | case BUTTON_ON | PITCH_PAUSE: | 424 | case PITCH_RIGHT: |
426 | audio_pause(); | 425 | case PITCH_RIGHT | BUTTON_REPEAT: |
427 | used = true; | 426 | if ( pitch < 1980 ) |
428 | break; | ||
429 | |||
430 | case PITCH_PAUSE | BUTTON_REL: | ||
431 | audio_resume(); | ||
432 | used = true; | ||
433 | break; | ||
434 | |||
435 | case BUTTON_ON | PITCH_PAUSE | BUTTON_REL: | ||
436 | audio_resume(); | ||
437 | exit = true; | ||
438 | break; | ||
439 | |||
440 | case BUTTON_ON | BUTTON_RIGHT: | ||
441 | case BUTTON_LEFT | BUTTON_REL: | ||
442 | if ( pitch < 2000 ) { | ||
443 | pitch += 20; | 427 | pitch += 20; |
444 | sound_set_pitch(pitch); | 428 | else |
445 | } | 429 | pitch = 2000; |
430 | sound_set_pitch(pitch); | ||
446 | break; | 431 | break; |
447 | 432 | ||
448 | case BUTTON_ON | BUTTON_LEFT: | 433 | case PITCH_LEFT: |
449 | case BUTTON_RIGHT | BUTTON_REL: | 434 | case PITCH_LEFT | BUTTON_REPEAT: |
450 | if ( pitch > 500 ) { | 435 | if ( pitch > 520 ) |
451 | pitch -= 20; | 436 | pitch -= 20; |
452 | sound_set_pitch(pitch); | 437 | else |
453 | } | 438 | pitch = 500; |
454 | break; | 439 | sound_set_pitch(pitch); |
455 | |||
456 | #ifdef SIMULATOR | ||
457 | case BUTTON_ON: | ||
458 | #else | ||
459 | case BUTTON_ON | BUTTON_REL: | ||
460 | case BUTTON_ON | BUTTON_UP | BUTTON_REL: | ||
461 | case BUTTON_ON | BUTTON_DOWN | BUTTON_REL: | ||
462 | #endif | ||
463 | exit = true; | ||
464 | break; | ||
465 | |||
466 | case BUTTON_ON | BUTTON_REPEAT: | ||
467 | used = true; | ||
468 | break; | 440 | break; |
469 | 441 | ||
470 | case BUTTON_ON | BUTTON_OFF: | 442 | case PITCH_RESET: |
471 | pitch = 1000; | 443 | pitch = 1000; |
472 | sound_set_pitch( pitch ); | 444 | sound_set_pitch( pitch ); |
473 | break; | 445 | break; |
474 | 446 | ||
447 | case PITCH_EXIT: | ||
448 | exit = true; | ||
449 | break; | ||
450 | |||
475 | default: | 451 | default: |
476 | if(default_event_handler(button) == SYS_USB_CONNECTED) | 452 | if(default_event_handler(button) == SYS_USB_CONNECTED) |
477 | return 2; | 453 | return 1; |
478 | break; | 454 | break; |
479 | } | 455 | } |
480 | } | 456 | } |
481 | 457 | ||
482 | lcd_setfont(FONT_UI); | 458 | lcd_setfont(FONT_UI); |
483 | 459 | return 0; | |
484 | if ( used ) | ||
485 | return 1; | ||
486 | else | ||
487 | return 0; | ||
488 | } | 460 | } |
461 | |||
489 | #endif | 462 | #endif |
490 | 463 | ||
491 | #if (CONFIG_KEYPAD == RECORDER_PAD) || (CONFIG_KEYPAD == IRIVER_H100_PAD) ||\ | 464 | #if (CONFIG_KEYPAD == RECORDER_PAD) || (CONFIG_KEYPAD == IRIVER_H100_PAD) ||\ |
diff --git a/apps/screens.h b/apps/screens.h index d9b6ba47be..c6c3e06dc6 100644 --- a/apps/screens.h +++ b/apps/screens.h | |||
@@ -22,6 +22,30 @@ | |||
22 | #include "config.h" | 22 | #include "config.h" |
23 | #include "timefuncs.h" | 23 | #include "timefuncs.h" |
24 | 24 | ||
25 | #if (CONFIG_KEYPAD == RECORDER_PAD) || (CONFIG_KEYPAD == IRIVER_H100_PAD) ||\ | ||
26 | (CONFIG_KEYPAD == IRIVER_H300_PAD) || (CONFIG_KEYPAD == ONDIO_PAD) | ||
27 | #define PITCH_UP BUTTON_UP | ||
28 | #define PITCH_DOWN BUTTON_DOWN | ||
29 | #define PITCH_RIGHT BUTTON_RIGHT | ||
30 | #define PITCH_LEFT BUTTON_LEFT | ||
31 | #define PITCH_EXIT BUTTON_OFF | ||
32 | #define PITCH_RESET BUTTON_ON | ||
33 | #elif (CONFIG_KEYPAD == ONDIO_PAD) | ||
34 | #define PITCH_UP BUTTON_UP | ||
35 | #define PITCH_DOWN BUTTON_DOWN | ||
36 | #define PITCH_RIGHT BUTTON_RIGHT | ||
37 | #define PITCH_LEFT BUTTON_LEFT | ||
38 | #define PITCH_EXIT BUTTON_OFF | ||
39 | #define PITCH_RESET BUTTON_MENU | ||
40 | #elif (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_3G_PAD) | ||
41 | #define PITCH_UP BUTTON_SCROLL_FWD | ||
42 | #define PITCH_DOWN BUTTON_SCROLL_BACK | ||
43 | #define PITCH_RIGHT BUTTON_RIGHT | ||
44 | #define PITCH_LEFT BUTTON_LEFT | ||
45 | #define PITCH_EXIT BUTTON_SELECT | ||
46 | #define PITCH_RESET BUTTON_MENU | ||
47 | #endif | ||
48 | |||
25 | struct screen; | 49 | struct screen; |
26 | 50 | ||
27 | void usb_display_info(struct screen * display); | 51 | void usb_display_info(struct screen * display); |
@@ -33,11 +57,9 @@ void charging_splash(void); | |||
33 | int mmc_remove_request(void); | 57 | int mmc_remove_request(void); |
34 | #endif | 58 | #endif |
35 | 59 | ||
36 | #if CONFIG_KEYPAD == RECORDER_PAD || CONFIG_KEYPAD == IRIVER_H100_PAD \ | 60 | bool pitch_screen(void); |
37 | || CONFIG_KEYPAD == IRIVER_H300_PAD | 61 | |
38 | int pitch_screen(void); | 62 | #if CONFIG_KEYPAD == RECORDER_PAD |
39 | #endif | ||
40 | #if CONFIG_KEYPAD == RECORDER_PAD | ||
41 | extern bool quick_screen_f3(int button_enter); | 63 | extern bool quick_screen_f3(int button_enter); |
42 | #endif | 64 | #endif |
43 | extern bool quick_screen_quick(int button_enter); | 65 | extern bool quick_screen_quick(int button_enter); |