summaryrefslogtreecommitdiffstats
path: root/src/AudiomixerService.h
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2023-12-17 15:35:19 -0500
committerScott Murray <scott.murray@konsulko.com>2023-12-17 15:46:14 -0500
commit0ff3ef1b254364639fc42495bbcfb4760250990a (patch)
tree7a54eb69afa4bf11c54f3491ee1f69e2e1650873 /src/AudiomixerService.h
parent5567e12699dcc6584a620d2682430e3882dc0907 (diff)
Changes: - Add support for new VSS signals for balance/fade/treble/bass. Treble and bass drive the recently added equalizer controls, while balance and fade currently do simple linear scaling down of the non-emphasized direction. - Add support for VSS 4.0 separate navigation volume and mute signals. - Significant refactoring of the audiomixer API calling code in the AudioMixerService class to avoid code duplication. - All pushes of the updated VSS values for volume and mute signals now are driven from the mixer API callback so that internal and external mixer changes are handled with less code duplication. For now, gain changes have been kept as explicit VSS updates on set, this may change if handling external changes seems more worthwhile. As well, initial master volume setting is a bit of a special case, see below. - Setting the initial volume has been tweaked a bit to ensure that the value gets pushed out via VSS. There currently seems to be an issue with the master playback sink mixer not taking changes until playback starts, so while the current code ensures that VSS subscribers see the value the daemon has set, it is likely that does not correspond to what's in WirePlumber until playback of some form happens and another volume change is made. This will be addressed with upstream. - Change flags in the mixer API have been updated to indicate overall and per-channel volume changes as separate flags. Bug-AGL: SPEC-5001 Change-Id: I66585f573978989a0c281f060a667b4495e4bc0f Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Diffstat (limited to 'src/AudiomixerService.h')
-rw-r--r--src/AudiomixerService.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/AudiomixerService.h b/src/AudiomixerService.h
index 3cd87c6..dd26743 100644
--- a/src/AudiomixerService.h
+++ b/src/AudiomixerService.h
@@ -56,6 +56,13 @@ private:
struct audiomixer *m_audiomixer;
struct audiomixer_events m_audiomixer_events;
+ double m_volume = 0.5;
+ double m_volume_faded = 0.5;
+ int m_balance = 0;
+ int m_fade = 0;
+ double m_nav_volume = 0.5;
+ bool m_nav_mute = false;
+
void HandleSignalChange(const std::string &path, const Datapoint &dp);
void HandleSignalSetError(const std::string &path, const Error &error);
@@ -67,6 +74,14 @@ private:
void HandleMixerControlChange(void);
void HandleMixerValueChange(unsigned int change_mask, const struct mixer_control *control);
+
+ void SetMainVolume(void);
+
+ void SetMixerVolume(const std::string &path, const std::string &mixer, const double volume);
+
+ void SetMixerMute(const std::string path, const std::string mixer, const bool mute);
+
+ void SetEqualizerGain(const std::string path, const std::string mixer, const double gain);
};
#endif // _AUDIOMIXER_SERVICE_H