diff options
Diffstat (limited to 'apps/gui/statusbar.c')
-rw-r--r-- | apps/gui/statusbar.c | 57 |
1 files changed, 34 insertions, 23 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 | { |