1
0
Fork 0
forked from len0rd/rockbox

Dave Jones' recording time split feature (patch #697373)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3725 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Björn Stenberg 2003-06-04 13:48:50 +00:00
parent b817f601ba
commit 56f771e76a
6 changed files with 82 additions and 4 deletions

View file

@ -1537,3 +1537,13 @@ id: LANG_JUMP_SCROLL_DELAY
desc: (player) Delay before making a jump scroll
eng: "Jump Scroll Delay"
new:
id: LANG_RECORD_TIMESPLIT
desc: Prompt for record timer interval setting, in the record settings menu
eng: "Time Split"
new:
id: LANG_RECORD_TIMESPLIT_REC
decs: Display of record timer interval setting, on the record screen
eng: "Split time:"
new:

View file

@ -89,6 +89,19 @@ static char *fmtstr[] =
"%d.%02d %s " /* 2 decimals */
};
/* This array holds the record timer interval lengths, in seconds */
static unsigned long rec_timer_seconds[] =
{
0, /* off */
300, /* 00:05 */
600, /* 00:10 */
900, /* 00:15 */
1800, /* 00:30 */
3600, /* 01:00 */
7200, /* 02:00 */
14400, /* 04:00 */
};
char *fmt_gain(int snd, int val, char *str, int len)
{
int tmp, i, d, numdec;
@ -349,7 +362,7 @@ bool recording_screen(void)
timeout = current_tick + HZ/10;
seconds = mpeg_recorded_time() / HZ;
update_countdown--;
if(update_countdown == 0 || seconds > last_seconds)
{
@ -367,8 +380,34 @@ bool recording_screen(void)
hours, minutes, seconds%60);
lcd_puts(0, 0, buf);
snprintf(buf, 32, "%s %s", str(LANG_RECORDING_SIZE),
num2max5(mpeg_num_recorded_bytes(), buf2));
/* if the record timesplit is active */
if (global_settings.rec_timesplit)
{
unsigned long dseconds, dhours, dminutes;
int rti = global_settings.rec_timesplit;
dseconds = rec_timer_seconds[rti];
if (mpeg_status() && (seconds >= dseconds))
{
/* stop and restart recording */
mpeg_stop();
have_recorded = true;
mpeg_record(create_filename());
update_countdown = 1;
last_seconds = 0;
}
/* Display the record timesplit interval rather than
the file size if the record timer is active */
dhours = dseconds / 3600;
dminutes = (dseconds - (dhours * 3600)) / 60;
snprintf(buf, 32, "%s %02d:%02d",
str(LANG_RECORD_TIMESPLIT_REC),
dhours, dminutes);
}
else
snprintf(buf, 32, "%s %s", str(LANG_RECORDING_SIZE),
num2max5(mpeg_num_recorded_bytes(), buf2));
lcd_puts(0, 1, buf);
peak_meter_draw(0, 8 + h*2, LCD_WIDTH, h);

View file

@ -1032,9 +1032,15 @@ bool settings_load_config(char* file)
set_sound(value, SOUND_RIGHT_GAIN, &global_settings.rec_right_gain);
else if (!strcasecmp(name, "rec quality"))
set_cfg_int(&global_settings.rec_quality, value, 0, 7);
else if (!strcasecmp(name, "rec timesplit")){
static char* options[] = {"off", "00:05","00:10","00:15",
"00:30","01:00","02:00","04:00"};
set_cfg_option(&global_settings.rec_timesplit, value,
options, 8);
}
else if (!strcasecmp(name, "rec source")) {
static char* options[] = {"mic", "line", "spdif"};
set_cfg_option(&global_settings.rec_source, value, options, 3);
set_cfg_option(&global_settings.rec_source, value, options, 3);
}
else if (!strcasecmp(name, "rec frequency")) {
static char* options[] = {"44", "48", "32", "22", "24", "16"};

View file

@ -75,6 +75,16 @@ struct user_settings
int rec_left_gain; /* 0-15 */
int rec_right_gain; /* 0-15 */
bool rec_editable; /* true means that the bit reservoir is off */
/* note: timesplit setting is not saved */
int rec_timesplit; /* 0 = off
1 = 00:05
2 = 00:10
3 = 00:15
4 = 00:30
5 = 01:00
6 = 02:00
7 = 04:00 */
/* device settings */

View file

@ -225,6 +225,17 @@ static bool receditable(void)
return set_bool(str(LANG_RECORDING_EDITABLE),
&global_settings.rec_editable);
}
static bool rectimesplit(void)
{
char *names[] = {str(LANG_OFF), "00:05","00:10","00:15",
"00:30","01:00","02:00","04:00"};
return set_option(str(LANG_RECORD_TIMESPLIT),
&global_settings.rec_timesplit,
names, 8, NULL );
}
#endif /* HAVE_MAS3587F */
static void set_chanconf(int val)
@ -282,6 +293,7 @@ bool recording_menu(void)
{ str(LANG_RECORDING_SOURCE), recsource },
{ str(LANG_RECORDING_CHANNELS), recchannels },
{ str(LANG_RECORDING_EDITABLE), receditable },
{ str(LANG_RECORD_TIMESPLIT), rectimesplit },
};
m=menu_init( items, sizeof items / sizeof(struct menu_items) );

View file

@ -67,3 +67,4 @@ Craig Sather
José Maria Garcia-Valdecasas Bernal
Stevie Oh
Jörg Hohensohn
Dave Jones