1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2002 Björn Stenberg
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
28 #include "playlist_viewer.h"
32 /* FIXME: there is a very similar function in onplay.c */
33 static bool save_playlist(void)
35 char filename
[MAX_PATH
+1];
37 strncpy(filename
, DEFAULT_DYNAMIC_PLAYLIST_NAME
, sizeof(filename
));
39 if (!kbd_input(filename
, sizeof(filename
)))
41 playlist_save(NULL
, filename
);
43 /* reload in case playlist was saved to cwd */
50 static bool recurse_directory(void)
52 static const struct opt_items names
[] = {
55 { STR(LANG_RESUME_SETTING_ASK
)},
58 return set_option( str(LANG_RECURSE_DIRECTORY
),
59 &global_settings
.recursive_dir_insert
, INT
, names
, 3,
63 bool playlist_menu(void)
68 static const struct menu_item items
[] = {
69 { ID2P(LANG_CREATE_PLAYLIST
), create_playlist
},
70 { ID2P(LANG_VIEW_DYNAMIC_PLAYLIST
), playlist_viewer
},
71 { ID2P(LANG_SAVE_DYNAMIC_PLAYLIST
), save_playlist
},
72 { ID2P(LANG_RECURSE_DIRECTORY
), recurse_directory
},
75 m
= menu_init( items
, sizeof items
/ sizeof(struct menu_item
), NULL
,