diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2005-06-24 16:32:30 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2005-06-24 16:32:30 +0000 |
commit | 37d7c472ba35acada8e77db7fba24643ab5c0ceb (patch) | |
tree | 1ac7ae80be87df6d5d19a38f4b468f19a63eda18 | |
parent | 7600708a7a11a525e4c1212c5c081ff0bf4e7e37 (diff) | |
download | rockbox-37d7c472ba35acada8e77db7fba24643ab5c0ceb.tar.gz rockbox-37d7c472ba35acada8e77db7fba24643ab5c0ceb.zip |
Put back the playlist creation options in the main menu
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6854 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/onplay.c | 4 | ||||
-rw-r--r-- | apps/playlist.h | 2 | ||||
-rw-r--r-- | apps/playlist_menu.c | 23 | ||||
-rw-r--r-- | apps/playlist_viewer.c | 4 |
4 files changed, 28 insertions, 5 deletions
diff --git a/apps/onplay.c b/apps/onplay.c index e01dc60f5b..da6d9f3e2f 100644 --- a/apps/onplay.c +++ b/apps/onplay.c | |||
@@ -53,8 +53,6 @@ | |||
53 | #endif | 53 | #endif |
54 | #include "main_menu.h" | 54 | #include "main_menu.h" |
55 | 55 | ||
56 | #define DEFAULT_PLAYLIST_NAME "/dynamic.m3u" | ||
57 | |||
58 | static int context; | 56 | static int context; |
59 | static char* selected_file = NULL; | 57 | static char* selected_file = NULL; |
60 | static int selected_file_attr = 0; | 58 | static int selected_file_attr = 0; |
@@ -146,7 +144,7 @@ static bool save_playlist(void) | |||
146 | { | 144 | { |
147 | char filename[MAX_PATH+1]; | 145 | char filename[MAX_PATH+1]; |
148 | 146 | ||
149 | strncpy(filename, DEFAULT_PLAYLIST_NAME, sizeof(filename)); | 147 | strncpy(filename, DEFAULT_DYNAMIC_PLAYLIST_NAME, sizeof(filename)); |
150 | 148 | ||
151 | if (!kbd_input(filename, sizeof(filename))) | 149 | if (!kbd_input(filename, sizeof(filename))) |
152 | { | 150 | { |
diff --git a/apps/playlist.h b/apps/playlist.h index 279c74f740..b5a6e17426 100644 --- a/apps/playlist.h +++ b/apps/playlist.h | |||
@@ -58,6 +58,8 @@ struct playlist_info | |||
58 | #define PLAYLIST_ATTR_QUEUED 0x01 | 58 | #define PLAYLIST_ATTR_QUEUED 0x01 |
59 | #define PLAYLIST_ATTR_INSERTED 0x02 | 59 | #define PLAYLIST_ATTR_INSERTED 0x02 |
60 | 60 | ||
61 | #define DEFAULT_DYNAMIC_PLAYLIST_NAME "/dynamic.m3u" | ||
62 | |||
61 | struct playlist_track_info | 63 | struct playlist_track_info |
62 | { | 64 | { |
63 | char filename[MAX_PATH]; /* path name of mp3 file */ | 65 | char filename[MAX_PATH]; /* path name of mp3 file */ |
diff --git a/apps/playlist_menu.c b/apps/playlist_menu.c index 444e0ae3d2..c6ccd5a45a 100644 --- a/apps/playlist_menu.c +++ b/apps/playlist_menu.c | |||
@@ -20,13 +20,33 @@ | |||
20 | #include <string.h> | 20 | #include <string.h> |
21 | 21 | ||
22 | #include "menu.h" | 22 | #include "menu.h" |
23 | #include "file.h" | ||
23 | #include "keyboard.h" | 24 | #include "keyboard.h" |
24 | #include "playlist.h" | 25 | #include "playlist.h" |
25 | #include "tree.h" | 26 | #include "tree.h" |
26 | #include "settings.h" | 27 | #include "settings.h" |
28 | #include "playlist_viewer.h" | ||
27 | #include "talk.h" | 29 | #include "talk.h" |
28 | #include "lang.h" | 30 | #include "lang.h" |
29 | 31 | ||
32 | /* FIXME: there is a very similar function in onplay.c */ | ||
33 | static bool save_playlist(void) | ||
34 | { | ||
35 | char filename[MAX_PATH+1]; | ||
36 | |||
37 | strncpy(filename, DEFAULT_DYNAMIC_PLAYLIST_NAME, sizeof(filename)); | ||
38 | |||
39 | if (!kbd_input(filename, sizeof(filename))) | ||
40 | { | ||
41 | playlist_save(NULL, filename); | ||
42 | |||
43 | /* reload in case playlist was saved to cwd */ | ||
44 | reload_directory(); | ||
45 | } | ||
46 | |||
47 | return false; | ||
48 | } | ||
49 | |||
30 | static bool recurse_directory(void) | 50 | static bool recurse_directory(void) |
31 | { | 51 | { |
32 | static const struct opt_items names[] = { | 52 | static const struct opt_items names[] = { |
@@ -46,6 +66,9 @@ bool playlist_menu(void) | |||
46 | bool result; | 66 | bool result; |
47 | 67 | ||
48 | static const struct menu_item items[] = { | 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 }, | ||
49 | { ID2P(LANG_RECURSE_DIRECTORY), recurse_directory }, | 72 | { ID2P(LANG_RECURSE_DIRECTORY), recurse_directory }, |
50 | }; | 73 | }; |
51 | 74 | ||
diff --git a/apps/playlist_viewer.c b/apps/playlist_viewer.c index 2cdfa7f582..d851470392 100644 --- a/apps/playlist_viewer.c +++ b/apps/playlist_viewer.c | |||
@@ -78,7 +78,7 @@ | |||
78 | #define MAX_PLAYLIST_ENTRIES 200 | 78 | #define MAX_PLAYLIST_ENTRIES 200 |
79 | 79 | ||
80 | /* Default playlist name for saving */ | 80 | /* Default playlist name for saving */ |
81 | #define DEFAULT_PLAYLIST_NAME "/viewer.m3u" | 81 | #define DEFAULT_VIEWER_PLAYLIST_NAME "/viewer.m3u" |
82 | 82 | ||
83 | /* Index of track on display line _pos */ | 83 | /* Index of track on display line _pos */ |
84 | #define INDEX(_pos) (viewer.first_display_index - viewer.first_index + (_pos)) | 84 | #define INDEX(_pos) (viewer.first_display_index - viewer.first_index + (_pos)) |
@@ -797,7 +797,7 @@ static bool save_playlist(void) | |||
797 | { | 797 | { |
798 | char filename[MAX_PATH+1]; | 798 | char filename[MAX_PATH+1]; |
799 | 799 | ||
800 | strncpy(filename, DEFAULT_PLAYLIST_NAME, sizeof(filename)); | 800 | strncpy(filename, DEFAULT_VIEWER_PLAYLIST_NAME, sizeof(filename)); |
801 | 801 | ||
802 | if (!kbd_input(filename, sizeof(filename))) | 802 | if (!kbd_input(filename, sizeof(filename))) |
803 | { | 803 | { |