summaryrefslogtreecommitdiffstats
path: root/pica-client/capturegain.h
diff options
context:
space:
mode:
authorAnton <anton@picapica.im>2026-09-03 21:01:17 +0400
committerAnton <anton@picapica.im>2026-09-03 21:01:17 +0400
commite62dd7d30bec7a679013dcce8ec4bc2b2f842109 (patch)
tree0be99751303e3c0b3306b9d79ca344897996a05d /pica-client/capturegain.h
parentc6649895d58bcfab864bcc33b131db222e45bfef (diff)
downloadpica-pica-e62dd7d30bec7a679013dcce8ec4bc2b2f842109.tar.gz
pica-pica-e62dd7d30bec7a679013dcce8ec4bc2b2f842109.zip
pica-client: more improvements of echo cancellation
Diffstat (limited to 'pica-client/capturegain.h')
-rw-r--r--pica-client/capturegain.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/pica-client/capturegain.h b/pica-client/capturegain.h
index 4d833f1..a0d3bdc 100644
--- a/pica-client/capturegain.h
+++ b/pica-client/capturegain.h
@@ -18,6 +18,7 @@
#define CAPTUREGAIN_H
#include <QString>
+#include <QtGlobal>
// The capture device's own gain control - the mixer slider, not a multiplier
// applied to samples we already have.
@@ -51,6 +52,17 @@ public:
// read, in which case *out is untouched.
virtual bool gain(double *out) = 0;
+ // The same position in decibels, where the platform can say. This is what
+ // a caller should bound itself by: the fraction above is a position on a
+ // slider whose relationship to loudness differs per backend - linear in dB
+ // on an ALSA hardware control, roughly cubic on PulseAudio and WASAPI - so
+ // "5% of travel" is a mild cut on one and near silence on another. Decibels
+ // mean the same thing everywhere.
+ //
+ // False when the platform will not say, and then the caller has nothing to
+ // go on but a step count.
+ virtual bool gainDb(double *out) { Q_UNUSED(out) return false; }
+
// Moves the control. Values outside 0.0 to 1.0 are clamped.
virtual bool setGain(double value) = 0;