2 * Copyright (C) 2014 The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package android.media;
20 * The AudioGainConfig is used by APIs setting or getting values on a given gain
21 * controller. It contains a valid configuration (value, channels...) for a gain controller
22 * exposed by an audio port.
27 public class AudioGainConfig {
29 private final int mIndex;
30 private final int mMode;
31 private final int mChannelMask;
32 private final int mValues[];
33 private final int mRampDurationMs;
35 AudioGainConfig(int index, AudioGain gain, int mode, int channelMask,
36 int[] values, int rampDurationMs) {
40 mChannelMask = channelMask;
42 mRampDurationMs = rampDurationMs;
46 * get the index of the parent gain.
47 * frameworks use only.
54 * Bit field indicating requested modes of operation. See {@link AudioGain#MODE_JOINT},
55 * {@link AudioGain#MODE_CHANNELS}, {@link AudioGain#MODE_RAMP}
62 * Indicates for which channels the gain is set.
63 * See {@link AudioFormat#CHANNEL_OUT_STEREO}, {@link AudioFormat#CHANNEL_OUT_MONO} ...
65 public int channelMask() {
70 * Gain values for each channel in the order of bits set in
71 * channelMask() from LSB to MSB
73 public int[] values() {
78 * Ramp duration in milliseconds. N/A if mode() does not
81 public int rampDurationMs() {
82 return mRampDurationMs;