summaryrefslogtreecommitdiffstats
path: root/src/audiomixer.h
diff options
context:
space:
mode:
authorAshok Sidipotu <ashok.sidipotu@collabora.com>2023-12-14 16:19:21 +0530
committerAshok Sidipotu <ashok.sidipotu@collabora.com>2023-12-15 08:09:40 +0100
commit5567e12699dcc6584a620d2682430e3882dc0907 (patch)
treea2378a5199b94566d2cf5311d6f394ad5569cfb9 /src/audiomixer.h
parentf6eb75678f6c08c4eb3fe232f814834319611ff7 (diff)
audiomixer: add new channel volume API
- Add API to control left and right channel volumes. - Fix a bug in treble gain update. The changed gain value of Treble is not updated in the audiomixer as the gain changed callback(on_eq_params_changed) doesnt look beyond bass for gain controls. Fix this issue by continuing to look beyond bass control. - Adjust the floating point comparision epsilon value from 0.000001 to 0.00001. Bug-AGL: SPEC-4931 Change-Id: I2a242d08f194b66abd84bb31a97364884e8d2a1d Signed-off-by: Ashok Sidipotu <ashok.sidipotu@collabora.com>
Diffstat (limited to 'src/audiomixer.h')
-rw-r--r--src/audiomixer.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/audiomixer.h b/src/audiomixer.h
index 2e50420..1f089d1 100644
--- a/src/audiomixer.h
+++ b/src/audiomixer.h
@@ -20,6 +20,8 @@ struct mixer_control
{
char name[32];
double volume;
+ double lvolume; /* left channel volume */
+ double rvolume; /* right channel volume */
float gain;
bool mute;
};
@@ -30,6 +32,7 @@ struct audiomixer_events
void (*value_changed) (void *data,
#define MIXER_CONTROL_CHANGE_FLAG_VOLUME (1<<0)
+#define MIXER_CONTROL_CHANGE_FLAG_CHANNEL_VOLUME (1<<0)
#define MIXER_CONTROL_CHANGE_FLAG_MUTE (1<<1)
#define MIXER_CONTROL_CHANGE_FLAG_GAIN (1<<2)
unsigned int change_mask,
@@ -62,6 +65,10 @@ void audiomixer_change_volume(struct audiomixer *self,
const struct mixer_control *control,
double volume);
+void audiomixer_change_channel_volume (struct audiomixer *self,
+ const struct mixer_control *control,
+ double left_channel_volume, double right_channel_volume);
+
void audiomixer_change_gain(struct audiomixer *self,
const struct mixer_control *control,
float gain);