blob: 12b4ef11ae48d07d43b18bbabb5fc5a3dc158e5f [file] [log] [blame]
// Copyright 2022 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library fuchsia.hardware.audio.signalprocessing;
/// Hardware domain of the gain, e.g. ANALOG.
type GainDomain = flexible enum : uint8 {
/// The processing element gain is applied in the digital domain.
DIGITAL = 1;
/// The processing element gain is applied in the analog domain.
ANALOG = 2;
/// The processing element gain is mixed using digital and analog hardware.
MIXED = 3;
};
/// Gain type of representation.
type GainType = strict enum : uint8 {
/// Gain specified in dB, for example -103.0dB or +3.2dB.
DECIBELS = 1;
/// Gain specified as a percentage, for example 10.0% or 80.5%.
PERCENT = 2;
};
/// Parameters for an `Element` with `type` equal to `GAIN`.
type Gain = table {
/// Specifies what the numbers for gain represent, e.g. a percentage.
///
/// Required.
1: type GainType;
/// If included, the gain is applied in the specified `GainDomain`.
/// If not included, the gain domain is unspecified.
///
/// Optional.
2: domain GainDomain;
/// Minimum gain in `GainType` format.
///
/// Required.
3: min_gain float32;
/// Maximum gain in `GainType` format.
///
/// Required.
4: max_gain float32;
/// Minimum gain step in `GainType` format, this value must not be negative, but may be zero to
/// convey an effectively continuous range of values. Must not exceed `max_gain` - `min_gain`.
/// The actual gain set may be queried by the client with a `WatchElementState` call.
///
/// Required.
5: min_gain_step float32;
};
/// State for an `Element` with `type` equal to `GAIN`.
type GainElementState = table {
/// Current gain in `GainType` format.
///
/// Required.
1: gain float32;
};