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 /apps | |
parent | 2f438bb2da0ace06a21ce186997d86bc99f372f9 (diff) | |
download | rockbox-fc390af3e823addfc336d32b7fb2aaaa7e534d59.tar.gz rockbox-fc390af3e823addfc336d32b7fb2aaaa7e534d59.zip |
Added 'Party Mode': Unstoppable playback
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9114 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-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 b8f066745f..846e707112 100644 --- a/apps/filetree.c +++ b/apps/filetree.c | |||
@@ -344,6 +344,11 @@ int ft_enter(struct tree_context* c) | |||
344 | gui_syncsplash(0, true, str(LANG_WAIT)); | 344 | gui_syncsplash(0, true, str(LANG_WAIT)); |
345 | switch ( file->attr & TREE_ATTR_MASK ) { | 345 | switch ( file->attr & TREE_ATTR_MASK ) { |
346 | case TREE_ATTR_M3U: | 346 | case TREE_ATTR_M3U: |
347 | if (global_settings.party_mode) { | ||
348 | gui_syncsplash(HZ, true, str(LANG_PARTY_MODE)); | ||
349 | break; | ||
350 | } | ||
351 | |||
347 | if (bookmark_autoload(buf)) | 352 | if (bookmark_autoload(buf)) |
348 | break; | 353 | break; |
349 | 354 | ||
@@ -385,7 +390,12 @@ int ft_enter(struct tree_context* c) | |||
385 | break; | 390 | break; |
386 | } | 391 | } |
387 | 392 | ||
388 | if (playlist_create(c->currdir, NULL) != -1) | 393 | if (global_settings.party_mode) { |
394 | playlist_insert_track(NULL, buf, | ||
395 | PLAYLIST_INSERT_LAST, true); | ||
396 | gui_syncsplash(HZ, true, str(LANG_INSERT_LAST)); | ||
397 | } | ||
398 | else if (playlist_create(c->currdir, NULL) != -1) | ||
389 | { | 399 | { |
390 | start_index = ft_build_playlist(c, c->selected_item); | 400 | start_index = ft_build_playlist(c, c->selected_item); |
391 | if (global_settings.playlist_shuffle) | 401 | if (global_settings.playlist_shuffle) |
@@ -462,6 +472,11 @@ int ft_enter(struct tree_context* c) | |||
462 | 472 | ||
463 | /* plugin file */ | 473 | /* plugin file */ |
464 | case TREE_ATTR_ROCK: | 474 | case TREE_ATTR_ROCK: |
475 | if (global_settings.party_mode) { | ||
476 | gui_syncsplash(HZ, true, str(LANG_PARTY_MODE)); | ||
477 | break; | ||
478 | } | ||
479 | |||
465 | if (plugin_load(buf,NULL) == PLUGIN_USB_CONNECTED) | 480 | if (plugin_load(buf,NULL) == PLUGIN_USB_CONNECTED) |
466 | { | 481 | { |
467 | if(*c->dirfilter > NUM_FILTER_MODES) | 482 | if(*c->dirfilter > NUM_FILTER_MODES) |
@@ -475,7 +490,14 @@ int ft_enter(struct tree_context* c) | |||
475 | 490 | ||
476 | default: | 491 | default: |
477 | { | 492 | { |
478 | char* plugin = filetype_get_plugin(file); | 493 | char* plugin; |
494 | |||
495 | if (global_settings.party_mode) { | ||
496 | gui_syncsplash(HZ, true, str(LANG_PARTY_MODE)); | ||
497 | break; | ||
498 | } | ||
499 | |||
500 | plugin = filetype_get_plugin(file); | ||
479 | if (plugin) | 501 | if (plugin) |
480 | { | 502 | { |
481 | if (plugin_load(plugin,buf) == PLUGIN_USB_CONNECTED) | 503 | if (plugin_load(plugin,buf) == PLUGIN_USB_CONNECTED) |
diff --git a/apps/gui/gwps.c b/apps/gui/gwps.c index 334fc79bd3..2ec1c4dcc7 100644 --- a/apps/gui/gwps.c +++ b/apps/gui/gwps.c | |||
@@ -286,6 +286,8 @@ long gui_wps_show(void) | |||
286 | #endif | 286 | #endif |
287 | #ifdef WPS_RC_PAUSE | 287 | #ifdef WPS_RC_PAUSE |
288 | case WPS_RC_PAUSE: | 288 | case WPS_RC_PAUSE: |
289 | if (global_settings.party_mode) | ||
290 | break; | ||
289 | #ifdef WPS_RC_PAUSE_PRE | 291 | #ifdef WPS_RC_PAUSE_PRE |
290 | if ((button == WPS_RC_PAUSE) && | 292 | if ((button == WPS_RC_PAUSE) && |
291 | (lastbutton != WPS_RC_PAUSE_PRE)) | 293 | (lastbutton != WPS_RC_PAUSE_PRE)) |
@@ -365,6 +367,8 @@ long gui_wps_show(void) | |||
365 | case WPS_RC_FFWD: | 367 | case WPS_RC_FFWD: |
366 | #endif | 368 | #endif |
367 | case WPS_FFWD: | 369 | case WPS_FFWD: |
370 | if (global_settings.party_mode) | ||
371 | break; | ||
368 | #ifdef WPS_NEXT_DIR | 372 | #ifdef WPS_NEXT_DIR |
369 | if (current_tick - right_lastclick < HZ) | 373 | if (current_tick - right_lastclick < HZ) |
370 | { | 374 | { |
@@ -377,6 +381,8 @@ long gui_wps_show(void) | |||
377 | case WPS_RC_REW: | 381 | case WPS_RC_REW: |
378 | #endif | 382 | #endif |
379 | case WPS_REW: | 383 | case WPS_REW: |
384 | if (global_settings.party_mode) | ||
385 | break; | ||
380 | #ifdef WPS_PREV_DIR | 386 | #ifdef WPS_PREV_DIR |
381 | if (current_tick - left_lastclick < HZ) | 387 | if (current_tick - left_lastclick < HZ) |
382 | { | 388 | { |
@@ -396,6 +402,8 @@ long gui_wps_show(void) | |||
396 | #endif | 402 | #endif |
397 | #ifdef WPS_RC_PREV | 403 | #ifdef WPS_RC_PREV |
398 | case WPS_RC_PREV: | 404 | case WPS_RC_PREV: |
405 | if (global_settings.party_mode) | ||
406 | break; | ||
399 | #ifdef WPS_RC_PREV_PRE | 407 | #ifdef WPS_RC_PREV_PRE |
400 | if ((button == WPS_RC_PREV) && (lastbutton != WPS_RC_PREV_PRE)) | 408 | if ((button == WPS_RC_PREV) && (lastbutton != WPS_RC_PREV_PRE)) |
401 | break; | 409 | break; |
@@ -441,6 +449,8 @@ long gui_wps_show(void) | |||
441 | case WPS_RC_NEXT_DIR: | 449 | case WPS_RC_NEXT_DIR: |
442 | #endif | 450 | #endif |
443 | case WPS_NEXT_DIR: | 451 | case WPS_NEXT_DIR: |
452 | if (global_settings.party_mode) | ||
453 | break; | ||
444 | #if defined(AB_REPEAT_ENABLE) && defined(WPS_AB_SHARE_DIR_BUTTONS) | 454 | #if defined(AB_REPEAT_ENABLE) && defined(WPS_AB_SHARE_DIR_BUTTONS) |
445 | if (ab_repeat_mode_enabled()) | 455 | if (ab_repeat_mode_enabled()) |
446 | { | 456 | { |
@@ -460,6 +470,8 @@ long gui_wps_show(void) | |||
460 | case WPS_RC_PREV_DIR: | 470 | case WPS_RC_PREV_DIR: |
461 | #endif | 471 | #endif |
462 | case WPS_PREV_DIR: | 472 | case WPS_PREV_DIR: |
473 | if (global_settings.party_mode) | ||
474 | break; | ||
463 | #if defined(AB_REPEAT_ENABLE) && defined(WPS_AB_SHARE_DIR_BUTTONS) | 475 | #if defined(AB_REPEAT_ENABLE) && defined(WPS_AB_SHARE_DIR_BUTTONS) |
464 | if (ab_repeat_mode_enabled()) | 476 | if (ab_repeat_mode_enabled()) |
465 | ab_set_A_marker(wps_state.id3->elapsed); | 477 | ab_set_A_marker(wps_state.id3->elapsed); |
@@ -479,6 +491,8 @@ long gui_wps_show(void) | |||
479 | #endif | 491 | #endif |
480 | #ifdef WPS_RC_NEXT | 492 | #ifdef WPS_RC_NEXT |
481 | case WPS_RC_NEXT: | 493 | case WPS_RC_NEXT: |
494 | if (global_settings.party_mode) | ||
495 | break; | ||
482 | #ifdef WPS_RC_NEXT_PRE | 496 | #ifdef WPS_RC_NEXT_PRE |
483 | if ((button == WPS_RC_NEXT) && (lastbutton != WPS_RC_NEXT_PRE)) | 497 | if ((button == WPS_RC_NEXT) && (lastbutton != WPS_RC_NEXT_PRE)) |
484 | break; | 498 | break; |
@@ -681,6 +695,8 @@ long gui_wps_show(void) | |||
681 | if (lastbutton != WPS_EXIT_PRE) | 695 | if (lastbutton != WPS_EXIT_PRE) |
682 | break; | 696 | break; |
683 | # endif | 697 | # endif |
698 | if (global_settings.party_mode) | ||
699 | break; | ||
684 | exit = true; | 700 | exit = true; |
685 | #ifdef WPS_RC_EXIT | 701 | #ifdef WPS_RC_EXIT |
686 | case WPS_RC_EXIT: | 702 | case WPS_RC_EXIT: |
@@ -688,6 +704,8 @@ long gui_wps_show(void) | |||
688 | if (lastbutton != WPS_RC_EXIT_PRE) | 704 | if (lastbutton != WPS_RC_EXIT_PRE) |
689 | break; | 705 | break; |
690 | #endif | 706 | #endif |
707 | if (global_settings.party_mode) | ||
708 | break; | ||
691 | exit = true; | 709 | exit = true; |
692 | #endif | 710 | #endif |
693 | break; | 711 | break; |
diff --git a/apps/lang/english.lang b/apps/lang/english.lang index bc355f00e3..8f5d4b7fae 100644 --- a/apps/lang/english.lang +++ b/apps/lang/english.lang | |||
@@ -3796,3 +3796,9 @@ desc: splash number of tracks inserted | |||
3796 | eng: "Searching... %d found (%s)" | 3796 | eng: "Searching... %d found (%s)" |
3797 | voice: "" | 3797 | voice: "" |
3798 | new: | 3798 | new: |
3799 | |||
3800 | id: LANG_PARTY_MODE | ||
3801 | desc: party mode | ||
3802 | eng: "Party Mode" | ||
3803 | voice: "Party Mode" | ||
3804 | new: | ||
diff --git a/apps/settings.h b/apps/settings.h index 546c5465b3..3d129ba6e6 100644 --- a/apps/settings.h +++ b/apps/settings.h | |||
@@ -471,6 +471,7 @@ struct user_settings | |||
471 | int bg_color; /* background color native format */ | 471 | int bg_color; /* background color native format */ |
472 | int fg_color; /* foreground color native format */ | 472 | int fg_color; /* foreground color native format */ |
473 | #endif | 473 | #endif |
474 | bool party_mode; /* party mode - unstoppable music */ | ||
474 | }; | 475 | }; |
475 | 476 | ||
476 | enum optiontype { INT, BOOL }; | 477 | enum optiontype { INT, BOOL }; |
diff --git a/apps/settings_menu.c b/apps/settings_menu.c index 7f2960253f..517c7f1f6b 100644 --- a/apps/settings_menu.c +++ b/apps/settings_menu.c | |||
@@ -1041,6 +1041,11 @@ static bool set_fade_on_stop(void) | |||
1041 | return set_bool( str(LANG_FADE_ON_STOP), &global_settings.fade_on_stop ); | 1041 | return set_bool( str(LANG_FADE_ON_STOP), &global_settings.fade_on_stop ); |
1042 | } | 1042 | } |
1043 | 1043 | ||
1044 | static bool set_party_mode(void) | ||
1045 | { | ||
1046 | return set_bool( str(LANG_PARTY_MODE), &global_settings.party_mode ); | ||
1047 | } | ||
1048 | |||
1044 | 1049 | ||
1045 | static bool ff_rewind_accel(void) | 1050 | static bool ff_rewind_accel(void) |
1046 | { | 1051 | { |
@@ -1461,6 +1466,7 @@ static bool playback_settings_menu(void) | |||
1461 | { ID2P(LANG_WIND_MENU), ff_rewind_settings_menu }, | 1466 | { ID2P(LANG_WIND_MENU), ff_rewind_settings_menu }, |
1462 | { ID2P(LANG_MP3BUFFER_MARGIN), buffer_margin }, | 1467 | { ID2P(LANG_MP3BUFFER_MARGIN), buffer_margin }, |
1463 | { ID2P(LANG_FADE_ON_STOP), set_fade_on_stop }, | 1468 | { ID2P(LANG_FADE_ON_STOP), set_fade_on_stop }, |
1469 | { ID2P(LANG_PARTY_MODE), set_party_mode }, | ||
1464 | #if CONFIG_CODEC == SWCODEC | 1470 | #if CONFIG_CODEC == SWCODEC |
1465 | { ID2P(LANG_CROSSFADE), crossfade_settings_menu }, | 1471 | { ID2P(LANG_CROSSFADE), crossfade_settings_menu }, |
1466 | { ID2P(LANG_REPLAYGAIN), replaygain_settings_menu }, | 1472 | { ID2P(LANG_REPLAYGAIN), replaygain_settings_menu }, |
diff --git a/apps/tree.c b/apps/tree.c index 7aa0f3208b..b11d28f1f8 100644 --- a/apps/tree.c +++ b/apps/tree.c | |||
@@ -637,8 +637,10 @@ static bool dirbrowse(void) | |||
637 | if (*tc.dirfilter < NUM_FILTER_MODES) | 637 | if (*tc.dirfilter < NUM_FILTER_MODES) |
638 | { | 638 | { |
639 | /* Stop the music if it is playing */ | 639 | /* Stop the music if it is playing */ |
640 | if(audio_status()) | 640 | if(audio_status()) { |
641 | audio_stop(); | 641 | if (!global_settings.party_mode) |
642 | audio_stop(); | ||
643 | } | ||
642 | #if defined(HAVE_CHARGING) && \ | 644 | #if defined(HAVE_CHARGING) && \ |
643 | (CONFIG_KEYPAD == RECORDER_PAD) && !defined(HAVE_SW_POWEROFF) | 645 | (CONFIG_KEYPAD == RECORDER_PAD) && !defined(HAVE_SW_POWEROFF) |
644 | else { | 646 | else { |