/* * Copyright (C) 2015 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include "AudioPolicyConfig.h" #include "DeviceDescriptor.h" #include "HwModule.h" #include "audio_policy_conf.h" #include #include #include #include #include #include #include namespace android { // ---------------------------------------------------------------------------- // Definitions for audio_policy.conf file parsing // ---------------------------------------------------------------------------- class ConfigParsingUtils { public: static status_t loadConfig(const char *path, AudioPolicyConfig &config); private: static void loadAudioPortGain(cnode *root, AudioPort &audioPort, int index); static void loadAudioPortGains(cnode *root, AudioPort &audioPort); static void loadDeviceDescriptorGains(cnode *root, sp &deviceDesc); static status_t loadHwModuleDevice(cnode *root, DeviceVector &devices); static status_t loadHwModuleProfile(cnode *root, sp &module, audio_port_role_t role); static void loadDevicesFromTag(const char *tag, DeviceVector &devices, const DeviceVector &declaredDevices); static void loadHwModules(cnode *root, HwModuleCollection &hwModules, AudioPolicyConfig &config); static void loadGlobalConfig(cnode *root, AudioPolicyConfig &config, const sp &primaryModule); static void loadModuleGlobalConfig(cnode *root, const sp &module, AudioPolicyConfig &config); static status_t loadHwModule(cnode *root, sp &module, AudioPolicyConfig &config); }; }; // namespace android