Add API to set custom IO port channel names
This commit is contained in:
parent
db7a67980d
commit
3c5f9f1450
@ -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;
|
||||
|
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user