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 #define DEFAULT_PLAYLIST_NAME "/dynamic.m3u"
34 static bool save_playlist(void)
36 char filename
[MAX_PATH
+1];
38 strncpy(filename
, DEFAULT_PLAYLIST_NAME
, sizeof(filename
));
40 if (!kbd_input(filename
, sizeof(filename
)))
42 playlist_save(NULL
, filename
);
44 /* reload in case playlist was saved to cwd */
51 static bool recurse_directory(void)
53 static const struct opt_items names
[] = {
56 { STR(LANG_RESUME_SETTING_ASK
)},
59 return set_option( str(LANG_RECURSE_DIRECTORY
),
60 &global_settings
.recursive_dir_insert
, INT
, names
, 3,
64 bool playlist_menu(void)
69 static const struct menu_item items
[] = {
70 { ID2P(LANG_CREATE_PLAYLIST
), create_playlist
},
71 { ID2P(LANG_VIEW_DYNAMIC_PLAYLIST
), playlist_viewer
},
72 { ID2P(LANG_SAVE_DYNAMIC_PLAYLIST
), save_playlist
},
73 { ID2P(LANG_RECURSE_DIRECTORY
), recurse_directory
},
76 m
= menu_init( items
, sizeof items
/ sizeof(struct menu_item
), NULL
,