summaryrefslogtreecommitdiff
path: root/apps/plugins/mpegplayer/mpeg_settings.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/mpegplayer/mpeg_settings.c')
-rw-r--r--apps/plugins/mpegplayer/mpeg_settings.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/apps/plugins/mpegplayer/mpeg_settings.c b/apps/plugins/mpegplayer/mpeg_settings.c
index 9e6fa57fb5..0a717aeaac 100644
--- a/apps/plugins/mpegplayer/mpeg_settings.c
+++ b/apps/plugins/mpegplayer/mpeg_settings.c
@@ -101,6 +101,8 @@ static struct configdata config[] =
101 {TYPE_INT, 0, 2, &settings.skipframes, "Skip frames", NULL, NULL}, 101 {TYPE_INT, 0, 2, &settings.skipframes, "Skip frames", NULL, NULL},
102 {TYPE_INT, 0, INT_MAX, &settings.resume_count, "Resume count", 102 {TYPE_INT, 0, INT_MAX, &settings.resume_count, "Resume count",
103 NULL, NULL}, 103 NULL, NULL},
104 {TYPE_INT, 0, 2, &settings.enable_start_menu, "Enable start menu",
105 NULL, NULL},
104#if defined(TOSHIBA_GIGABEAT_F) || defined(SANSA_E200) || defined(SANSA_C200) 106#if defined(TOSHIBA_GIGABEAT_F) || defined(SANSA_E200) || defined(SANSA_C200)
105 {TYPE_INT, 0, INT_MAX, &settings.displayoptions, "Display options", 107 {TYPE_INT, 0, INT_MAX, &settings.displayoptions, "Display options",
106 NULL, NULL}, 108 NULL, NULL},
@@ -112,6 +114,11 @@ static const struct opt_items noyes[2] = {
112 { "Yes", -1 }, 114 { "Yes", -1 },
113}; 115};
114 116
117static const struct opt_items enabledisable[2] = {
118 { "Disable", -1 },
119 { "Enable", -1 },
120};
121
115static void display_options(void) 122static void display_options(void)
116{ 123{
117 int result; 124 int result;
@@ -329,6 +336,32 @@ enum mpeg_start_id mpeg_start_menu(int play_time, int in_file)
329 char resume_str[32]; 336 char resume_str[32];
330 int time_hol = (int)(settings.resume_time/2); 337 int time_hol = (int)(settings.resume_time/2);
331 int time_rem = ((settings.resume_time%2)==0) ? 0 : 5; 338 int time_rem = ((settings.resume_time%2)==0) ? 0 : 5;
339
340 if (settings.enable_start_menu == 0)
341 {
342 rb->snprintf(resume_str, sizeof(resume_str),
343 "Yes (min): %d.%d", time_hol, time_rem);
344
345 struct opt_items resume_no_yes[2] =
346 {
347 { "No", -1 },
348 { resume_str, -1 },
349 };
350 if (settings.resume_time == 0)
351 return MPEG_START_RESTART;
352
353 rb->set_option("Resume", &result, INT,
354 resume_no_yes, 2, NULL);
355
356 if (result == 0)
357 {
358 settings.resume_time = 0;
359 return MPEG_START_RESTART;
360 }
361 else
362 return MPEG_START_RESUME;
363 }
364
332 rb->snprintf(resume_str, sizeof(resume_str), 365 rb->snprintf(resume_str, sizeof(resume_str),
333 "Resume time (min): %d.%d", time_hol, time_rem); 366 "Resume time (min): %d.%d", time_hol, time_rem);
334 367
@@ -414,6 +447,8 @@ enum mpeg_menu_id mpeg_menu(void)
414 struct menu_item items[] = { 447 struct menu_item items[] = {
415 [MPEG_MENU_DISPLAY_SETTINGS] = 448 [MPEG_MENU_DISPLAY_SETTINGS] =
416 { "Display Options", NULL }, 449 { "Display Options", NULL },
450 [MPEG_MENU_ENABLE_START_MENU] =
451 { "Start menu", NULL },
417 [MPEG_MENU_CLEAR_RESUMES] = 452 [MPEG_MENU_CLEAR_RESUMES] =
418 { clear_str, NULL }, 453 { clear_str, NULL },
419 [MPEG_MENU_QUIT] = 454 [MPEG_MENU_QUIT] =
@@ -434,6 +469,11 @@ enum mpeg_menu_id mpeg_menu(void)
434 case MPEG_MENU_DISPLAY_SETTINGS: 469 case MPEG_MENU_DISPLAY_SETTINGS:
435 display_options(); 470 display_options();
436 break; 471 break;
472 case MPEG_MENU_ENABLE_START_MENU:
473 rb->set_option("Start menu",
474 &settings.enable_start_menu,
475 INT, enabledisable, 2, NULL);
476 break;
437 case MPEG_MENU_CLEAR_RESUMES: 477 case MPEG_MENU_CLEAR_RESUMES:
438 clear_resume_count(); 478 clear_resume_count();
439 rb->snprintf(clear_str, sizeof(clear_str), 479 rb->snprintf(clear_str, sizeof(clear_str),
@@ -462,6 +502,7 @@ void init_settings(const char* filename)
462 settings.showfps = 0; /* Do not show FPS */ 502 settings.showfps = 0; /* Do not show FPS */
463 settings.limitfps = 1; /* Limit FPS */ 503 settings.limitfps = 1; /* Limit FPS */
464 settings.skipframes = 1; /* Skip frames */ 504 settings.skipframes = 1; /* Skip frames */
505 settings.enable_start_menu = 1; /* Enable start menu */
465 settings.resume_count = -1; 506 settings.resume_count = -1;
466#if defined(TOSHIBA_GIGABEAT_F) || defined(SANSA_E200) || defined(SANSA_C200) 507#if defined(TOSHIBA_GIGABEAT_F) || defined(SANSA_E200) || defined(SANSA_C200)
467 settings.displayoptions = 0; /* No visual effects */ 508 settings.displayoptions = 0; /* No visual effects */
@@ -513,6 +554,8 @@ void save_settings(void)
513 settings.limitfps); 554 settings.limitfps);
514 configfile_update_entry(SETTINGS_FILENAME, "Skip frames", 555 configfile_update_entry(SETTINGS_FILENAME, "Skip frames",
515 settings.skipframes); 556 settings.skipframes);
557 configfile_update_entry(SETTINGS_FILENAME, "Enable start menu",
558 settings.enable_start_menu);
516 559
517 /* If this was a new resume entry then update the total resume count */ 560 /* If this was a new resume entry then update the total resume count */
518 if (configfile_update_entry(SETTINGS_FILENAME, settings.resume_filename, 561 if (configfile_update_entry(SETTINGS_FILENAME, settings.resume_filename,