diff options
Diffstat (limited to 'src/audio/player.c')
-rw-r--r-- | src/audio/player.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/audio/player.c b/src/audio/player.c index d2ec9870..c08b20fc 100644 --- a/src/audio/player.c +++ b/src/audio/player.c | |||
@@ -22,6 +22,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ | |||
22 | 22 | ||
23 | #include "player.h" | 23 | #include "player.h" |
24 | #include "buf.h" | 24 | #include "buf.h" |
25 | #include "lang.h" | ||
25 | 26 | ||
26 | #define STB_VORBIS_HEADER_ONLY | 27 | #define STB_VORBIS_HEADER_ONLY |
27 | #include "stb_vorbis.c" | 28 | #include "stb_vorbis.c" |
@@ -579,7 +580,7 @@ static iContentSpec contentSpec_Player_(const iPlayer *d) { | |||
579 | content.output.freq = info.sample_rate; | 580 | content.output.freq = info.sample_rate; |
580 | content.output.channels = numChannels; | 581 | content.output.channels = numChannels; |
581 | content.output.format = AUDIO_F32; | 582 | content.output.format = AUDIO_F32; |
582 | content.inputFormat = AUDIO_F32; /* actually stb_vorbis provides floats */ | 583 | content.inputFormat = AUDIO_F32; /* actually stb_vorbis provides floats */ |
583 | stb_vorbis_close(vrb); | 584 | stb_vorbis_close(vrb); |
584 | } | 585 | } |
585 | else if (content.type == mpeg_DecoderType) { | 586 | else if (content.type == mpeg_DecoderType) { |
@@ -783,23 +784,27 @@ iString *metadataLabel_Player(const iPlayer *d) { | |||
783 | lock_Mutex(&d->decoder->tagMutex); | 784 | lock_Mutex(&d->decoder->tagMutex); |
784 | const iString *tags = d->decoder->tags; | 785 | const iString *tags = d->decoder->tags; |
785 | if (!isEmpty_String(&tags[title_PlayerTag])) { | 786 | if (!isEmpty_String(&tags[title_PlayerTag])) { |
786 | appendFormat_String(meta, "Title: %s\n", cstr_String(&tags[title_PlayerTag])); | 787 | appendFormat_String(meta, "${audio.meta.title}: %s\n", cstr_String(&tags[title_PlayerTag])); |
787 | } | 788 | } |
788 | if (!isEmpty_String(&tags[artist_PlayerTag])) { | 789 | if (!isEmpty_String(&tags[artist_PlayerTag])) { |
789 | appendFormat_String(meta, "Artist: %s\n", cstr_String(&tags[artist_PlayerTag])); | 790 | appendFormat_String(meta, "${audio.meta.artist}: %s\n", cstr_String(&tags[artist_PlayerTag])); |
790 | } | 791 | } |
791 | if (!isEmpty_String(&tags[genre_PlayerTag])) { | 792 | if (!isEmpty_String(&tags[genre_PlayerTag])) { |
792 | appendFormat_String(meta, "Genre: %s\n", cstr_String(&tags[genre_PlayerTag])); | 793 | appendFormat_String(meta, "${audio.meta.genre}: %s\n", cstr_String(&tags[genre_PlayerTag])); |
793 | } | 794 | } |
794 | if (!isEmpty_String(&tags[date_PlayerTag])) { | 795 | if (!isEmpty_String(&tags[date_PlayerTag])) { |
795 | appendFormat_String(meta, "Date: %s\n", cstr_String(&tags[date_PlayerTag])); | 796 | appendFormat_String(meta, "${audio.meta.date}: %s\n", cstr_String(&tags[date_PlayerTag])); |
796 | } | 797 | } |
797 | unlock_Mutex(&d->decoder->tagMutex); | 798 | unlock_Mutex(&d->decoder->tagMutex); |
798 | } | 799 | } |
799 | if (d->decoder) { | 800 | if (d->decoder) { |
800 | appendFormat_String(meta, "%d-bit %s %d Hz", SDL_AUDIO_BITSIZE(d->decoder->inputFormat), | 801 | appendFormat_String(meta, |
801 | SDL_AUDIO_ISFLOAT(d->decoder->inputFormat) ? "float" : "integer", | 802 | translateCStr_Lang("${n.bit} %s %d ${hz}"), /* translation adds %d */ |
802 | d->spec.freq); | 803 | SDL_AUDIO_BITSIZE(d->decoder->inputFormat), |
804 | cstr_Lang(SDL_AUDIO_ISFLOAT(d->decoder->inputFormat) | ||
805 | ? "numbertype.float" | ||
806 | : "numbertype.integer"), | ||
807 | d->spec.freq); | ||
803 | } | 808 | } |
804 | return meta; | 809 | return meta; |
805 | } | 810 | } |