First step of the recording screen redesign. The screen is split into a fixed top part containing essential data and the peakmeters/triggerbar, and a bottom part that is in fact a list. The list contains the items that can be changed, and also some stuff that isn't important enough to be on the top part, like the filename. That filename is now shown completely. If the font is too big to have 6 lines on the display, sysfont is used.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18202 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Peter D'Hoye 2008-08-06 20:12:44 +00:00
parent 729d259388
commit 496e1f7e85
6 changed files with 784 additions and 769 deletions

View file

@ -6470,15 +6470,15 @@
</phrase>
<phrase>
id: LANG_RECORDING_LEFT
desc: in the recording screen
desc: deprecated
user:
<source>
*: none
recording: "Gain Left"
recording: ""
</source>
<dest>
*: none
recording: "Gain Left"
recording: ""
</dest>
<voice>
*: none
@ -6487,15 +6487,15 @@
</phrase>
<phrase>
id: LANG_RECORDING_RIGHT
desc: in the recording screen
desc: deprecated
user:
<source>
*: none
recording: "Gain Right"
recording: ""
</source>
<dest>
*: none
recording: "Gain Right"
recording: ""
</dest>
<voice>
*: none
@ -6504,18 +6504,18 @@
</phrase>
<phrase>
id: LANG_RECORD_AGC_PRESET
desc: automatic gain control in record settings
desc: deprecated
<source>
*: none
agc: "Automatic Gain Control"
recording: ""
</source>
<dest>
*: none
agc: "Automatic Gain Control"
recording: ""
</dest>
<voice>
*: none
agc: "Automatic gain control"
recording: ""
</voice>
</phrase>
<phrase>
@ -6600,18 +6600,18 @@
</phrase>
<phrase>
id: LANG_RECORD_AGC_CLIPTIME
desc: in record settings
desc: deprecated
<source>
*: none
agc: "AGC clip time"
agc: ""
</source>
<dest>
*: none
agc: "AGC clip time"
agc: ""
</dest>
<voice>
*: none
agc: "AGC clip time"
agc: ""
</voice>
</phrase>
<phrase>
@ -10156,19 +10156,19 @@
</phrase>
<phrase>
id: LANG_SYSFONT_OFF
desc: Used in a lot of places
desc: deprecated
user:
<source>
*: none
lcd_bitmap: "Off"
lcd_bitmap: ""
</source>
<dest>
*: none
lcd_bitmap: "Off"
lcd_bitmap: ""
</dest>
<voice>
*: none
lcd_bitmap: "Off"
lcd_bitmap: ""
</voice>
</phrase>
<phrase>
@ -10496,19 +10496,15 @@
</phrase>
<phrase>
id: LANG_SYSFONT_DISK_FULL
desc: in recording screen
desc: deprecated
user:
<source>
*: none
recording: "The disk is full. Press OFF to continue."
h100,h120,h300: "The disk is full. Press STOP to continue."
m5,x5,ipod4g,ipodcolor,ipodnano,ipodvideo,e200,c200: "The disk is full. Press LEFT to continue."
recording: ""
</source>
<dest>
*: none
recording: "The disk is full. Press OFF to continue."
h100,h120,h300: "The disk is full. Press STOP to continue."
m5,x5,ipod4g,ipodcolor,ipodnano,ipodvideo,e200,c200: "The disk is full. Press LEFT to continue."
recording: ""
</dest>
<voice>
*: none
@ -10517,19 +10513,19 @@
</phrase>
<phrase>
id: LANG_SYSFONT_VOLUME
desc: in sound_settings
desc: deprecated
user:
<source>
*: none
recording: "Volume"
recording: ""
</source>
<dest>
*: none
recording: "Volume"
recording: ""
</dest>
<voice>
*: none
recording: "Volume"
recording: ""
</voice>
</phrase>
<phrase>
@ -10704,15 +10700,15 @@
</phrase>
<phrase>
id: LANG_SYSFONT_RECORDING_TIME
desc: Display of recorded time
desc: deprecated
user:
<source>
*: none
recording: "Time:"
recording: ""
</source>
<dest>
*: none
recording: "Time:"
recording: ""
</dest>
<voice>
*: none
@ -10721,15 +10717,15 @@
</phrase>
<phrase>
id: LANG_SYSFONT_RECORD_TIMESPLIT_REC
desc: Display of record timer interval setting, on the record screen
desc: deprecated
user:
<source>
*: none
recording: "Split Time:"
recording: ""
</source>
<dest>
*: none
recording: "Split Time:"
recording: ""
</dest>
<voice>
*: none
@ -10755,15 +10751,15 @@
</phrase>
<phrase>
id: LANG_SYSFONT_RECORD_PRERECORD
desc: in recording and radio screen
desc: deprecated
user:
<source>
*: none
recording: "Pre-Recording"
recording: ""
</source>
<dest>
*: none
recording: "Pre-Recording"
recording: ""
</dest>
<voice>
*: none
@ -10806,31 +10802,32 @@
</phrase>
<phrase>
id: LANG_SYSFONT_SPLIT_SIZE
desc: in record timesplit options
desc: deprecated
user:
<source>
*: none
recording: "Split Filesize"
recording: ""
</source>
<dest>
*: none
recording: "Split Filesize"
recording: ""
</dest>
<voice>
*: none
recording: "Split Filesize"
recording: ""
</voice>
</phrase>
<phrase>
id: LANG_SYSFONT_RECORDING_FILENAME
desc: Filename header in recording screen
desc: deprecated
user:
<source>
*: none
recording: "Filename:"
recording: ""
</source>
<dest>
*: none
recording: "Filename:"
recording: ""
</dest>
<voice>
*: none
@ -10839,114 +10836,114 @@
</phrase>
<phrase>
id: LANG_SYSFONT_RECORDING_AGC_PRESET
desc: automatic gain control in recording screen
desc: deprecated
<source>
*: none
agc: "AGC"
agc: ""
</source>
<dest>
*: none
agc: "AGC"
agc: ""
</dest>
<voice>
*: none
agc: "AGC"
agc: ""
</voice>
</phrase>
<phrase>
id: LANG_SYSFONT_AGC_SAFETY
desc: AGC preset
desc: deprecated
<source>
*: none
agc: "Safety (clip)"
agc: ""
</source>
<dest>
*: none
agc: "Safety (clip)"
agc: ""
</dest>
<voice>
*: none
agc: "Safety (clip)"
agc: ""
</voice>
</phrase>
<phrase>
id: LANG_SYSFONT_AGC_LIVE
desc: AGC preset
desc: deprecated
<source>
*: none
agc: "Live (slow)"
agc: ""
</source>
<dest>
*: none
agc: "Live (slow)"
agc: ""
</dest>
<voice>
*: none
agc: "Live (slow)"
agc: ""
</voice>
</phrase>
<phrase>
id: LANG_SYSFONT_AGC_DJSET
desc: AGC preset
desc: deprecated
<source>
*: none
agc: "DJ-Set (slow)"
agc: ""
</source>
<dest>
*: none
agc: "DJ-Set (slow)"
agc: ""
</dest>
<voice>
*: none
agc: "DJ set (slow)"
agc: ""
</voice>
</phrase>
<phrase>
id: LANG_SYSFONT_AGC_MEDIUM
desc: AGC preset
desc: deprecated
<source>
*: none
agc: "Medium"
agc: ""
</source>
<dest>
*: none
agc: "Medium"
agc: ""
</dest>
<voice>
*: none
agc: "Medium"
agc: ""
</voice>
</phrase>
<phrase>
id: LANG_SYSFONT_AGC_VOICE
desc: AGC preset
desc: deprecated
<source>
*: none
agc: "Voice (fast)"
agc: ""
</source>
<dest>
*: none
agc: "Voice (fast)"
agc: ""
</dest>
<voice>
*: none
agc: "Voice (fast)"
agc: ""
</voice>
</phrase>
<phrase>
id: LANG_SYSFONT_RECORDING_AGC_MAXGAIN
desc: AGC maximum gain in recording screen
desc: deprecated
<source>
*: none
agc: "AGC max. gain"
agc: ""
</source>
<dest>
*: none
agc: "AGC max. gain"
agc: ""
</dest>
<voice>
*: none
agc: "AGC maximum gain"
agc: ""
</voice>
</phrase>
<phrase>
@ -11162,15 +11159,15 @@
</phrase>
<phrase>
id: LANG_SYSFONT_PM_CLIPCOUNT
desc: in recording GUI, for recording peak meter. MAX 5 characters!
desc: deprecated
user:
<source>
*: none
recording: "CLIP:"
recording: ""
</source>
<dest>
*: none
recording: "CLIP:"
recording: ""
</dest>
<voice>
*: none
@ -11857,3 +11854,153 @@
*: "slash"
</voice>
</phrase>
<phrase>
id: LANG_GAIN_LEFT
desc: in the recording screen
user:
<source>
*: none
recording: "Gain L"
</source>
<dest>
*: none
recording: "Gain L"
</dest>
<voice>
*: none
recording: "Gain Left"
</voice>
</phrase>
<phrase>
id: LANG_GAIN_RIGHT
desc: in the recording screen
user:
<source>
*: none
recording: "Gain R"
</source>
<dest>
*: none
recording: "Gain R"
</dest>
<voice>
*: none
recording: "Gain Right"
</voice>
</phrase>
<phrase>
id: LANG_RECORDING_AGC_PRESET
desc: automatic gain control in record settings and screen
<source>
*: none
agc: "AGC"
</source>
<dest>
*: none
agc: "AGC"
</dest>
<voice>
*: none
agc: "Automatic gain control"
</voice>
</phrase>
<phrase>
id: LANG_RECORDING_AGC_CLIPTIME
desc: in record settings
<source>
*: none
agc: "AGC clip time"
</source>
<dest>
*: none
agc: "AGC clip time"
</dest>
<voice>
*: none
agc: "AGC clip time"
</voice>
</phrase>
<phrase>
id: LANG_RECORDING_AGC_MAXGAIN
desc: AGC maximum gain in recording screen
<source>
*: none
agc: "AGC max. gain"
</source>
<dest>
*: none
agc: "AGC max. gain"
</dest>
<voice>
*: none
agc: "AGC maximum gain"
</voice>
</phrase>
<phrase>
id: LANG_RECORDING_FILENAME
desc: Filename header in recording screen
user:
<source>
*: none
recording: "Filename:"
</source>
<dest>
*: none
recording: "Filename:"
</dest>
<voice>
*: none
recording: ""
</voice>
</phrase>
<phrase>
id: LANG_PM_CLIPCOUNT
desc: in recording GUI, for recording peak meter. MAX 5 characters!
user:
<source>
*: none
recording: "CLIP:"
</source>
<dest>
*: none
recording: "CLIP:"
</dest>
<voice>
*: none
recording: ""
</voice>
</phrase>
<phrase>
id: LANG_RECORDING_TIMESPLIT_REC
desc: Display of record timer interval setting, on the record screen
user:
<source>
*: none
recording: "Split Time:"
</source>
<dest>
*: none
recording: "Split Time:"
</dest>
<voice>
*: none
recording: ""
</voice>
</phrase>
<phrase>
id: LANG_RECORDING_SIZE
desc: Display of recorded file size
user:
<source>
*: none
recording: "Size:"
</source>
<dest>
*: none
recording: "Size:"
</dest>
<voice>
*: none
recording: ""
</voice>
</phrase>

