|
ALSA project - the C library reference
|
00001 00010 /* 00011 * 00012 * This library is free software; you can redistribute it and/or modify 00013 * it under the terms of the GNU Lesser General Public License as 00014 * published by the Free Software Foundation; either version 2.1 of 00015 * the License, or (at your option) any later version. 00016 * 00017 * This program is distributed in the hope that it will be useful, 00018 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00020 * GNU Lesser General Public License for more details. 00021 * 00022 * You should have received a copy of the GNU Lesser General Public 00023 * License along with this library; if not, write to the Free Software 00024 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00025 * 00026 * Copyright (C) 2008-2010 SlimLogic Ltd 00027 * Copyright (C) 2010 Wolfson Microelectronics PLC 00028 * Copyright (C) 2010 Texas Instruments Inc. 00029 * 00030 * Support for the verb/device/modifier core logic and API, 00031 * command line tool and file parser was kindly sponsored by 00032 * Texas Instruments Inc. 00033 * Support for multiple active modifiers and devices, 00034 * transition sequences, multiple client access and user defined use 00035 * cases was kindly sponsored by Wolfson Microelectronics PLC. 00036 */ 00037 00038 #ifndef __ALSA_USE_CASE_H 00039 #define __ALSA_USE_CASE_H 00040 00041 #ifdef __cplusplus 00042 extern "C" { 00043 #endif 00044 00092 /* 00093 * Use Case Verb. 00094 * 00095 * The use case verb is the main device audio action. e.g. the "HiFi" use 00096 * case verb will configure the audio hardware for HiFi Music playback 00097 * and capture. 00098 */ 00099 #define SND_USE_CASE_VERB_INACTIVE "Inactive" 00100 #define SND_USE_CASE_VERB_HIFI "HiFi" 00101 #define SND_USE_CASE_VERB_HIFI_LOW_POWER "HiFi Low Power" 00102 #define SND_USE_CASE_VERB_VOICE "Voice" 00103 #define SND_USE_CASE_VERB_VOICE_LOW_POWER "Voice Low Power" 00104 #define SND_USE_CASE_VERB_VOICECALL "Voice Call" 00105 #define SND_USE_CASE_VERB_IP_VOICECALL "Voice Call IP" 00106 #define SND_USE_CASE_VERB_ANALOG_RADIO "FM Analog Radio" 00107 #define SND_USE_CASE_VERB_DIGITAL_RADIO "FM Digital Radio" 00108 /* add new verbs to end of list */ 00109 00110 00111 /* 00112 * Use Case Device. 00113 * 00114 * Physical system devices the render and capture audio. Devices can be OR'ed 00115 * together to support audio on simultaneous devices. 00116 */ 00117 #define SND_USE_CASE_DEV_NONE "None" 00118 #define SND_USE_CASE_DEV_SPEAKER "Speaker" 00119 #define SND_USE_CASE_DEV_LINE "Line" 00120 #define SND_USE_CASE_DEV_HEADPHONES "Headphones" 00121 #define SND_USE_CASE_DEV_HEADSET "Headset" 00122 #define SND_USE_CASE_DEV_HANDSET "Handset" 00123 #define SND_USE_CASE_DEV_BLUETOOTH "Bluetooth" 00124 #define SND_USE_CASE_DEV_EARPIECE "Earpiece" 00125 #define SND_USE_CASE_DEV_SPDIF "SPDIF" 00126 #define SND_USE_CASE_DEV_HDMI "HDMI" 00127 /* add new devices to end of list */ 00128 00129 00130 /* 00131 * Use Case Modifiers. 00132 * 00133 * The use case modifier allows runtime configuration changes to deal with 00134 * asynchronous events. 00135 * 00136 * e.g. to record a voice call :- 00137 * 1. Set verb to SND_USE_CASE_VERB_VOICECALL (for voice call) 00138 * 2. Set modifier SND_USE_CASE_MOD_CAPTURE_VOICE when capture required. 00139 * 3. Call snd_use_case_get("CapturePCM") to get ALSA source PCM name 00140 * with captured voice pcm data. 00141 * 00142 * e.g. to play a ring tone when listenin to MP3 Music :- 00143 * 1. Set verb to SND_USE_CASE_VERB_HIFI (for MP3 playback) 00144 * 2. Set modifier to SND_USE_CASE_MOD_PLAY_TONE when incoming call happens. 00145 * 3. Call snd_use_case_get("PlaybackPCM") to get ALSA PCM sink name for 00146 * ringtone pcm data. 00147 */ 00148 #define SND_USE_CASE_MOD_CAPTURE_VOICE "Capture Voice" 00149 #define SND_USE_CASE_MOD_CAPTURE_MUSIC "Capture Music" 00150 #define SND_USE_CASE_MOD_PLAY_MUSIC "Play Music" 00151 #define SND_USE_CASE_MOD_PLAY_VOICE "Play Voice" 00152 #define SND_USE_CASE_MOD_PLAY_TONE "Play Tone" 00153 #define SND_USE_CASE_MOD_ECHO_REF "Echo Reference" 00154 /* add new modifiers to end of list */ 00155 00156 00165 #define SND_USE_CASE_TQ_MUSIC "Music" 00166 #define SND_USE_CASE_TQ_VOICE "Voice" 00167 #define SND_USE_CASE_TQ_TONES "Tones" 00168 00170 typedef struct snd_use_case_mgr snd_use_case_mgr_t; 00171 00178 char *snd_use_case_identifier(const char *fmt, ...); 00179 00186 int snd_use_case_free_list(const char *list[], int items); 00187 00209 int snd_use_case_get_list(snd_use_case_mgr_t *uc_mgr, 00210 const char *identifier, 00211 const char **list[]); 00212 00213 00249 int snd_use_case_get(snd_use_case_mgr_t *uc_mgr, 00250 const char *identifier, 00251 const char **value); 00252 00264 int snd_use_case_geti(snd_use_case_mgr_t *uc_mgr, 00265 const char *identifier, 00266 long *value); 00267 00290 int snd_use_case_set(snd_use_case_mgr_t *uc_mgr, 00291 const char *identifier, 00292 const char *value); 00293 00300 int snd_use_case_mgr_open(snd_use_case_mgr_t **uc_mgr, const char *card_name); 00301 00302 00308 int snd_use_case_mgr_reload(snd_use_case_mgr_t *uc_mgr); 00309 00315 int snd_use_case_mgr_close(snd_use_case_mgr_t *uc_mgr); 00316 00322 int snd_use_case_mgr_reset(snd_use_case_mgr_t *uc_mgr); 00323 00324 /* 00325 * helper functions 00326 */ 00327 00333 static inline int snd_use_case_card_list(const char **list[]) 00334 { 00335 return snd_use_case_get_list(NULL, NULL, list); 00336 } 00337 00344 static inline int snd_use_case_verb_list(snd_use_case_mgr_t *uc_mgr, 00345 const char **list[]) 00346 { 00347 return snd_use_case_get_list(uc_mgr, "_verbs", list); 00348 } 00349 00354 #ifdef __cplusplus 00355 } 00356 #endif 00357 00358 #endif /* __ALSA_USE_CASE_H */
1.7.5.1