1 /* Copyright (c) 2012 The Chromium OS Authors. All rights reserved. 2 * Use of this source code is governed by a BSD-style license that can be 3 * found in the LICENSE file. 4 */ 5 6 #ifndef CRAS_CARD_CONFIG_H_ 7 #define CRAS_CARD_CONFIG_H_ 8 9 struct cras_card_config; 10 struct cras_volume_curve; 11 12 /* Creates a configuration based on the config file specified. 13 * Args: 14 * config_path - Path containing the config files. 15 * card_name - Name of the card to load a configuration for. 16 * Returns: 17 * A pointer to the created config on success, NULL on failure. 18 */ 19 struct cras_card_config *cras_card_config_create(const char *config_path, 20 const char *card_name); 21 22 /* Destroys a configuration returned by cras_card_config_create(). 23 * Args: 24 * card_config - Card configuration returned by cras_card_config_create() 25 */ 26 void cras_card_config_destroy(struct cras_card_config *card_config); 27 28 /* Returns the apporpriate volume curve to use for the control given by name. 29 * Args: 30 * card_config - Card configuration returned by cras_card_config_create() 31 * Returns: 32 * The specialized curve for the control if there is one, otherwise NULL. 33 */ 34 struct cras_volume_curve *cras_card_config_get_volume_curve_for_control( 35 const struct cras_card_config *card_config, 36 const char *control_name); 37 38 #endif /* CRAS_CARD_CONFIG_H_ */ 39