mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-09 13:12:37 -05:00
Move the playlist menu to the new system
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12268 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
26d8dce20a
commit
e84ff179cb
4 changed files with 55 additions and 107 deletions
|
|
@ -21,6 +21,7 @@
|
|||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <limits.h>
|
||||
#include <string.h>
|
||||
#include "config.h"
|
||||
#include "lang.h"
|
||||
#include "action.h"
|
||||
|
|
@ -28,5 +29,55 @@
|
|||
#include "menu.h"
|
||||
#include "playlist_menu.h"
|
||||
|
||||
MENUITEM_FUNCTION(playlist_menu_item, ID2P(LANG_PLAYLIST_MENU), (menu_function)playlist_menu, NULL);
|
||||
#include "menu.h"
|
||||
#include "file.h"
|
||||
#include "keyboard.h"
|
||||
#include "playlist.h"
|
||||
#include "tree.h"
|
||||
#include "playlist_viewer.h"
|
||||
#include "talk.h"
|
||||
#include "playlist_catalog.h"
|
||||
|
||||
int save_playlist_screen(struct playlist_info* playlist)
|
||||
{
|
||||
char temp[MAX_PATH+1];
|
||||
int len;
|
||||
|
||||
playlist_get_name(playlist, temp, sizeof(temp));
|
||||
len = strlen(temp);
|
||||
|
||||
if (len > 4 && !strcasecmp(&temp[len-4], ".m3u"))
|
||||
strcat(temp, "8");
|
||||
|
||||
if (len <= 5 || strcasecmp(&temp[len-5], ".m3u8"))
|
||||
strcpy(temp, DEFAULT_DYNAMIC_PLAYLIST_NAME);
|
||||
|
||||
if (!kbd_input(temp, sizeof(temp)))
|
||||
{
|
||||
playlist_save(playlist, temp);
|
||||
|
||||
/* reload in case playlist was saved to cwd */
|
||||
reload_directory();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
MENUITEM_FUNCTION(create_playlist_item, ID2P(LANG_CREATE_PLAYLIST),
|
||||
(int(*)(void))create_playlist, NULL);
|
||||
MENUITEM_FUNCTION(view_playlist, ID2P(LANG_VIEW_DYNAMIC_PLAYLIST),
|
||||
(int(*)(void))playlist_viewer, NULL);
|
||||
MENUITEM_FUNCTION_WPARAM(save_playlist, ID2P(LANG_SAVE_DYNAMIC_PLAYLIST),
|
||||
(int(*)(void*))save_playlist_screen, NULL, NULL);
|
||||
MENUITEM_FUNCTION(catalog, ID2P(LANG_CATALOG),
|
||||
(int(*)(void))catalog_view_playlists, NULL);
|
||||
MENUITEM_SETTING(recursive_dir_insert, &global_settings.recursive_dir_insert, NULL);
|
||||
MENUITEM_SETTING(warn_on_erase, &global_settings.warnon_erase_dynplaylist, NULL);
|
||||
|
||||
MAKE_MENU(playlist_menu_item, ID2P(LANG_PLAYLIST_MENU), NULL,
|
||||
&create_playlist_item, &view_playlist, &save_playlist, &catalog,
|
||||
&recursive_dir_insert, &warn_on_erase);
|
||||
|
||||
bool playlist_menu(void)
|
||||
{
|
||||
return do_menu(&playlist_menu_item);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue