mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-09 21:22:39 -05:00
Improved statusbar icons in recording screen by Davide Gentile
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10935 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
44e8233134
commit
d7fa569df6
3 changed files with 93 additions and 44 deletions
|
|
@ -77,7 +77,7 @@
|
||||||
STATUSBAR_PLUG_WIDTH + \
|
STATUSBAR_PLUG_WIDTH + \
|
||||||
STATUSBAR_VOLUME_WIDTH + \
|
STATUSBAR_VOLUME_WIDTH + \
|
||||||
STATUSBAR_PLAY_STATE_WIDTH + \
|
STATUSBAR_PLAY_STATE_WIDTH + \
|
||||||
3*ICONS_SPACING
|
4*ICONS_SPACING - 1
|
||||||
#define STATUSBAR_RECFREQ_WIDTH 12
|
#define STATUSBAR_RECFREQ_WIDTH 12
|
||||||
#define STATUSBAR_RECCHANNELS_X_POS STATUSBAR_X_POS + \
|
#define STATUSBAR_RECCHANNELS_X_POS STATUSBAR_X_POS + \
|
||||||
STATUSBAR_BATTERY_WIDTH + \
|
STATUSBAR_BATTERY_WIDTH + \
|
||||||
|
|
@ -602,8 +602,11 @@ void gui_statusbar_time(struct screen * display, int hour, int minute)
|
||||||
#ifdef HAVE_RECORDING
|
#ifdef HAVE_RECORDING
|
||||||
void gui_statusbar_icon_recording_info(struct screen * display)
|
void gui_statusbar_icon_recording_info(struct screen * display)
|
||||||
{
|
{
|
||||||
int width, height;
|
#if (CONFIG_CODEC != SWCODEC) || defined(SIMULATOR)
|
||||||
char buffer[4];
|
char buffer[4];
|
||||||
|
#endif
|
||||||
|
#if CONFIG_CODEC != SWCODEC
|
||||||
|
int width, height;
|
||||||
char* const sample_rate[12] =
|
char* const sample_rate[12] =
|
||||||
{
|
{
|
||||||
"8",
|
"8",
|
||||||
|
|
@ -619,22 +622,21 @@ void gui_statusbar_icon_recording_info(struct screen * display)
|
||||||
"88",
|
"88",
|
||||||
"96"
|
"96"
|
||||||
};
|
};
|
||||||
#if CONFIG_CODEC != SWCODEC
|
|
||||||
char* const bit_rate[9] =
|
char* const bit_rate[9] =
|
||||||
{
|
{
|
||||||
"MQ0",
|
"Mq0",
|
||||||
"MQ1",
|
"Mq1",
|
||||||
"MQ2",
|
"Mq2",
|
||||||
"MQ3",
|
"Mq3",
|
||||||
"MQ4",
|
"Mq4",
|
||||||
"MQ5",
|
"Mq5",
|
||||||
"MQ6",
|
"Mq6",
|
||||||
"MQ7",
|
"Mq7",
|
||||||
"WAV"
|
"WAV"
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
display->setfont(FONT_SYSFIXED);
|
display->setfont(FONT_SYSFIXED);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Display Codec info in statusbar */
|
/* Display Codec info in statusbar */
|
||||||
#if CONFIG_CODEC == SWCODEC
|
#if CONFIG_CODEC == SWCODEC
|
||||||
|
|
@ -644,7 +646,8 @@ void gui_statusbar_icon_recording_info(struct screen * display)
|
||||||
STATUSBAR_ENCODER_X_POS, STATUSBAR_Y_POS,
|
STATUSBAR_ENCODER_X_POS, STATUSBAR_Y_POS,
|
||||||
STATUSBAR_ENCODER_WIDTH, STATUSBAR_HEIGHT);
|
STATUSBAR_ENCODER_WIDTH, STATUSBAR_HEIGHT);
|
||||||
#else
|
#else
|
||||||
snprintf(buffer, sizeof(buffer), "%s", bit_rate[global_settings.rec_quality]);
|
snprintf(buffer, sizeof(buffer), "%s",
|
||||||
|
bit_rate[global_settings.rec_quality]);
|
||||||
display->getstringsize(buffer, &width, &height);
|
display->getstringsize(buffer, &width, &height);
|
||||||
if (height <= STATUSBAR_HEIGHT)
|
if (height <= STATUSBAR_HEIGHT)
|
||||||
{
|
{
|
||||||
|
|
@ -657,9 +660,12 @@ void gui_statusbar_icon_recording_info(struct screen * display)
|
||||||
if (global_settings.rec_source == SOURCE_SPDIF)
|
if (global_settings.rec_source == SOURCE_SPDIF)
|
||||||
{
|
{
|
||||||
#if (CONFIG_CODEC != MAS3587F) && !defined(SIMULATOR)
|
#if (CONFIG_CODEC != MAS3587F) && !defined(SIMULATOR)
|
||||||
snprintf(buffer, sizeof(buffer), "%s", sample_rate[audio_get_spdif_sample_rate()]);
|
display->mono_bitmap(bitmap_icons_12x8[audio_get_spdif_sample_rate()],
|
||||||
|
STATUSBAR_RECFREQ_X_POS, STATUSBAR_Y_POS,
|
||||||
|
STATUSBAR_RECFREQ_WIDTH, STATUSBAR_HEIGHT);
|
||||||
#else
|
#else
|
||||||
/* Can't measure S/PDIF sample rate on Archos/Sim yet so just display input type */
|
/* Can't measure S/PDIF sample rate on Archos/Sim yet so
|
||||||
|
just display input type */
|
||||||
snprintf(buffer, sizeof(buffer), "Dg");
|
snprintf(buffer, sizeof(buffer), "Dg");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
@ -681,17 +687,22 @@ void gui_statusbar_icon_recording_info(struct screen * display)
|
||||||
else if (freq == 5)
|
else if (freq == 5)
|
||||||
freq = FREQ_16;
|
freq = FREQ_16;
|
||||||
|
|
||||||
|
#if CONFIG_CODEC == SWCODEC
|
||||||
|
/* samplerate icons for swcodec targets*/
|
||||||
|
display->mono_bitmap(bitmap_icons_12x8[freq],
|
||||||
|
STATUSBAR_RECFREQ_X_POS, STATUSBAR_Y_POS,
|
||||||
|
STATUSBAR_RECFREQ_WIDTH, STATUSBAR_HEIGHT);
|
||||||
|
#else
|
||||||
|
/* hwcodec targets have sysfont characters */
|
||||||
snprintf(buffer, sizeof(buffer), "%s", sample_rate[freq]);
|
snprintf(buffer, sizeof(buffer), "%s", sample_rate[freq]);
|
||||||
|
display->getstringsize(buffer, &width, &height);
|
||||||
|
|
||||||
|
if (height <= STATUSBAR_HEIGHT)
|
||||||
|
display->putsxy(STATUSBAR_RECFREQ_X_POS, STATUSBAR_Y_POS, buffer);
|
||||||
|
|
||||||
|
display->setfont(FONT_UI);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
display->getstringsize(buffer, &width, &height);
|
|
||||||
if (height <= STATUSBAR_HEIGHT)
|
|
||||||
{
|
|
||||||
display->putsxy(STATUSBAR_RECFREQ_X_POS, STATUSBAR_Y_POS, buffer);
|
|
||||||
}
|
|
||||||
|
|
||||||
display->setfont(FONT_UI);
|
|
||||||
|
|
||||||
/* Display Channel status in status bar */
|
/* Display Channel status in status bar */
|
||||||
if(global_settings.rec_channels)
|
if(global_settings.rec_channels)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -79,27 +79,44 @@ const unsigned char bitmap_icons_7x8[][7] =
|
||||||
|
|
||||||
const unsigned char bitmap_icons_18x8[][18] =
|
const unsigned char bitmap_icons_18x8[][18] =
|
||||||
{
|
{
|
||||||
{0x00, 0x00, 0x00, 0x00, 0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x00, 0x1c, 0x2a,
|
{0x00, 0x00, 0x00, 0x00,0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x3e, 0x2a,
|
||||||
0x12, 0x00, 0x1e, 0x30, 0x10}, /* mp3 64kbps */
|
0x3a, 0x00, 0x0e, 0x08, 0x3e, 0x00}, /* mp3 64kbps */
|
||||||
{0x00, 0x00, 0x00, 0x00, 0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x00, 0x04, 0x0a,
|
{0x00, 0x00, 0x00, 0x00,0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x0e, 0x0a,
|
||||||
0x3e, 0x00, 0x1c, 0x2a, 0x12}, /* mp3 96kbps */
|
0x3e, 0x00, 0x3e, 0x2a, 0x3a, 0x00}, /* mp3 96kbps */
|
||||||
{0x00, 0x00, 0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x00, 0x3e, 0x00, 0x32, 0x2a,
|
{0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x24, 0x3e, 0x20, 0x00, 0x3a, 0x2a,
|
||||||
0x24, 0x00, 0x14, 0x2a, 0x14}, /* mp3 128kbps */
|
0x2e, 0x00, 0x3e, 0x2a, 0x3e, 0x00}, /* mp3 128kbps */
|
||||||
{0x00, 0x00, 0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x00, 0x3e, 0x00, 0x1c, 0x2a,
|
{0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x24, 0x3e, 0x20, 0x00, 0x3e, 0x2a,
|
||||||
0x12, 0x00, 0x1c, 0x22, 0x1c}, /* mp3 160kbps */
|
0x3a, 0x00, 0x3e, 0x22, 0x3e, 0x00}, /* mp3 160kbps */
|
||||||
{0x00, 0x00, 0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x00, 0x3e, 0x00, 0x04, 0x0a,
|
{0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x24, 0x3e, 0x20, 0x00, 0x0e, 0x0a,
|
||||||
0x3e, 0x00, 0x32, 0x2a, 0x24}, /* mp3 192kbps */
|
0x3e, 0x00, 0x3a, 0x2a, 0x2e, 0x00}, /* mp3 192kbps */
|
||||||
{0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x00, 0x32, 0x2a, 0x24, 0x00, 0x32, 0x2a,
|
{0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x3a, 0x2a, 0x2e, 0x00, 0x3a, 0x2a,
|
||||||
0x24, 0x00, 0x1e, 0x30, 0x10}, /* mp3 224kbps */
|
0x2e, 0x00, 0x0e, 0x08, 0x3e, 0x00}, /* mp3 224kbps */
|
||||||
{0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x00, 0x22, 0x2a, 0x14, 0x00, 0x32, 0x2a,
|
{0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x22, 0x2a, 0x36, 0x00, 0x3a, 0x2a,
|
||||||
0x24, 0x00, 0x1c, 0x22, 0x1c}, /* mp3 320kbps */
|
0x2e, 0x00, 0x3e, 0x22, 0x3e, 0x00}, /* mp3 320kbps */
|
||||||
{0x00, 0x00, 0x00, 0x00, 0x1e, 0x20, 0x18, 0x20, 0x1e, 0x00, 0x1e, 0x20, 0x18,
|
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x1e, 0x20, 0x18, 0x20, 0x1e,
|
||||||
0x06, 0x00, 0x00, 0x00, 0x00}, /* wv */
|
0x00, 0x1e, 0x20, 0x18, 0x06, 0x00}, /* wv */
|
||||||
{0x00, 0x1e, 0x20, 0x18, 0x20, 0x1e, 0x00, 0x3c, 0x12, 0x12, 0x3c, 0x00, 0x1e,
|
{0x00, 0x00, 0x1e, 0x20, 0x18, 0x20, 0x1e, 0x00, 0x3c, 0x12, 0x12, 0x3c,
|
||||||
0x20, 0x18, 0x06, 0x00, 0x00} /* wav */
|
0x00, 0x1e, 0x20, 0x18, 0x06, 0x00} /* wav */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if CONFIG_CODEC == SWCODEC
|
||||||
|
const unsigned char bitmap_icons_12x8[][12] =
|
||||||
|
{
|
||||||
|
{0x00, 0x00, 0x00, 0x00, 0x3e, 0x2a, 0x3e, 0x00, 0x3e, 0x10, 0x28, 0x00}, /* 8khz */
|
||||||
|
{0x24, 0x3e, 0x20, 0x00, 0x24, 0x3e, 0x20, 0x00, 0x3e, 0x10, 0x28, 0x00}, /* 11khz */
|
||||||
|
{0x24, 0x3e, 0x20, 0x00, 0x3a, 0x2a, 0x2e, 0x00, 0x3e, 0x10, 0x28, 0x00}, /* 12khz */
|
||||||
|
{0x24, 0x3e, 0x20, 0x00, 0x3e, 0x2a, 0x3a, 0x00, 0x3e, 0x10, 0x28, 0x00}, /* 16khz */
|
||||||
|
{0x3a, 0x2a, 0x2e, 0x00, 0x3a, 0x2a, 0x2e, 0x00, 0x3e, 0x10, 0x28, 0x00}, /* 22khz */
|
||||||
|
{0x3a, 0x2a, 0x2e, 0x00, 0x0e, 0x08, 0x3e, 0x00, 0x3e, 0x10, 0x28, 0x00}, /* 24khz */
|
||||||
|
{0x22, 0x2a, 0x36, 0x00, 0x3a, 0x2a, 0x2e, 0x00, 0x3e, 0x10, 0x28, 0x00}, /* 32khz */
|
||||||
|
{0x0e, 0x08, 0x3e, 0x00, 0x0e, 0x08, 0x3e, 0x00, 0x3e, 0x10, 0x28, 0x00}, /* 44.1khz */
|
||||||
|
{0x0e, 0x08, 0x3e, 0x00, 0x3e, 0x2a, 0x3e, 0x00, 0x3e, 0x10, 0x28, 0x00}, /* 48khz */
|
||||||
|
{0x3e, 0x2a, 0x3a, 0x00, 0x0e, 0x08, 0x3e, 0x00, 0x3e, 0x10, 0x28, 0x00}, /* 64khz */
|
||||||
|
{0x3e, 0x2a, 0x3e, 0x00, 0x3e, 0x2a, 0x3e, 0x00, 0x3e, 0x10, 0x28, 0x00}, /* 88.2khz */
|
||||||
|
{0x0e, 0x0a, 0x3e, 0x00, 0x3e, 0x2a, 0x3a, 0x00, 0x3e, 0x10, 0x28, 0x00} /* 96khz */
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Disk/MMC activity */
|
/* Disk/MMC activity */
|
||||||
const unsigned char bitmap_icon_disk[12] =
|
const unsigned char bitmap_icon_disk[12] =
|
||||||
#ifdef HAVE_MMC
|
#ifdef HAVE_MMC
|
||||||
|
|
|
||||||
|
|
@ -85,6 +85,24 @@ enum icons_7x8 {
|
||||||
Icon7x8Last
|
Icon7x8Last
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if CONFIG_CODEC == SWCODEC
|
||||||
|
enum icons_12x8 {
|
||||||
|
Icon_8000,
|
||||||
|
Icon_11025,
|
||||||
|
Icon_12000,
|
||||||
|
Icon_16000,
|
||||||
|
Icon_22050,
|
||||||
|
Icon_24000,
|
||||||
|
Icon_32000,
|
||||||
|
Icon_44100,
|
||||||
|
Icon_48000,
|
||||||
|
Icon_64000,
|
||||||
|
Icon_88200,
|
||||||
|
Icon_96000,
|
||||||
|
Icon12x8Last
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
enum icons_18x8 {
|
enum icons_18x8 {
|
||||||
Icon_mp364,
|
Icon_mp364,
|
||||||
Icon_mp396,
|
Icon_mp396,
|
||||||
|
|
@ -100,6 +118,9 @@ enum icons_18x8 {
|
||||||
extern const unsigned char bitmap_icons_5x8[Icon5x8Last][5];
|
extern const unsigned char bitmap_icons_5x8[Icon5x8Last][5];
|
||||||
extern const unsigned char bitmap_icons_6x8[Icon6x8Last][6];
|
extern const unsigned char bitmap_icons_6x8[Icon6x8Last][6];
|
||||||
extern const unsigned char bitmap_icons_7x8[Icon7x8Last][7];
|
extern const unsigned char bitmap_icons_7x8[Icon7x8Last][7];
|
||||||
|
#if CONFIG_CODEC == SWCODEC
|
||||||
|
extern const unsigned char bitmap_icons_12x8[Icon12x8Last][12];
|
||||||
|
#endif
|
||||||
extern const unsigned char bitmap_icons_18x8[Icon18x8Last][18];
|
extern const unsigned char bitmap_icons_18x8[Icon18x8Last][18];
|
||||||
extern const unsigned char bitmap_icon_disk[];
|
extern const unsigned char bitmap_icon_disk[];
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue