From d7fa569df60026a3f28173dafcdffbfaa99ed0fe Mon Sep 17 00:00:00 2001 From: Martin Scarratt Date: Tue, 12 Sep 2006 18:26:27 +0000 Subject: Improved statusbar icons in recording screen by Davide Gentile git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10935 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/statusbar.c | 57 ++++++++++++++++++++++++++++++--------------------- apps/recorder/icons.c | 57 +++++++++++++++++++++++++++++++++------------------ apps/recorder/icons.h | 21 +++++++++++++++++++ 3 files changed, 92 insertions(+), 43 deletions(-) diff --git a/apps/gui/statusbar.c b/apps/gui/statusbar.c index 72e681faaf..08c02fa874 100644 --- a/apps/gui/statusbar.c +++ b/apps/gui/statusbar.c @@ -77,7 +77,7 @@ STATUSBAR_PLUG_WIDTH + \ STATUSBAR_VOLUME_WIDTH + \ STATUSBAR_PLAY_STATE_WIDTH + \ - 3*ICONS_SPACING + 4*ICONS_SPACING - 1 #define STATUSBAR_RECFREQ_WIDTH 12 #define STATUSBAR_RECCHANNELS_X_POS STATUSBAR_X_POS + \ STATUSBAR_BATTERY_WIDTH + \ @@ -602,8 +602,11 @@ void gui_statusbar_time(struct screen * display, int hour, int minute) #ifdef HAVE_RECORDING void gui_statusbar_icon_recording_info(struct screen * display) { - int width, height; +#if (CONFIG_CODEC != SWCODEC) || defined(SIMULATOR) char buffer[4]; +#endif +#if CONFIG_CODEC != SWCODEC + int width, height; char* const sample_rate[12] = { "8", @@ -619,22 +622,21 @@ void gui_statusbar_icon_recording_info(struct screen * display) "88", "96" }; -#if CONFIG_CODEC != SWCODEC char* const bit_rate[9] = { - "MQ0", - "MQ1", - "MQ2", - "MQ3", - "MQ4", - "MQ5", - "MQ6", - "MQ7", + "Mq0", + "Mq1", + "Mq2", + "Mq3", + "Mq4", + "Mq5", + "Mq6", + "Mq7", "WAV" }; -#endif display->setfont(FONT_SYSFIXED); +#endif /* Display Codec info in statusbar */ #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_WIDTH, STATUSBAR_HEIGHT); #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); 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 (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 - /* 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"); #endif } @@ -681,17 +687,22 @@ void gui_statusbar_icon_recording_info(struct screen * display) else if (freq == 5) 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]); - } - - display->getstringsize(buffer, &width, &height); - if (height <= STATUSBAR_HEIGHT) - { - display->putsxy(STATUSBAR_RECFREQ_X_POS, STATUSBAR_Y_POS, buffer); - } + display->getstringsize(buffer, &width, &height); - display->setfont(FONT_UI); + if (height <= STATUSBAR_HEIGHT) + display->putsxy(STATUSBAR_RECFREQ_X_POS, STATUSBAR_Y_POS, buffer); + display->setfont(FONT_UI); +#endif + } /* Display Channel status in status bar */ if(global_settings.rec_channels) { diff --git a/apps/recorder/icons.c b/apps/recorder/icons.c index fc271e890f..80021b165e 100644 --- a/apps/recorder/icons.c +++ b/apps/recorder/icons.c @@ -79,27 +79,44 @@ const unsigned char bitmap_icons_7x8[][7] = const unsigned char bitmap_icons_18x8[][18] = { - {0x00, 0x00, 0x00, 0x00, 0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x00, 0x1c, 0x2a, - 0x12, 0x00, 0x1e, 0x30, 0x10}, /* mp3 64kbps */ - {0x00, 0x00, 0x00, 0x00, 0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x00, 0x04, 0x0a, - 0x3e, 0x00, 0x1c, 0x2a, 0x12}, /* mp3 96kbps */ - {0x00, 0x00, 0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x00, 0x3e, 0x00, 0x32, 0x2a, - 0x24, 0x00, 0x14, 0x2a, 0x14}, /* mp3 128kbps */ - {0x00, 0x00, 0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x00, 0x3e, 0x00, 0x1c, 0x2a, - 0x12, 0x00, 0x1c, 0x22, 0x1c}, /* mp3 160kbps */ - {0x00, 0x00, 0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x00, 0x3e, 0x00, 0x04, 0x0a, - 0x3e, 0x00, 0x32, 0x2a, 0x24}, /* mp3 192kbps */ - {0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x00, 0x32, 0x2a, 0x24, 0x00, 0x32, 0x2a, - 0x24, 0x00, 0x1e, 0x30, 0x10}, /* mp3 224kbps */ - {0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x00, 0x22, 0x2a, 0x14, 0x00, 0x32, 0x2a, - 0x24, 0x00, 0x1c, 0x22, 0x1c}, /* mp3 320kbps */ - {0x00, 0x00, 0x00, 0x00, 0x1e, 0x20, 0x18, 0x20, 0x1e, 0x00, 0x1e, 0x20, 0x18, - 0x06, 0x00, 0x00, 0x00, 0x00}, /* wv */ - {0x00, 0x1e, 0x20, 0x18, 0x20, 0x1e, 0x00, 0x3c, 0x12, 0x12, 0x3c, 0x00, 0x1e, - 0x20, 0x18, 0x06, 0x00, 0x00} /* wav */ + {0x00, 0x00, 0x00, 0x00,0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x3e, 0x2a, + 0x3a, 0x00, 0x0e, 0x08, 0x3e, 0x00}, /* mp3 64kbps */ + {0x00, 0x00, 0x00, 0x00,0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x0e, 0x0a, + 0x3e, 0x00, 0x3e, 0x2a, 0x3a, 0x00}, /* mp3 96kbps */ + {0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x24, 0x3e, 0x20, 0x00, 0x3a, 0x2a, + 0x2e, 0x00, 0x3e, 0x2a, 0x3e, 0x00}, /* mp3 128kbps */ + {0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x24, 0x3e, 0x20, 0x00, 0x3e, 0x2a, + 0x3a, 0x00, 0x3e, 0x22, 0x3e, 0x00}, /* mp3 160kbps */ + {0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x24, 0x3e, 0x20, 0x00, 0x0e, 0x0a, + 0x3e, 0x00, 0x3a, 0x2a, 0x2e, 0x00}, /* mp3 192kbps */ + {0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x3a, 0x2a, 0x2e, 0x00, 0x3a, 0x2a, + 0x2e, 0x00, 0x0e, 0x08, 0x3e, 0x00}, /* mp3 224kbps */ + {0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x22, 0x2a, 0x36, 0x00, 0x3a, 0x2a, + 0x2e, 0x00, 0x3e, 0x22, 0x3e, 0x00}, /* mp3 320kbps */ + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x1e, 0x20, 0x18, 0x20, 0x1e, + 0x00, 0x1e, 0x20, 0x18, 0x06, 0x00}, /* wv */ + {0x00, 0x00, 0x1e, 0x20, 0x18, 0x20, 0x1e, 0x00, 0x3c, 0x12, 0x12, 0x3c, + 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 */ const unsigned char bitmap_icon_disk[12] = #ifdef HAVE_MMC diff --git a/apps/recorder/icons.h b/apps/recorder/icons.h index 5e7f157c75..ce7eb5fc92 100644 --- a/apps/recorder/icons.h +++ b/apps/recorder/icons.h @@ -85,6 +85,24 @@ enum icons_7x8 { 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 { Icon_mp364, Icon_mp396, @@ -100,6 +118,9 @@ enum icons_18x8 { extern const unsigned char bitmap_icons_5x8[Icon5x8Last][5]; extern const unsigned char bitmap_icons_6x8[Icon6x8Last][6]; 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_icon_disk[]; -- cgit v1.2.3