Added 'Party Mode': Unstoppable playback

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9114 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Björn Stenberg 2006-03-19 08:40:31 +00:00
parent 2f438bb2da
commit fc390af3e8
6 changed files with 59 additions and 4 deletions

View file

@ -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)

View file

@ -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;

View file

@ -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:

View file

@ -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 };

View file

@ -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 },

View file

@ -637,8 +637,10 @@ static bool dirbrowse(void)
if (*tc.dirfilter < NUM_FILTER_MODES)
{
/* Stop the music if it is playing */
if(audio_status())
if(audio_status()) {
if (!global_settings.party_mode)
audio_stop();
}
#if defined(HAVE_CHARGING) && \
(CONFIG_KEYPAD == RECORDER_PAD) && !defined(HAVE_SW_POWEROFF)
else {