pulseaudio: Add 'sink-mapping' config option
This commit adds a new optional config to the pulseaudio modules. It
maps sink names to other sink names so that if the current sink is a
key, the sink named by the value is considered to be the current sink
instead of it.
E.g.
"sink-mapping": {
"easyeffects_sink": "speakers_sink"
}
This commit is contained in:
@@ -48,6 +48,7 @@ class AudioBackend {
|
||||
std::string default_source_name_;
|
||||
|
||||
std::vector<std::string> ignored_sinks_;
|
||||
std::map<std::string, std::string> sink_mapping_;
|
||||
|
||||
std::function<void()> on_updated_cb_ = NOOP;
|
||||
|
||||
@@ -69,6 +70,7 @@ class AudioBackend {
|
||||
void changeVolume(ChangeType change_type, double step = 1, uint16_t max_volume = 100);
|
||||
|
||||
void setIgnoredSinks(const Json::Value& config);
|
||||
void setSinkMapping(const Json::Value& config);
|
||||
|
||||
std::string getSinkPortName() const { return port_name_; }
|
||||
std::string getFormFactor() const { return form_factor_; }
|
||||
@@ -93,4 +95,4 @@ class AudioBackend {
|
||||
bool isBluetooth();
|
||||
};
|
||||
|
||||
} // namespace waybar::util
|
||||
} // namespace waybar::util
|
||||
|
||||
Reference in New Issue
Block a user