diff options
author | kcgen <kcgen@users.noreply.github.com> | 2022-10-12 19:35:38 +0300 |
---|---|---|
committer | kcgen <kcgen@users.noreply.github.com> | 2022-10-12 19:35:51 +0300 |
commit | 7ee5e3cf3b811e1b6313ccf2e49fe4dc2960a33d (patch) | |
tree | f66ee27d9051b432a5bd3c0113f0e29138860076 | |
parent | 584694b4ef35c13c4d2cf0dde47dfe0d55fd4a04 (diff) |
Use translatable messages for mixer channel modes
-rw-r--r-- | contrib/resources/translations/en.lng | 3 | ||||
-rw-r--r-- | contrib/resources/translations/utf-8/de.txt | 3 | ||||
-rw-r--r-- | contrib/resources/translations/utf-8/en.txt | 3 | ||||
-rw-r--r-- | contrib/resources/translations/utf-8/es.txt | 3 | ||||
-rw-r--r-- | contrib/resources/translations/utf-8/fr.txt | 3 | ||||
-rw-r--r-- | contrib/resources/translations/utf-8/it.txt | 3 | ||||
-rw-r--r-- | contrib/resources/translations/utf-8/nl.txt | 3 | ||||
-rw-r--r-- | contrib/resources/translations/utf-8/pl.txt | 4 | ||||
-rw-r--r-- | contrib/resources/translations/utf-8/ru.txt | 19 | ||||
-rw-r--r-- | include/mixer.h | 2 | ||||
-rw-r--r-- | src/hardware/mixer.cpp | 14 |
11 files changed, 35 insertions, 25 deletions
diff --git a/contrib/resources/translations/en.lng b/contrib/resources/translations/en.lng index b95a3a3a8..3dbcf39a1 100644 --- a/contrib/resources/translations/en.lng +++ b/contrib/resources/translations/en.lng @@ -1733,6 +1733,9 @@ off :SHELL_CMD_MIXER_CHANNEL_STEREO Stereo . +:SHELL_CMD_MIXER_CHANNEL_REVERSE +Reverse +. :SHELL_CMD_MIXER_CHANNEL_MONO Mono . diff --git a/contrib/resources/translations/utf-8/de.txt b/contrib/resources/translations/utf-8/de.txt index e829409eb..000576118 100644 --- a/contrib/resources/translations/utf-8/de.txt +++ b/contrib/resources/translations/utf-8/de.txt @@ -2822,3 +2822,6 @@ Sonstige Befehle :HELP_UTIL_CATEGORY_UNKNOWN Unbekannter Befehl . +:SHELL_CMD_MIXER_CHANNEL_REVERSE +Reverse +. diff --git a/contrib/resources/translations/utf-8/en.txt b/contrib/resources/translations/utf-8/en.txt index b95a3a3a8..3dbcf39a1 100644 --- a/contrib/resources/translations/utf-8/en.txt +++ b/contrib/resources/translations/utf-8/en.txt @@ -1733,6 +1733,9 @@ off :SHELL_CMD_MIXER_CHANNEL_STEREO Stereo . +:SHELL_CMD_MIXER_CHANNEL_REVERSE +Reverse +. :SHELL_CMD_MIXER_CHANNEL_MONO Mono . diff --git a/contrib/resources/translations/utf-8/es.txt b/contrib/resources/translations/utf-8/es.txt index 03ed6d0ce..4dbd3b77b 100644 --- a/contrib/resources/translations/utf-8/es.txt +++ b/contrib/resources/translations/utf-8/es.txt @@ -2697,3 +2697,6 @@ internal virtual drive :MOUNT_TYPE_UNKNOWN unknown drive . +:SHELL_CMD_MIXER_CHANNEL_REVERSE +Reverse +. diff --git a/contrib/resources/translations/utf-8/fr.txt b/contrib/resources/translations/utf-8/fr.txt index 1eb3b3c3a..b02356ba8 100644 --- a/contrib/resources/translations/utf-8/fr.txt +++ b/contrib/resources/translations/utf-8/fr.txt @@ -2604,3 +2604,6 @@ internal virtual drive :MOUNT_TYPE_UNKNOWN unknown drive . +:SHELL_CMD_MIXER_CHANNEL_REVERSE +Reverse +. diff --git a/contrib/resources/translations/utf-8/it.txt b/contrib/resources/translations/utf-8/it.txt index c8b0f99ff..abd9e0686 100644 --- a/contrib/resources/translations/utf-8/it.txt +++ b/contrib/resources/translations/utf-8/it.txt @@ -2845,3 +2845,6 @@ Comandi Vari :HELP_UTIL_CATEGORY_UNKNOWN Comando Sconosciuto . +:SHELL_CMD_MIXER_CHANNEL_REVERSE +Reverse +. diff --git a/contrib/resources/translations/utf-8/nl.txt b/contrib/resources/translations/utf-8/nl.txt index afd20b350..fc956824f 100644 --- a/contrib/resources/translations/utf-8/nl.txt +++ b/contrib/resources/translations/utf-8/nl.txt @@ -2766,3 +2766,6 @@ Diverse opdrachten :HELP_UTIL_CATEGORY_UNKNOWN Onbekende opdracht . +:SHELL_CMD_MIXER_CHANNEL_REVERSE +Reverse +. diff --git a/contrib/resources/translations/utf-8/pl.txt b/contrib/resources/translations/utf-8/pl.txt index d94417fd6..12236ed42 100644 --- a/contrib/resources/translations/utf-8/pl.txt +++ b/contrib/resources/translations/utf-8/pl.txt @@ -2703,4 +2703,6 @@ Inne polecenia :HELP_UTIL_CATEGORY_UNKNOWN PozostaĆe, bez kategorii . - +:SHELL_CMD_MIXER_CHANNEL_REVERSE +Reverse +. diff --git a/contrib/resources/translations/utf-8/ru.txt b/contrib/resources/translations/utf-8/ru.txt index 9d0a2949a..fc284a727 100644 --- a/contrib/resources/translations/utf-8/ru.txt +++ b/contrib/resources/translations/utf-8/ru.txt @@ -2637,21 +2637,6 @@ Miscellaneous Commands :HELP_UTIL_CATEGORY_UNKNOWN Unknown Command . -:MOUNT_TYPE_LOCAL_DIRECTORY -local directory -. -:MOUNT_TYPE_CDROM -CD-ROM drive -. -:MOUNT_TYPE_FAT -FAT drive -. -:MOUNT_TYPE_ISO -ISO drive -. -:MOUNT_TYPE_VIRTUAL -internal virtual drive -. -:MOUNT_TYPE_UNKNOWN -unknown drive +:SHELL_CMD_MIXER_CHANNEL_REVERSE +Reverse . diff --git a/include/mixer.h b/include/mixer.h index 8ebfebdfe..05b900438 100644 --- a/include/mixer.h +++ b/include/mixer.h @@ -167,7 +167,7 @@ public: const std::set<ChannelFeature> &features); ~MixerChannel(); - bool HasFeature(ChannelFeature feature); + bool HasFeature(ChannelFeature feature) const; int GetSampleRate() const; using apply_level_callback_f = std::function<void(const AudioFrame &level)>; void RegisterLevelCallBack(apply_level_callback_f cb); diff --git a/src/hardware/mixer.cpp b/src/hardware/mixer.cpp index 370c104b1..6579ee78f 100644 --- a/src/hardware/mixer.cpp +++ b/src/hardware/mixer.cpp @@ -228,7 +228,7 @@ MixerChannel::MixerChannel(MIXER_Handler _handler, const char *_name, do_sleep(HasFeature(ChannelFeature::Sleep)) {} -bool MixerChannel::HasFeature(const ChannelFeature feature) +bool MixerChannel::HasFeature(const ChannelFeature feature) const { return features.find(feature) != features.end(); } @@ -1734,10 +1734,12 @@ void MixerChannel::FillUp() std::string MixerChannel::DescribeLineout() const { + if (!HasFeature(ChannelFeature::Stereo)) + return MSG_Get("SHELL_CMD_MIXER_CHANNEL_MONO"); if (output_map == STEREO) - return "Stereo"; + return MSG_Get("SHELL_CMD_MIXER_CHANNEL_STEREO"); if (output_map == REVERSE) - return "Reverse"; + return MSG_Get("SHELL_CMD_MIXER_CHANNEL_REVERSE"); // Output_map is programmtically set (not directly assigned from user // data), so we can assert. @@ -2304,6 +2306,8 @@ private: MSG_Add("SHELL_CMD_MIXER_CHANNEL_STEREO", "Stereo"); + MSG_Add("SHELL_CMD_MIXER_CHANNEL_REVERSE", "Reverse"); + MSG_Add("SHELL_CMD_MIXER_CHANNEL_MONO", "Mono"); } @@ -2422,9 +2426,7 @@ private: auto channel_name = std::string("[color=cyan]") + name + std::string("[reset]"); - auto mode = chan->HasFeature(ChannelFeature::Stereo) - ? chan->DescribeLineout() - : MSG_Get("SHELL_CMD_MIXER_CHANNEL_MONO"); + auto mode = chan->DescribeLineout(); show_channel(convert_ansi_markup(channel_name), chan->volume, |