View file

@ -344,11 +344,11 @@ static int agc_preset_func(void)
{ STR(LANG_AGC_VOICE) },
};
if (global_settings.rec_source)
return set_option(str(LANG_RECORD_AGC_PRESET),
return set_option(str(LANG_RECORDING_AGC_PRESET),
&global_settings.rec_agc_preset_line,
INT, names, 6, NULL );
else
return set_option(str(LANG_RECORD_AGC_PRESET),
return set_option(str(LANG_RECORDING_AGC_PRESET),
&global_settings.rec_agc_preset_mic,
INT, names, 6, NULL );
}
@ -362,13 +362,13 @@ static int agc_cliptime_func(void)
{ "800ms", TALK_ID(800, UNIT_MS) },
{ "1s", TALK_ID(1, UNIT_SEC) }
};
return set_option(str(LANG_RECORD_AGC_CLIPTIME),
return set_option(str(LANG_RECORDING_AGC_CLIPTIME),
&global_settings.rec_agc_cliptime,
INT, names, 5, NULL );
}
MENUITEM_FUNCTION(agc_preset, 0, ID2P(LANG_RECORD_AGC_PRESET),
MENUITEM_FUNCTION(agc_preset, 0, ID2P(LANG_RECORDING_AGC_PRESET),
agc_preset_func, NULL, NULL, Icon_Menu_setting);
MENUITEM_FUNCTION(agc_cliptime, 0, ID2P(LANG_RECORD_AGC_CLIPTIME),
MENUITEM_FUNCTION(agc_cliptime, 0, ID2P(LANG_RECORDING_AGC_CLIPTIME),
agc_cliptime_func, NULL, NULL, Icon_Menu_setting);
#endif /* HAVE_AGC */
@ -441,12 +441,14 @@ int rectrigger(void)
int i, action = ACTION_REDRAW;
bool done = false, changed = true;
const struct settings_list *settings[TRIG_OPTION_COUNT];
int pm_x[NB_SCREENS];
int pm_y[NB_SCREENS];
int pm_h[NB_SCREENS];
int trig_xpos[NB_SCREENS];
int trig_ypos[NB_SCREENS];
int trig_width[NB_SCREENS];
int old_start_thres_db = global_settings.rec_start_thres_db;
int old_start_thres_linear = global_settings.rec_start_thres_linear;
int old_start_duration = global_settings.rec_start_duration;
@ -466,7 +468,9 @@ int rectrigger(void)
vp[i].height -= SYSFONT_HEIGHT*2;
trig_xpos[i] = 0;
trig_ypos[i] = vp[i].y + vp[i].height;
pm_x[i] = 0;
pm_y[i] = screens[i].getheight() - SYSFONT_HEIGHT;
pm_h[i] = SYSFONT_HEIGHT;
trig_width[i] = screens[i].getwidth();
}
/* TODO: what to do if there is < 4 lines on the screen? */
@ -518,8 +522,8 @@ int rectrigger(void)
}
peak_meter_draw_trig(trig_xpos, trig_ypos, trig_width, NB_SCREENS);
action = peak_meter_draw_get_btn(CONTEXT_SETTINGS_RECTRIGGER, 0, pm_y,
SYSFONT_HEIGHT, NB_SCREENS);
action = peak_meter_draw_get_btn(CONTEXT_SETTINGS_RECTRIGGER,
pm_x, pm_y, pm_h, NB_SCREENS);
FOR_NB_SCREENS(i)
screens[i].update();
i = gui_synclist_get_sel_pos(&lists);

