1 /* 2 * Copyright (C) 2021 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package android.media.audio.common; 18 19 import android.media.audio.common.AudioChannelLayout; 20 21 /** 22 * This structure represents a gain stage. A gain stage is always attached 23 * to an AudioPort. 24 * 25 * {@hide} 26 */ 27 @JavaDerive(equals=true, toString=true) 28 @VintfStability 29 parcelable AudioGain { 30 /** Bitmask, indexed by AudioGainMode. */ 31 int mode; 32 /** For AudioGainMode.CHANNELS, specifies controlled channels. */ 33 AudioChannelLayout channelMask; 34 /** Minimum gain value in millibels. */ 35 int minValue; 36 /** Maximum gain value in millibels. */ 37 int maxValue; 38 /** Default gain value in millibels. */ 39 int defaultValue; 40 /** Gain step in millibels. */ 41 int stepValue; 42 /** Minimum ramp duration in milliseconds. */ 43 int minRampMs; 44 /** Maximum ramp duration in milliseconds. */ 45 int maxRampMs; 46 /** Indicates whether it is allowed to use this stage for volume control. */ 47 boolean useForVolume; 48 } 49