diff options
| author | Björn Stenberg <bjorn@haxx.se> | 2006-03-19 08:40:31 +0000 |
|---|---|---|
| committer | Björn Stenberg <bjorn@haxx.se> | 2006-03-19 08:40:31 +0000 |
| commit | fc390af3e823addfc336d32b7fb2aaaa7e534d59 (patch) | |
| tree | ec831a1db17adfd172896307e84488432df4e687 | |
| parent | 2f438bb2da0ace06a21ce186997d86bc99f372f9 (diff) | |
| download | rockbox-fc390af3e823addfc336d32b7fb2aaaa7e534d59.zip rockbox-fc390af3e823addfc336d32b7fb2aaaa7e534d59.tar.gz rockbox-fc390af3e823addfc336d32b7fb2aaaa7e534d59.tar.bz2 rockbox-fc390af3e823addfc336d32b7fb2aaaa7e534d59.tar.xz | |
Added 'Party Mode': Unstoppable playback
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9114 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | apps/filetree.c | 26 | ||||
| -rw-r--r-- | apps/gui/gwps.c | 18 | ||||
| -rw-r--r-- | apps/lang/english.lang | 6 | ||||
| -rw-r--r-- | apps/settings.h | 1 | ||||
| -rw-r--r-- | apps/settings_menu.c | 6 | ||||
| -rw-r--r-- | apps/tree.c | 6 |
6 files changed, 59 insertions, 4 deletions
diff --git a/apps/filetree.c b/apps/filetree.c index b8f0667..846e707 100644 --- a/apps/filetree.c +++ b/apps/filetree.c @@ -344,6 +344,11 @@ int ft_enter(struct tree_context* c) gui_syncsplash(0, true, str(LANG_WAIT)); switch ( file->attr & TREE_ATTR_MASK ) { case TREE_ATTR_M3U: + if (global_settings.party_mode) { + gui_syncsplash(HZ, true, str(LANG_PARTY_MODE)); + break; + } + if (bookmark_autoload(buf)) break; @@ -385,7 +390,12 @@ int ft_enter(struct tree_context* c) break; } - if (playlist_create(c->currdir, NULL) != -1) + if (global_settings.party_mode) { + playlist_insert_track(NULL, buf, + PLAYLIST_INSERT_LAST, true); + gui_syncsplash(HZ, true, str(LANG_INSERT_LAST)); + } + else if (playlist_create(c->currdir, NULL) != -1) { start_index = ft_build_playlist(c, c->selected_item); if (global_settings.playlist_shuffle) @@ -462,6 +472,11 @@ int ft_enter(struct tree_context* c) /* plugin file */ case TREE_ATTR_ROCK: + if (global_settings.party_mode) { + gui_syncsplash(HZ, true, str(LANG_PARTY_MODE)); + break; + } + if (plugin_load(buf,NULL) == PLUGIN_USB_CONNECTED) { if(*c->dirfilter > NUM_FILTER_MODES) @@ -475,7 +490,14 @@ int ft_enter(struct tree_context* c) default: { - char* plugin = filetype_get_plugin(file); + char* plugin; + + if (global_settings.party_mode) { + gui_syncsplash(HZ, true, str(LANG_PARTY_MODE)); + break; + } + + plugin = filetype_get_plugin(file); if (plugin) { if (plugin_load(plugin,buf) == PLUGIN_USB_CONNECTED) diff --git a/apps/gui/gwps.c b/apps/gui/gwps.c index 334fc79..2ec1c4d 100644 --- a/apps/gui/gwps.c +++ b/apps/gui/gwps.c @@ -286,6 +286,8 @@ long gui_wps_show(void) #endif #ifdef WPS_RC_PAUSE case WPS_RC_PAUSE: + if (global_settings.party_mode) + break; #ifdef WPS_RC_PAUSE_PRE if ((button == WPS_RC_PAUSE) && (lastbutton != WPS_RC_PAUSE_PRE)) @@ -365,6 +367,8 @@ long gui_wps_show(void) case WPS_RC_FFWD: #endif case WPS_FFWD: + if (global_settings.party_mode) + break; #ifdef WPS_NEXT_DIR if (current_tick - right_lastclick < HZ) { @@ -377,6 +381,8 @@ long gui_wps_show(void) case WPS_RC_REW: #endif case WPS_REW: + if (global_settings.party_mode) + break; #ifdef WPS_PREV_DIR if (current_tick - left_lastclick < HZ) { @@ -396,6 +402,8 @@ long gui_wps_show(void) #endif #ifdef WPS_RC_PREV case WPS_RC_PREV: + if (global_settings.party_mode) + break; #ifdef WPS_RC_PREV_PRE if ((button == WPS_RC_PREV) && (lastbutton != WPS_RC_PREV_PRE)) break; @@ -441,6 +449,8 @@ long gui_wps_show(void) case WPS_RC_NEXT_DIR: #endif case WPS_NEXT_DIR: + if (global_settings.party_mode) + break; #if defined(AB_REPEAT_ENABLE) && defined(WPS_AB_SHARE_DIR_BUTTONS) if (ab_repeat_mode_enabled()) { @@ -460,6 +470,8 @@ long gui_wps_show(void) case WPS_RC_PREV_DIR: #endif case WPS_PREV_DIR: + if (global_settings.party_mode) + break; #if defined(AB_REPEAT_ENABLE) && defined(WPS_AB_SHARE_DIR_BUTTONS) if (ab_repeat_mode_enabled()) ab_set_A_marker(wps_state.id3->elapsed); @@ -479,6 +491,8 @@ long gui_wps_show(void) #endif #ifdef WPS_RC_NEXT case WPS_RC_NEXT: + if (global_settings.party_mode) + break; #ifdef WPS_RC_NEXT_PRE if ((button == WPS_RC_NEXT) && (lastbutton != WPS_RC_NEXT_PRE)) break; @@ -681,6 +695,8 @@ long gui_wps_show(void) if (lastbutton != WPS_EXIT_PRE) break; # endif + if (global_settings.party_mode) + break; exit = true; #ifdef WPS_RC_EXIT case WPS_RC_EXIT: @@ -688,6 +704,8 @@ long gui_wps_show(void) if (lastbutton != WPS_RC_EXIT_PRE) break; #endif + if (global_settings.party_mode) + break; exit = true; #endif break; diff --git a/apps/lang/english.lang b/apps/lang/english.lang index bc355f0..8f5d4b7 100644 --- a/apps/lang/english.lang +++ b/apps/lang/english.lang @@ -3796,3 +3796,9 @@ desc: splash number of tracks inserted eng: "Searching... %d found (%s)" voice: "" new: + +id: LANG_PARTY_MODE +desc: party mode +eng: "Party Mode" +voice: "Party Mode" +new: diff --git a/apps/settings.h b/apps/settings.h index 546c546..3d129ba 100644 --- a/apps/settings.h +++ b/apps/settings.h @@ -471,6 +471,7 @@ struct user_settings int bg_color; /* background color native format */ int fg_color; /* foreground color native format */ #endif + bool party_mode; /* party mode - unstoppable music */ }; enum optiontype { INT, BOOL }; diff --git a/apps/settings_menu.c b/apps/settings_menu.c index 7f29602..517c7f1 100644 --- a/apps/settings_menu.c +++ b/apps/settings_menu.c @@ -1041,6 +1041,11 @@ static bool set_fade_on_stop(void) return set_bool( str(LANG_FADE_ON_STOP), &global_settings.fade_on_stop ); } +static bool set_party_mode(void) +{ + return set_bool( str(LANG_PARTY_MODE), &global_settings.party_mode ); +} + static bool ff_rewind_accel(void) { @@ -1461,6 +1466,7 @@ static bool playback_settings_menu(void) { ID2P(LANG_WIND_MENU), ff_rewind_settings_menu }, { ID2P(LANG_MP3BUFFER_MARGIN), buffer_margin }, { ID2P(LANG_FADE_ON_STOP), set_fade_on_stop }, + { ID2P(LANG_PARTY_MODE), set_party_mode }, #if CONFIG_CODEC == SWCODEC { ID2P(LANG_CROSSFADE), crossfade_settings_menu }, { ID2P(LANG_REPLAYGAIN), replaygain_settings_menu }, diff --git a/apps/tree.c b/apps/tree.c index 7aa0f32..b11d28f 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -637,8 +637,10 @@ static bool dirbrowse(void) if (*tc.dirfilter < NUM_FILTER_MODES) { /* Stop the music if it is playing */ - if(audio_status()) - audio_stop(); + if(audio_status()) { + if (!global_settings.party_mode) + audio_stop(); + } #if defined(HAVE_CHARGING) && \ (CONFIG_KEYPAD == RECORDER_PAD) && !defined(HAVE_SW_POWEROFF) else { |