View file

@ -47,7 +47,7 @@
#if CONFIG_CODEC == SWCODEC
#include "pcm.h"
#ifdef HAVE_RECORDING
#ifdef HAVE_RECORDING
#include "pcm_record.h"
#endif
@ -265,7 +265,7 @@ int calc_db (int isample)
}
}
}
return n + (m * (long)(isample - istart)) / 100L;
}
@ -319,13 +319,13 @@ int peak_meter_db2sample(int db)
/* range check: db value to big */
if (max_peak_db + db < 0) {
retval = 0;
}
}
/* range check: db value too small */
else if (max_peak_db + db >= max_peak_db) {
retval = MAX_PEAK -1;
}
}
/* value in range: find the matching linear value */
else {
retval = db_to_sample_bin_search(0, MAX_PEAK, max_peak_db + db);
@ -359,7 +359,7 @@ static void peak_meter_set_min(int newmin)
}
pm_range = peak_meter_range_max - peak_meter_range_min;
/* Avoid division by zero. */
if (pm_range == 0) {
pm_range = 1;
@ -586,10 +586,10 @@ void peak_meter_peek(void)
#if CONFIG_CODEC == SWCODEC
if (pm_playback)
pcm_calculate_peaks(&pm_cur_left, &pm_cur_right);
#ifdef HAVE_RECORDING
#ifdef HAVE_RECORDING
else
pcm_calculate_rec_peaks(&pm_cur_left, &pm_cur_right);
#endif
#endif
left = pm_cur_left;
right = pm_cur_right;
#else
@ -812,7 +812,7 @@ static int peak_meter_read_l(void)
/* reset pm_max_left so that subsequent calls of peak_meter_peek don't
get fooled by an old maximum value */
pm_max_left = pm_cur_left;
#if defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)
srand(current_tick);
retval = rand()%MAX_PEAK;
@ -1328,8 +1328,8 @@ void peak_meter_draw_trig(int xpos[], int ypos[],
}
#endif
int peak_meter_draw_get_btn(int action_context, int x, int y[],
int height, int nb_screens)
int peak_meter_draw_get_btn(int action_context, int x[], int y[],
int height[], int nb_screens)
{
int button = BUTTON_NONE;
long next_refresh = current_tick;
@ -1362,10 +1362,10 @@ int peak_meter_draw_get_btn(int action_context, int x, int y[],
if (TIME_AFTER(current_tick, next_refresh)) {
for(i = 0; i < nb_screens; i++)
{
peak_meter_screen(&screens[i], x, y[i], height);
screens[i].update_viewport_rect(x, y[i],
screens[i].getwidth() - x,
height);
peak_meter_screen(&screens[i], x[i], y[i], height[i]);
screens[i].update_viewport_rect(x[i], y[i],
screens[i].getwidth() - x[i],
height[i]);
}
next_refresh += HZ / PEAK_METER_FPS;
dopeek = true;
@ -1430,3 +1430,4 @@ bool peak_meter_histogram(void)
}
#endif

View file

@ -35,8 +35,8 @@ extern void pm_activate_clipcount(bool active);
extern bool peak_meter_enabled;
extern void peak_meter_playback(bool playback);
extern int peak_meter_draw_get_btn(int action_context, int x, int y[],
int height, int nb_screens);
extern int peak_meter_draw_get_btn(int action_context, int x[], int y[],
int height[], int nb_screens);
extern void peak_meter_set_clip_hold(int time);
extern void peak_meter_peek(void);
extern void peak_meter_init_range( bool dbfs, int range_min, int range_max);

File diff suppressed because it is too large Load diff

View file

@ -899,11 +899,11 @@ const struct settings_list settings[] = {
#endif /* DEFAULT_REC_MIC_GAIN */
#ifdef DEFAULT_REC_LEFT_GAIN
{F_T_INT|F_RECSETTING,&global_settings.rec_left_gain,
LANG_RECORDING_LEFT,INT(DEFAULT_REC_LEFT_GAIN),
LANG_GAIN_LEFT,INT(DEFAULT_REC_LEFT_GAIN),
"rec left gain",NULL,UNUSED},
#endif /* DEFAULT_REC_LEFT_GAIN */
#ifdef DEFAULT_REC_RIGHT_GAIN
{F_T_INT|F_RECSETTING,&global_settings.rec_right_gain,LANG_RECORDING_RIGHT,
{F_T_INT|F_RECSETTING,&global_settings.rec_right_gain,LANG_GAIN_RIGHT,
INT(DEFAULT_REC_RIGHT_GAIN),
"rec right gain",NULL,UNUSED},
#endif /* DEFAULT_REC_RIGHT_GAIN */
@ -1180,16 +1180,16 @@ const struct settings_list settings[] = {
#endif
#ifdef HAVE_AGC
{F_T_INT,&global_settings.rec_agc_preset_mic,LANG_RECORD_AGC_PRESET,INT(1),
"agc mic preset",NULL,UNUSED},
{F_T_INT,&global_settings.rec_agc_preset_line,LANG_RECORD_AGC_PRESET,INT(1),
"agc line preset",NULL,UNUSED},
{F_T_INT,&global_settings.rec_agc_preset_mic,LANG_RECORDING_AGC_PRESET,
INT(1),"agc mic preset",NULL,UNUSED},
{F_T_INT,&global_settings.rec_agc_preset_line,LANG_RECORDING_AGC_PRESET,
INT(1),"agc line preset",NULL,UNUSED},
{F_T_INT,&global_settings.rec_agc_maxgain_mic,-1,INT(104),
"agc maximum mic gain",NULL,UNUSED},
{F_T_INT,&global_settings.rec_agc_maxgain_line,-1,INT(96),
"agc maximum line gain",NULL,UNUSED},
{F_T_INT,&global_settings.rec_agc_cliptime,LANG_RECORD_AGC_CLIPTIME,INT(1),
"agc cliptime","0.2s,0.4s,0.6s,0.8,1s",UNUSED},
{F_T_INT,&global_settings.rec_agc_cliptime,LANG_RECORDING_AGC_CLIPTIME,
INT(1),"agc cliptime","0.2s,0.4s,0.6s,0.8,1s",UNUSED},
#endif
#ifdef HAVE_REMOTE_LCD