Pitch screen now accessible from the WPS context menu for all targets. This means pitch adjustment is now available on the iPods and iAudio X5.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9175 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Zakk Roberts 2006-03-22 02:18:44 +00:00
parent e1226f4305
commit 5b93eb6f74
3 changed files with 46 additions and 32 deletions

View file

@ -150,8 +150,8 @@ static bool list_viewers(void)
static bool shuffle_playlist(void) static bool shuffle_playlist(void)
{ {
playlist_sort(NULL, true); playlist_sort(NULL, true);
playlist_randomise(NULL, current_tick, true); playlist_randomise(NULL, current_tick, true);
return false; return false;
} }
@ -225,7 +225,7 @@ static bool view_playlist(void)
/* Sub-menu for playlist options */ /* Sub-menu for playlist options */
static bool playlist_options(void) static bool playlist_options(void)
{ {
struct menu_item items[13]; struct menu_item items[13];
struct playlist_args args[13]; /* increase these 2 if you add entries! */ struct playlist_args args[13]; /* increase these 2 if you add entries! */
int m, i=0, pstart=0, result; int m, i=0, pstart=0, result;
bool ret = false; bool ret = false;
@ -246,23 +246,23 @@ static bool playlist_options(void)
items[i].function = playlist_viewer; items[i].function = playlist_viewer;
i++; i++;
pstart++; pstart++;
items[i].desc = ID2P(LANG_SEARCH_IN_PLAYLIST); items[i].desc = ID2P(LANG_SEARCH_IN_PLAYLIST);
items[i].function = search_playlist; items[i].function = search_playlist;
i++; i++;
pstart++; pstart++;
items[i].desc = ID2P(LANG_SAVE_DYNAMIC_PLAYLIST); items[i].desc = ID2P(LANG_SAVE_DYNAMIC_PLAYLIST);
items[i].function = save_playlist; items[i].function = save_playlist;
i++; i++;
pstart++; pstart++;
items[i].desc = ID2P(LANG_SHUFFLE_PLAYLIST); items[i].desc = ID2P(LANG_SHUFFLE_PLAYLIST);
items[i].function = shuffle_playlist; items[i].function = shuffle_playlist;
i++; i++;
pstart++; pstart++;
} }
if (context == CONTEXT_TREE || context == CONTEXT_ID3DB) if (context == CONTEXT_TREE || context == CONTEXT_ID3DB)
{ {
if (audio_status() & AUDIO_STATUS_PLAY) if (audio_status() & AUDIO_STATUS_PLAY)
@ -286,7 +286,7 @@ static bool playlist_options(void)
args[i].position = PLAYLIST_INSERT_SHUFFLED; args[i].position = PLAYLIST_INSERT_SHUFFLED;
args[i].queue = false; args[i].queue = false;
i++; i++;
items[i].desc = ID2P(LANG_QUEUE); items[i].desc = ID2P(LANG_QUEUE);
args[i].position = PLAYLIST_INSERT; args[i].position = PLAYLIST_INSERT;
args[i].queue = true; args[i].queue = true;
@ -335,7 +335,7 @@ static int remove_dir(char* dirname, int len)
int result = 0; int result = 0;
DIR* dir; DIR* dir;
int dirlen = strlen(dirname); int dirlen = strlen(dirname);
dir = opendir(dirname); dir = opendir(dirname);
if (!dir) if (!dir)
return -1; /* open error */ return -1; /* open error */
@ -351,17 +351,17 @@ static int remove_dir(char* dirname, int len)
/* append name to current directory */ /* append name to current directory */
snprintf(dirname+dirlen, len-dirlen, "/%s", entry->d_name); snprintf(dirname+dirlen, len-dirlen, "/%s", entry->d_name);
if (entry->attribute & ATTR_DIRECTORY) if (entry->attribute & ATTR_DIRECTORY)
{ /* remove a subdirectory */ { /* remove a subdirectory */
if (!strcmp((char *)entry->d_name, ".") || if (!strcmp((char *)entry->d_name, ".") ||
!strcmp((char *)entry->d_name, "..")) !strcmp((char *)entry->d_name, ".."))
continue; /* skip these */ continue; /* skip these */
result = remove_dir(dirname, len); /* recursion */ result = remove_dir(dirname, len); /* recursion */
if (result) if (result)
break; /* or better continue, delete what we can? */ break; /* or better continue, delete what we can? */
} }
else else
{ /* remove a file */ { /* remove a file */
result = remove(dirname); result = remove(dirname);
} }
@ -371,7 +371,7 @@ static int remove_dir(char* dirname, int len)
if (!result) if (!result)
{ /* remove the now empty directory */ { /* remove the now empty directory */
dirname[dirlen] = '\0'; /* terminate to original length */ dirname[dirlen] = '\0'; /* terminate to original length */
result = rmdir(dirname); result = rmdir(dirname);
} }
@ -433,7 +433,7 @@ static bool set_backdrop(void)
ret = read_bmp_file(selected_file, &bm, ret = read_bmp_file(selected_file, &bm,
sizeof(main_backdrop), FORMAT_NATIVE); sizeof(main_backdrop), FORMAT_NATIVE);
if ((ret > 0) && (bm.width == LCD_WIDTH) if ((ret > 0) && (bm.width == LCD_WIDTH)
&& (bm.height == LCD_HEIGHT)) { && (bm.height == LCD_HEIGHT)) {
lcd_set_backdrop(&main_backdrop[0][0]); lcd_set_backdrop(&main_backdrop[0][0]);
gui_syncsplash(HZ, true, str(LANG_BACKDROP_LOADED)); gui_syncsplash(HZ, true, str(LANG_BACKDROP_LOADED));
@ -478,7 +478,7 @@ bool create_dir(void)
cwd = getcwd(NULL, 0); cwd = getcwd(NULL, 0);
memset(dirname, 0, sizeof dirname); memset(dirname, 0, sizeof dirname);
snprintf(dirname, sizeof dirname, "%s/", snprintf(dirname, sizeof dirname, "%s/",
cwd[1] ? cwd : ""); cwd[1] ? cwd : "");
@ -506,7 +506,7 @@ static bool clipboard_clip(bool copy)
clipboard_selection_attr = selected_file_attr; clipboard_selection_attr = selected_file_attr;
clipboard_is_copy = copy; clipboard_is_copy = copy;
return true; return true;
} }
static bool clipboard_cut(void) static bool clipboard_cut(void)
@ -543,7 +543,7 @@ static bool clipboard_pastefile(const char *src, const char *target, bool copy)
src_fd = open(src, O_RDONLY); src_fd = open(src, O_RDONLY);
if (src_fd >= 0) { if (src_fd >= 0) {
target_fd = creat(target, O_WRONLY); target_fd = creat(target, O_WRONLY);
if (target_fd >= 0) { if (target_fd >= 0) {
@ -619,7 +619,7 @@ static bool clipboard_pastedirectory(char *src, int srclen, char *target, int ta
/* Check if the target exists */ /* Check if the target exists */
fd = open(target, O_RDONLY); fd = open(target, O_RDONLY);
close(fd); close(fd);
if (fd < 0) { if (fd < 0) {
if (!copy) { if (!copy) {
/* Just move the directory */ /* Just move the directory */
@ -668,7 +668,7 @@ static bool clipboard_pastedirectory(char *src, int srclen, char *target, int ta
DEBUGF("Copy %s to %s\n", src, target); DEBUGF("Copy %s to %s\n", src, target);
if (entry->attribute & ATTR_DIRECTORY) if (entry->attribute & ATTR_DIRECTORY)
{ /* copy/move a subdirectory */ { /* copy/move a subdirectory */
if (!strcmp((char *)entry->d_name, ".") || if (!strcmp((char *)entry->d_name, ".") ||
!strcmp((char *)entry->d_name, "..")) !strcmp((char *)entry->d_name, ".."))
@ -676,7 +676,7 @@ static bool clipboard_pastedirectory(char *src, int srclen, char *target, int ta
result = clipboard_pastedirectory(src, srclen, target, targetlen, copy); /* recursion */ result = clipboard_pastedirectory(src, srclen, target, targetlen, copy); /* recursion */
} }
else else
{ /* copy/move a file */ { /* copy/move a file */
result = clipboard_pastefile(src, target, copy); result = clipboard_pastefile(src, target, copy);
} }
@ -748,7 +748,7 @@ static bool clipboard_paste(void)
onplay_result = ONPLAY_RELOAD_DIR; onplay_result = ONPLAY_RELOAD_DIR;
} else { } else {
gui_syncsplash(HZ, true, (unsigned char *)"%s %s", gui_syncsplash(HZ, true, (unsigned char *)"%s %s",
str(LANG_PASTE), str(LANG_FAILED)); str(LANG_PASTE), str(LANG_FAILED));
} }
return true; return true;
@ -812,7 +812,7 @@ int onplay(char* file, int attr, int from)
items[i].function = bookmark_menu; items[i].function = bookmark_menu;
i++; i++;
} }
if (file) if (file)
{ {
if (context == CONTEXT_WPS) if (context == CONTEXT_WPS)
@ -827,7 +827,7 @@ int onplay(char* file, int attr, int from)
i++; i++;
} }
} }
#ifdef HAVE_MULTIVOLUME #ifdef HAVE_MULTIVOLUME
if (!(attr & ATTR_VOLUME)) /* no rename+delete for volumes */ if (!(attr & ATTR_VOLUME)) /* no rename+delete for volumes */
#endif #endif
@ -907,19 +907,22 @@ int onplay(char* file, int attr, int from)
items[i].function = create_dir; items[i].function = create_dir;
i++; i++;
} }
#if CONFIG_CODEC == SWCODEC
/* Equalizer menu items */
if (context == CONTEXT_WPS) if (context == CONTEXT_WPS)
{ {
/* Pitch screen access */
items[i].desc = ID2P(LANG_PITCH);
items[i].function = pitch_screen;
i++;
#if CONFIG_CODEC == SWCODEC
/* Equalizer menu items */
items[i].desc = ID2P(LANG_EQUALIZER_GRAPHICAL); items[i].desc = ID2P(LANG_EQUALIZER_GRAPHICAL);
items[i].function = eq_menu_graphical; items[i].function = eq_menu_graphical;
i++; i++;
items[i].desc = ID2P(LANG_EQUALIZER_BROWSE); items[i].desc = ID2P(LANG_EQUALIZER_BROWSE);
items[i].function = eq_browse_presets; items[i].function = eq_browse_presets;
i++; i++;
}
#endif #endif
}
/* DIY menu handling, since we want to exit after selection */ /* DIY menu handling, since we want to exit after selection */
if (i) if (i)
@ -929,7 +932,7 @@ int onplay(char* file, int attr, int from)
if (result >= 0) if (result >= 0)
items[result].function(); items[result].function();
menu_exit(m); menu_exit(m);
if (exit_to_main) if (exit_to_main)
result = main_menu(); result = main_menu();

View file

@ -345,7 +345,6 @@ int charging_screen(void)
} }
#endif /* HAVE_CHARGING && !HAVE_POWEROFF_WHILE_CHARGING */ #endif /* HAVE_CHARGING && !HAVE_POWEROFF_WHILE_CHARGING */
#if (CONFIG_KEYPAD != IAUDIO_X5_PAD) && (CONFIG_KEYPAD != PLAYER_PAD)
/* returns: /* returns:
0 if no key was pressed 0 if no key was pressed
1 if USB was connected */ 1 if USB was connected */
@ -459,8 +458,6 @@ bool pitch_screen(void)
return 0; return 0;
} }
#endif
#if (CONFIG_KEYPAD == RECORDER_PAD) || (CONFIG_KEYPAD == IRIVER_H100_PAD) ||\ #if (CONFIG_KEYPAD == RECORDER_PAD) || (CONFIG_KEYPAD == IRIVER_H100_PAD) ||\
(CONFIG_KEYPAD == IRIVER_H300_PAD) (CONFIG_KEYPAD == IRIVER_H300_PAD)
#define bool_to_int(b)\ #define bool_to_int(b)\

View file

@ -44,6 +44,20 @@
#define PITCH_LEFT BUTTON_LEFT #define PITCH_LEFT BUTTON_LEFT
#define PITCH_EXIT BUTTON_SELECT #define PITCH_EXIT BUTTON_SELECT
#define PITCH_RESET BUTTON_MENU #define PITCH_RESET BUTTON_MENU
#elif (CONFIG_KEYPAD == GIGABEAT_PAD)
#define PITCH_UP BUTTON_UP
#define PITCH_DOWN BUTTON_DOWN
#define PITCH_RIGHT BUTTON_RIGHT
#define PITCH_LEFT BUTTON_LEFT
#define PITCH_EXIT BUTTON_SELECT
#define PITCH_RESET BUTTON_A
#elif (CONFIG_KEYPAD == IAUDIO_X5_PAD)
#define PITCH_UP BUTTON_UP
#define PITCH_DOWN BUTTON_DOWN
#define PITCH_RIGHT BUTTON_RIGHT
#define PITCH_LEFT BUTTON_LEFT
#define PITCH_EXIT BUTTON_PLAY
#define PITCH_RESET BUTTON_POWER
#endif #endif
struct screen; struct screen;