Add API to set custom IO port channel names

This commit is contained in:
Robin Gareus 2024-01-11 05:54:53 +01:00
parent db7a67980d
commit 3c5f9f1450
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 10 additions and 0 deletions

View File

@ -95,6 +95,10 @@ public:
void set_pretty_name (const std::string& str);
std::string pretty_name () const { return _pretty_name_prefix; }
void set_audio_channel_names (std::vector<std::string> const& acn) {
_audio_channel_names = acn;
}
virtual void silence (samplecnt_t);
int ensure_io (ChanCount cnt, bool clear, void *src);
@ -216,6 +220,8 @@ private:
std::shared_ptr<Bundle> _bundle; ///< a bundle representing our ports
std::vector<std::string> _audio_channel_names;
struct UserBundleInfo {
UserBundleInfo (IO*, std::shared_ptr<UserBundle> b);
std::shared_ptr<UserBundle> bundle;

View File

@ -1536,6 +1536,10 @@ IO::bundle_channel_name (uint32_t c, uint32_t n, DataType t) const
if (t == DataType::AUDIO) {
if (n == _audio_channel_names.size () && c < _audio_channel_names.size ()) {
return _audio_channel_names.at (c);
}
switch (n) {
case 1:
return _("mono");