Eric Laurent | 9630925 | 2011-06-17 09:02:12 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2011 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 | #ifndef ANDROID_EFFECT_VIRTUALIZER_H_ |
| 18 | #define ANDROID_EFFECT_VIRTUALIZER_H_ |
| 19 | |
| 20 | #include <hardware/audio_effect.h> |
| 21 | |
| 22 | #if __cplusplus |
| 23 | extern "C" { |
| 24 | #endif |
| 25 | |
| 26 | #ifndef OPENSL_ES_H_ |
Glenn Kasten | 548d9cf | 2012-11-02 07:59:08 -0700 | [diff] [blame] | 27 | static const effect_uuid_t SL_IID_VIRTUALIZER_ = { 0x37cc2c00, 0xdddd, 0x11db, 0x8577, |
| 28 | { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } }; |
Eric Laurent | 9630925 | 2011-06-17 09:02:12 -0700 | [diff] [blame] | 29 | const effect_uuid_t * const SL_IID_VIRTUALIZER = &SL_IID_VIRTUALIZER_; |
| 30 | #endif //OPENSL_ES_H_ |
| 31 | |
| 32 | /* enumerated parameter settings for virtualizer effect */ |
Jean-Michel Trivi | 4f57d02 | 2014-07-09 09:14:46 -0700 | [diff] [blame] | 33 | /* to keep in sync with frameworks/base/media/java/android/media/audiofx/Virtualizer.java */ |
Eric Laurent | 9630925 | 2011-06-17 09:02:12 -0700 | [diff] [blame] | 34 | typedef enum |
| 35 | { |
| 36 | VIRTUALIZER_PARAM_STRENGTH_SUPPORTED, |
Jean-Michel Trivi | 4f57d02 | 2014-07-09 09:14:46 -0700 | [diff] [blame] | 37 | VIRTUALIZER_PARAM_STRENGTH, |
| 38 | // used with EFFECT_CMD_GET_PARAM |
| 39 | // format: |
| 40 | // parameters int32_t VIRTUALIZER_PARAM_VIRTUAL_SPEAKER_ANGLES |
| 41 | // audio_channel_mask_t input channel mask |
| 42 | // audio_devices_t audio output device |
Jean-Michel Trivi | 046dddf | 2014-07-14 15:55:50 -0700 | [diff] [blame] | 43 | // output int32_t* an array of length 3 * the number of channels in the mask |
Jean-Michel Trivi | 4f57d02 | 2014-07-09 09:14:46 -0700 | [diff] [blame] | 44 | // where entries are the succession of the channel mask |
| 45 | // of each speaker (i.e. a single bit is selected in the |
Jean-Michel Trivi | 046dddf | 2014-07-14 15:55:50 -0700 | [diff] [blame] | 46 | // channel mask) followed by the azimuth and the |
| 47 | // elevation angles. |
Jean-Michel Trivi | 4f57d02 | 2014-07-09 09:14:46 -0700 | [diff] [blame] | 48 | // status int -EINVAL if configuration is not supported or invalid or not forcing |
| 49 | // 0 if configuration is supported and the mode is forced |
Jean-Michel Trivi | 046dddf | 2014-07-14 15:55:50 -0700 | [diff] [blame] | 50 | // notes: |
| 51 | // - all angles are expressed in degrees and are relative to the listener, |
| 52 | // - for azimuth: 0 is the direction the listener faces, 180 is behind the listener, and |
| 53 | // -90 is to her/his left, |
| 54 | // - for elevation: 0 is the horizontal plane, +90 is above the listener, -90 is below. |
Jean-Michel Trivi | 4f57d02 | 2014-07-09 09:14:46 -0700 | [diff] [blame] | 55 | VIRTUALIZER_PARAM_VIRTUAL_SPEAKER_ANGLES, |
| 56 | // used with EFFECT_CMD_SET_PARAM |
| 57 | // format: |
| 58 | // parameters int32_t VIRTUALIZER_PARAM_FORCE_VIRTUALIZATION_MODE |
| 59 | // audio_devices_t audio output device |
| 60 | // status int -EINVAL if the device is not supported or invalid |
| 61 | // 0 if the device is supported and the mode is forced, or forcing |
| 62 | // was disabled for the AUDIO_DEVICE_NONE audio device. |
Jean-Michel Trivi | 2044f5c | 2014-07-14 17:19:22 -0700 | [diff] [blame] | 63 | VIRTUALIZER_PARAM_FORCE_VIRTUALIZATION_MODE, |
| 64 | // used with EFFECT_CMD_GET_PARAM |
| 65 | // format: |
| 66 | // parameters int32_t VIRTUALIZER_PARAM_VIRTUALIZATION_MODE |
| 67 | // output audio_device_t audio device reflecting the current virtualization mode, |
| 68 | // AUDIO_DEVICE_NONE when not virtualizing |
| 69 | // status int -EINVAL if an error occurred |
| 70 | // 0 if the output value is successfully retrieved |
| 71 | VIRTUALIZER_PARAM_VIRTUALIZATION_MODE |
Eric Laurent | 9630925 | 2011-06-17 09:02:12 -0700 | [diff] [blame] | 72 | } t_virtualizer_params; |
| 73 | |
| 74 | #if __cplusplus |
| 75 | } // extern "C" |
| 76 | #endif |
| 77 | |
| 78 | |
| 79 | #endif /*ANDROID_EFFECT_VIRTUALIZER_H_*/ |