diff options
Diffstat (limited to 'apps/plugins/lrcplayer.c')
-rw-r--r-- | apps/plugins/lrcplayer.c | 36 |
1 files changed, 6 insertions, 30 deletions
diff --git a/apps/plugins/lrcplayer.c b/apps/plugins/lrcplayer.c index f42b96b5b3..d341e6b7a5 100644 --- a/apps/plugins/lrcplayer.c +++ b/apps/plugins/lrcplayer.c @@ -643,22 +643,6 @@ static void init_time_tag(void) * /ddd.lrc */ -/* taken from apps/recorder/albumart.c */ -static void fix_filename(char* name) -{ - static const char invalid_chars[] = "*/:<>?\\|"; - - while (1) - { - if (*name == 0) - return; - if (*name == '"') - *name = '\''; - else if (rb->strchr(invalid_chars, *name)) - *name = '_'; - name++; - } -} static bool find_lrc_file_helper(const char *base_dir) { char fname[MAX_PATH]; @@ -678,7 +662,7 @@ static bool find_lrc_file_helper(const char *base_dir) if (current.id3->title && rb->strcmp(names[0], current.id3->title)) { rb->strlcpy(fname, current.id3->title, sizeof(fname)); - fix_filename(fname); + rb->fix_path_part(fname, 0, sizeof(fname) - 1); names[1] = fname; } @@ -2078,8 +2062,7 @@ static int timetag_editor(void) while (!exit) { button = rb->get_action(CONTEXT_TREE, TIMEOUT_BLOCK); - if (rb->gui_synclist_do_button(&gui_editor, &button, - LIST_WRAP_UNLESS_HELD)) + if (rb->gui_synclist_do_button(&gui_editor, &button)) continue; switch (button) @@ -2305,7 +2288,7 @@ static bool lrc_display_menu(void) usb = rb->set_bool("Wipe", &prefs.wipe); break; case LRC_MENU_ALIGN: - usb = rb->set_option("Alignment", &prefs.align, INT, + usb = rb->set_option("Alignment", &prefs.align, RB_INT, align_names, 3, NULL); break; case LRC_MENU_LINE_MODE: @@ -2362,7 +2345,7 @@ static bool lrc_lyrics_menu(void) case LRC_MENU_ENCODING: prefs.encoding++; old_val = prefs.encoding; - usb = rb->set_option("Encoding", &prefs.encoding, INT, + usb = rb->set_option("Encoding", &prefs.encoding, RB_INT, cp_names, NUM_CODEPAGES+1, NULL); if (prefs.encoding != old_val) { @@ -2437,7 +2420,6 @@ static bool lrc_debug_menu(void) { struct simplelist_info info; rb->simplelist_info_init(&info, "Debug Menu", 6, NULL); - info.hide_selection = true; info.scroll_all = true; info.get_name = lrc_debug_data; return rb->simplelist_show_list(&info); @@ -2643,16 +2625,10 @@ static int handle_button(void) ff_rewind(0, false); break; case ACTION_WPS_VOLDOWN: - limit = rb->sound_min(SOUND_VOLUME); - if (--rb->global_settings->volume < limit) - rb->global_settings->volume = limit; - rb->sound_set(SOUND_VOLUME, rb->global_settings->volume); + rb->adjust_volume(-1); break; case ACTION_WPS_VOLUP: - limit = rb->sound_max(SOUND_VOLUME); - if (++rb->global_settings->volume > limit) - rb->global_settings->volume = limit; - rb->sound_set(SOUND_VOLUME, rb->global_settings->volume); + rb->adjust_volume(1); break; case ACTION_WPS_CONTEXT: ret = LRC_GOTO_EDITOR; |