diff options
-rw-r--r-- | apps/gui/statusbar.c | 57 | ||||
-rw-r--r-- | apps/recorder/icons.c | 57 | ||||
-rw-r--r-- | 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 @@ | |||
77 | STATUSBAR_PLUG_WIDTH + \ | 77 | STATUSBAR_PLUG_WIDTH + \ |
78 | STATUSBAR_VOLUME_WIDTH + \ | 78 | STATUSBAR_VOLUME_WIDTH + \ |
79 | STATUSBAR_PLAY_STATE_WIDTH + \ | 79 | STATUSBAR_PLAY_STATE_WIDTH + \ |
80 | 3*ICONS_SPACING | 80 | 4*ICONS_SPACING - 1 |
81 | #define STATUSBAR_RECFREQ_WIDTH 12 | 81 | #define STATUSBAR_RECFREQ_WIDTH 12 |
82 | #define STATUSBAR_RECCHANNELS_X_POS STATUSBAR_X_POS + \ | 82 | #define STATUSBAR_RECCHANNELS_X_POS STATUSBAR_X_POS + \ |
83 | STATUSBAR_BATTERY_WIDTH + \ | 83 | STATUSBAR_BATTERY_WIDTH + \ |
@@ -602,8 +602,11 @@ void gui_statusbar_time(struct screen * display, int hour, int minute) | |||
602 | #ifdef HAVE_RECORDING | 602 | #ifdef HAVE_RECORDING |
603 | void gui_statusbar_icon_recording_info(struct screen * display) | 603 | void gui_statusbar_icon_recording_info(struct screen * display) |
604 | { | 604 | { |
605 | int width, height; | 605 | #if (CONFIG_CODEC != SWCODEC) || defined(SIMULATOR) |
606 | char buffer[4]; | 606 | char buffer[4]; |
607 | #endif | ||
608 | #if CONFIG_CODEC != SWCODEC | ||
609 | int width, height; | ||
607 | char* const sample_rate[12] = | 610 | char* const sample_rate[12] = |
608 | { | 611 | { |
609 | "8", | 612 | "8", |
@@ -619,22 +622,21 @@ void gui_statusbar_icon_recording_info(struct screen * display) | |||
619 | "88", | 622 | "88", |
620 | "96" | 623 | "96" |
621 | }; | 624 | }; |
622 | #if CONFIG_CODEC != SWCODEC | ||
623 | char* const bit_rate[9] = | 625 | char* const bit_rate[9] = |
624 | { | 626 | { |
625 | "MQ0", | 627 | "Mq0", |
626 | "MQ1", | 628 | "Mq1", |
627 | "MQ2", | 629 | "Mq2", |
628 | "MQ3", | 630 | "Mq3", |
629 | "MQ4", | 631 | "Mq4", |
630 | "MQ5", | 632 | "Mq5", |
631 | "MQ6", | 633 | "Mq6", |
632 | "MQ7", | 634 | "Mq7", |
633 | "WAV" | 635 | "WAV" |
634 | }; | 636 | }; |
635 | #endif | ||
636 | 637 | ||
637 | display->setfont(FONT_SYSFIXED); | 638 | display->setfont(FONT_SYSFIXED); |
639 | #endif | ||
638 | 640 | ||
639 | /* Display Codec info in statusbar */ | 641 | /* Display Codec info in statusbar */ |
640 | #if CONFIG_CODEC == SWCODEC | 642 | #if CONFIG_CODEC == SWCODEC |
@@ -644,7 +646,8 @@ void gui_statusbar_icon_recording_info(struct screen * display) | |||
644 | STATUSBAR_ENCODER_X_POS, STATUSBAR_Y_POS, | 646 | STATUSBAR_ENCODER_X_POS, STATUSBAR_Y_POS, |
645 | STATUSBAR_ENCODER_WIDTH, STATUSBAR_HEIGHT); | 647 | STATUSBAR_ENCODER_WIDTH, STATUSBAR_HEIGHT); |
646 | #else | 648 | #else |
647 | snprintf(buffer, sizeof(buffer), "%s", bit_rate[global_settings.rec_quality]); | 649 | snprintf(buffer, sizeof(buffer), "%s", |
650 | bit_rate[global_settings.rec_quality]); | ||
648 | display->getstringsize(buffer, &width, &height); | 651 | display->getstringsize(buffer, &width, &height); |
649 | if (height <= STATUSBAR_HEIGHT) | 652 | if (height <= STATUSBAR_HEIGHT) |
650 | { | 653 | { |
@@ -657,9 +660,12 @@ void gui_statusbar_icon_recording_info(struct screen * display) | |||
657 | if (global_settings.rec_source == SOURCE_SPDIF) | 660 | if (global_settings.rec_source == SOURCE_SPDIF) |
658 | { | 661 | { |
659 | #if (CONFIG_CODEC != MAS3587F) && !defined(SIMULATOR) | 662 | #if (CONFIG_CODEC != MAS3587F) && !defined(SIMULATOR) |
660 | snprintf(buffer, sizeof(buffer), "%s", sample_rate[audio_get_spdif_sample_rate()]); | 663 | display->mono_bitmap(bitmap_icons_12x8[audio_get_spdif_sample_rate()], |
664 | STATUSBAR_RECFREQ_X_POS, STATUSBAR_Y_POS, | ||
665 | STATUSBAR_RECFREQ_WIDTH, STATUSBAR_HEIGHT); | ||
661 | #else | 666 | #else |
662 | /* Can't measure S/PDIF sample rate on Archos/Sim yet so just display input type */ | 667 | /* Can't measure S/PDIF sample rate on Archos/Sim yet so |
668 | just display input type */ | ||
663 | snprintf(buffer, sizeof(buffer), "Dg"); | 669 | snprintf(buffer, sizeof(buffer), "Dg"); |
664 | #endif | 670 | #endif |
665 | } | 671 | } |
@@ -681,17 +687,22 @@ void gui_statusbar_icon_recording_info(struct screen * display) | |||
681 | else if (freq == 5) | 687 | else if (freq == 5) |
682 | freq = FREQ_16; | 688 | freq = FREQ_16; |
683 | 689 | ||
690 | #if CONFIG_CODEC == SWCODEC | ||
691 | /* samplerate icons for swcodec targets*/ | ||
692 | display->mono_bitmap(bitmap_icons_12x8[freq], | ||
693 | STATUSBAR_RECFREQ_X_POS, STATUSBAR_Y_POS, | ||
694 | STATUSBAR_RECFREQ_WIDTH, STATUSBAR_HEIGHT); | ||
695 | #else | ||
696 | /* hwcodec targets have sysfont characters */ | ||
684 | snprintf(buffer, sizeof(buffer), "%s", sample_rate[freq]); | 697 | snprintf(buffer, sizeof(buffer), "%s", sample_rate[freq]); |
685 | } | 698 | display->getstringsize(buffer, &width, &height); |
686 | |||
687 | display->getstringsize(buffer, &width, &height); | ||
688 | if (height <= STATUSBAR_HEIGHT) | ||
689 | { | ||
690 | display->putsxy(STATUSBAR_RECFREQ_X_POS, STATUSBAR_Y_POS, buffer); | ||
691 | } | ||
692 | 699 | ||
693 | display->setfont(FONT_UI); | 700 | if (height <= STATUSBAR_HEIGHT) |
701 | display->putsxy(STATUSBAR_RECFREQ_X_POS, STATUSBAR_Y_POS, buffer); | ||
694 | 702 | ||
703 | display->setfont(FONT_UI); | ||
704 | #endif | ||
705 | } | ||
695 | /* Display Channel status in status bar */ | 706 | /* Display Channel status in status bar */ |
696 | if(global_settings.rec_channels) | 707 | if(global_settings.rec_channels) |
697 | { | 708 | { |
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] = | |||
79 | 79 | ||
80 | const unsigned char bitmap_icons_18x8[][18] = | 80 | const unsigned char bitmap_icons_18x8[][18] = |
81 | { | 81 | { |
82 | {0x00, 0x00, 0x00, 0x00, 0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x00, 0x1c, 0x2a, | 82 | {0x00, 0x00, 0x00, 0x00,0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x3e, 0x2a, |
83 | 0x12, 0x00, 0x1e, 0x30, 0x10}, /* mp3 64kbps */ | 83 | 0x3a, 0x00, 0x0e, 0x08, 0x3e, 0x00}, /* mp3 64kbps */ |
84 | {0x00, 0x00, 0x00, 0x00, 0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x00, 0x04, 0x0a, | 84 | {0x00, 0x00, 0x00, 0x00,0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x0e, 0x0a, |
85 | 0x3e, 0x00, 0x1c, 0x2a, 0x12}, /* mp3 96kbps */ | 85 | 0x3e, 0x00, 0x3e, 0x2a, 0x3a, 0x00}, /* mp3 96kbps */ |
86 | {0x00, 0x00, 0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x00, 0x3e, 0x00, 0x32, 0x2a, | 86 | {0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x24, 0x3e, 0x20, 0x00, 0x3a, 0x2a, |
87 | 0x24, 0x00, 0x14, 0x2a, 0x14}, /* mp3 128kbps */ | 87 | 0x2e, 0x00, 0x3e, 0x2a, 0x3e, 0x00}, /* mp3 128kbps */ |
88 | {0x00, 0x00, 0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x00, 0x3e, 0x00, 0x1c, 0x2a, | 88 | {0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x24, 0x3e, 0x20, 0x00, 0x3e, 0x2a, |
89 | 0x12, 0x00, 0x1c, 0x22, 0x1c}, /* mp3 160kbps */ | 89 | 0x3a, 0x00, 0x3e, 0x22, 0x3e, 0x00}, /* mp3 160kbps */ |
90 | {0x00, 0x00, 0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x00, 0x3e, 0x00, 0x04, 0x0a, | 90 | {0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x24, 0x3e, 0x20, 0x00, 0x0e, 0x0a, |
91 | 0x3e, 0x00, 0x32, 0x2a, 0x24}, /* mp3 192kbps */ | 91 | 0x3e, 0x00, 0x3a, 0x2a, 0x2e, 0x00}, /* mp3 192kbps */ |
92 | {0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x00, 0x32, 0x2a, 0x24, 0x00, 0x32, 0x2a, | 92 | {0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x3a, 0x2a, 0x2e, 0x00, 0x3a, 0x2a, |
93 | 0x24, 0x00, 0x1e, 0x30, 0x10}, /* mp3 224kbps */ | 93 | 0x2e, 0x00, 0x0e, 0x08, 0x3e, 0x00}, /* mp3 224kbps */ |
94 | {0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x00, 0x22, 0x2a, 0x14, 0x00, 0x32, 0x2a, | 94 | {0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x22, 0x2a, 0x36, 0x00, 0x3a, 0x2a, |
95 | 0x24, 0x00, 0x1c, 0x22, 0x1c}, /* mp3 320kbps */ | 95 | 0x2e, 0x00, 0x3e, 0x22, 0x3e, 0x00}, /* mp3 320kbps */ |
96 | {0x00, 0x00, 0x00, 0x00, 0x1e, 0x20, 0x18, 0x20, 0x1e, 0x00, 0x1e, 0x20, 0x18, | 96 | {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x1e, 0x20, 0x18, 0x20, 0x1e, |
97 | 0x06, 0x00, 0x00, 0x00, 0x00}, /* wv */ | 97 | 0x00, 0x1e, 0x20, 0x18, 0x06, 0x00}, /* wv */ |
98 | {0x00, 0x1e, 0x20, 0x18, 0x20, 0x1e, 0x00, 0x3c, 0x12, 0x12, 0x3c, 0x00, 0x1e, | 98 | {0x00, 0x00, 0x1e, 0x20, 0x18, 0x20, 0x1e, 0x00, 0x3c, 0x12, 0x12, 0x3c, |
99 | 0x20, 0x18, 0x06, 0x00, 0x00} /* wav */ | 99 | 0x00, 0x1e, 0x20, 0x18, 0x06, 0x00} /* wav */ |
100 | }; | 100 | }; |
101 | 101 | ||
102 | 102 | #if CONFIG_CODEC == SWCODEC | |
103 | const unsigned char bitmap_icons_12x8[][12] = | ||
104 | { | ||
105 | {0x00, 0x00, 0x00, 0x00, 0x3e, 0x2a, 0x3e, 0x00, 0x3e, 0x10, 0x28, 0x00}, /* 8khz */ | ||
106 | {0x24, 0x3e, 0x20, 0x00, 0x24, 0x3e, 0x20, 0x00, 0x3e, 0x10, 0x28, 0x00}, /* 11khz */ | ||
107 | {0x24, 0x3e, 0x20, 0x00, 0x3a, 0x2a, 0x2e, 0x00, 0x3e, 0x10, 0x28, 0x00}, /* 12khz */ | ||
108 | {0x24, 0x3e, 0x20, 0x00, 0x3e, 0x2a, 0x3a, 0x00, 0x3e, 0x10, 0x28, 0x00}, /* 16khz */ | ||
109 | {0x3a, 0x2a, 0x2e, 0x00, 0x3a, 0x2a, 0x2e, 0x00, 0x3e, 0x10, 0x28, 0x00}, /* 22khz */ | ||
110 | {0x3a, 0x2a, 0x2e, 0x00, 0x0e, 0x08, 0x3e, 0x00, 0x3e, 0x10, 0x28, 0x00}, /* 24khz */ | ||
111 | {0x22, 0x2a, 0x36, 0x00, 0x3a, 0x2a, 0x2e, 0x00, 0x3e, 0x10, 0x28, 0x00}, /* 32khz */ | ||
112 | {0x0e, 0x08, 0x3e, 0x00, 0x0e, 0x08, 0x3e, 0x00, 0x3e, 0x10, 0x28, 0x00}, /* 44.1khz */ | ||
113 | {0x0e, 0x08, 0x3e, 0x00, 0x3e, 0x2a, 0x3e, 0x00, 0x3e, 0x10, 0x28, 0x00}, /* 48khz */ | ||
114 | {0x3e, 0x2a, 0x3a, 0x00, 0x0e, 0x08, 0x3e, 0x00, 0x3e, 0x10, 0x28, 0x00}, /* 64khz */ | ||
115 | {0x3e, 0x2a, 0x3e, 0x00, 0x3e, 0x2a, 0x3e, 0x00, 0x3e, 0x10, 0x28, 0x00}, /* 88.2khz */ | ||
116 | {0x0e, 0x0a, 0x3e, 0x00, 0x3e, 0x2a, 0x3a, 0x00, 0x3e, 0x10, 0x28, 0x00} /* 96khz */ | ||
117 | }; | ||
118 | #endif | ||
119 | |||
103 | /* Disk/MMC activity */ | 120 | /* Disk/MMC activity */ |
104 | const unsigned char bitmap_icon_disk[12] = | 121 | const unsigned char bitmap_icon_disk[12] = |
105 | #ifdef HAVE_MMC | 122 | #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 { | |||
85 | Icon7x8Last | 85 | Icon7x8Last |
86 | }; | 86 | }; |
87 | 87 | ||
88 | #if CONFIG_CODEC == SWCODEC | ||
89 | enum icons_12x8 { | ||
90 | Icon_8000, | ||
91 | Icon_11025, | ||
92 | Icon_12000, | ||
93 | Icon_16000, | ||
94 | Icon_22050, | ||
95 | Icon_24000, | ||
96 | Icon_32000, | ||
97 | Icon_44100, | ||
98 | Icon_48000, | ||
99 | Icon_64000, | ||
100 | Icon_88200, | ||
101 | Icon_96000, | ||
102 | Icon12x8Last | ||
103 | }; | ||
104 | #endif | ||
105 | |||
88 | enum icons_18x8 { | 106 | enum icons_18x8 { |
89 | Icon_mp364, | 107 | Icon_mp364, |
90 | Icon_mp396, | 108 | Icon_mp396, |
@@ -100,6 +118,9 @@ enum icons_18x8 { | |||
100 | extern const unsigned char bitmap_icons_5x8[Icon5x8Last][5]; | 118 | extern const unsigned char bitmap_icons_5x8[Icon5x8Last][5]; |
101 | extern const unsigned char bitmap_icons_6x8[Icon6x8Last][6]; | 119 | extern const unsigned char bitmap_icons_6x8[Icon6x8Last][6]; |
102 | extern const unsigned char bitmap_icons_7x8[Icon7x8Last][7]; | 120 | extern const unsigned char bitmap_icons_7x8[Icon7x8Last][7]; |
121 | #if CONFIG_CODEC == SWCODEC | ||
122 | extern const unsigned char bitmap_icons_12x8[Icon12x8Last][12]; | ||
123 | #endif | ||
103 | extern const unsigned char bitmap_icons_18x8[Icon18x8Last][18]; | 124 | extern const unsigned char bitmap_icons_18x8[Icon18x8Last][18]; |
104 | extern const unsigned char bitmap_icon_disk[]; | 125 | extern const unsigned char bitmap_icon_disk[]; |
105 | 126 | ||