diff options
author | Björn Stenberg <bjorn@haxx.se> | 2004-09-19 21:58:37 +0000 |
---|---|---|
committer | Björn Stenberg <bjorn@haxx.se> | 2004-09-19 21:58:37 +0000 |
commit | 6c33c51a4ca9907d23e3154d956fd6781122f492 (patch) | |
tree | f0e598efaf064bb72c33c0a8a2edba4cf9ebb13c /apps/playlist.c | |
parent | 17f54a40f100a3343a15a431d235699024aa76c8 (diff) |
Redesigned the button handling. The code now uses symbolic function defines instead of checking for specific buttons. This makes it easier to add support for new devices with different button layouts.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5091 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/playlist.c')
-rw-r--r-- | apps/playlist.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/apps/playlist.c b/apps/playlist.c index 5725c4be85..ecdb45c104 100644 --- a/apps/playlist.c +++ b/apps/playlist.c @@ -564,11 +564,7 @@ static int add_directory_to_playlist(struct playlist_info* playlist, for (i=0; i<num_files; i++) { /* user abort */ -#if defined(HAVE_PLAYER_KEYPAD) || defined(HAVE_NEO_KEYPAD) || defined(HAVE_ONDIO_KEYPAD) - if (button_get(false) == BUTTON_STOP) -#else - if (button_get(false) == BUTTON_OFF) -#endif + if (button_get(false) == SETTINGS_CANCEL) { result = -1; break; @@ -2016,11 +2012,7 @@ int playlist_insert_playlist(struct playlist_info* playlist, char *filename, while ((max = read_line(fd, temp_buf, sizeof(temp_buf))) > 0) { /* user abort */ -#if defined(HAVE_PLAYER_KEYPAD) || defined(HAVE_NEO_KEYPAD) || defined(HAVE_ONDIO_KEYPAD) - if (button_get(false) == BUTTON_STOP) -#else - if (button_get(false) == BUTTON_OFF) -#endif + if (button_get(false) == SETTINGS_CANCEL) break; if (temp_buf[0] != '#' && temp_buf[0] != '\0') @@ -2384,11 +2376,7 @@ int playlist_save(struct playlist_info* playlist, char *filename) int seek; /* user abort */ -#if defined(HAVE_PLAYER_KEYPAD) || defined(HAVE_NEO_KEYPAD) || defined(HAVE_ONDIO_KEYPAD) - if (button_get(false) == BUTTON_STOP) -#else - if (button_get(false) == BUTTON_OFF) -#endif + if (button_get(false) == SETTINGS_CANCEL) break; control_file = playlist->indices[index] & PLAYLIST_INSERT_TYPE_MASK; |