2 * ALSA Scenario header file
4 * This library is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as
6 * published by the Free Software Foundation; either version 2.1 of
7 * the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 * Copyright (C) 2008-2009 SlimLogic Ltd
19 * Authors: Liam Girdwood <lrg@slimlogic.co.uk>
20 * Stefan Schmidt <stefan@slimlogic.co.uk>
26 #define EXPORT_API __attribute__((__visibility__("default")))
31 * Standard Scenario IDs - Add new scenarios at the end.
34 #define SND_SCN_PLAYBACK_SPEAKER "playback speaker"
35 #define SND_SCN_PLAYBACK_HEADPHONES "playback headphone"
36 #define SND_SCN_PLAYBACK_HEADSET "playback headset"
37 #define SND_SCN_PLAYBACK_BLUETOOTH "playback bluetooth"
38 #define SND_SCN_PLAYBACK_HANDSET "playback handset"
39 #define SND_SCN_PLAYBACK_GSM "playback gsm"
40 #define SND_SCN_PLAYBACK_LINE "playback line"
42 #define SND_SCN_CAPTURE_MIC "capture mic"
43 #define SND_SCN_CAPTURE_LINE "capture line"
44 #define SND_SCN_CAPTURE_HEADSET "capture headset"
45 #define SND_SCN_CAPTURE_HANDSET "capture handset"
46 #define SND_SCN_CAPTURE_BLUETOOTH "capture bluetooth"
47 #define SND_SCN_CAPTURE_GSM "capture gsm"
49 #define SND_SCN_PHONECALL_GSM_HANDSET "phonecall gsm handset"
50 #define SND_SCN_PHONECALL_BT_HANDSET "phonecall bt handset"
51 #define SND_SCN_PHONECALL_IP_HANDSET "phonecall ip handset"
52 #define SND_SCN_PHONECALL_GSM_HEADSET "phonecall gsm headset"
53 #define SND_SCN_PHONECALL_BT_HEADSET "phonecall bt headset"
54 #define SND_SCN_PHONECALL_IP_HEADSET "phonecall ip headset"
59 * Defines Audio Quality of Service. Systems supporting different types of QoS
60 * often have lower power consumption on lower quality levels.
62 #define SND_POWER_QOS_HIFI 0
63 #define SND_POWER_QOS_VOICE 1
64 #define SND_POWER_QOS_SYSTEM 2
68 #define SND_SCN_RESET 2
70 #define SND_SCN_GROUP_MAX 3
71 #define SND_SCN_GROUP_NUM 32
75 /* TODO: add notification */
78 * \brief List supported scenarios
80 * \param list List of supported scenario names.
81 * \return Number of scenarios.
83 * List supported scenarios for this sound card.
85 int snd_scenario_list(struct snd_scenario *scn, const char **list[]);
90 * \param scenario Scenario name
93 * Set new scenario for sound card.
95 int snd_scenario_set_scn(struct snd_scenario *scn, const char *scenario);
100 * \param scenario Scenario name
103 * Un-set new scenario for sound card.
106 int snd_scenario_unset_scn(struct snd_scenario *scn, const char *scenario);
109 * \brief Get scenario
110 * \param scn Scenario
111 * \return Scenario name
113 * Get current sound card scenario.
115 const char *snd_scenario_get_scn(struct snd_scenario *scn);
118 * \brief Get playback volume
119 * \param scn Scenario
120 * \return Numerical control ID
122 * Get the master playback volume control name for the current scenario.
124 int snd_scenario_get_master_playback_volume(struct snd_scenario *scn);
127 * \brief Get playback switch
128 * \param scn Scenario
129 * \return Numerical control ID
131 * Get the master playback switch control name for the current scenario.
133 int snd_scenario_get_master_playback_switch(struct snd_scenario *scn);
136 * \brief Get capture volume
137 * \param scn Scenario
138 * \return Numerical control ID
140 * Get the master capture volume control name for the current scenario.
142 int snd_scenario_get_master_capture_volume(struct snd_scenario *scn);
145 * \brief Get capture switch
147 * \return Numerical control ID
149 * Get the master capture switch control name for the current scenario.
151 int snd_scenario_get_master_capture_switch(struct snd_scenario *scn);
158 * Set Quality of Service for this scenario.
160 int snd_scenario_set_qos(struct snd_scenario *scn, int qos);
164 * \param scn Scenario
167 * Get Quality of Service for this scenario.
169 int snd_scenario_get_qos(struct snd_scenario *scn);
172 * \brief Open scenario core
173 * \param card_name Sound card name.
174 * \return Sound scenario struct
176 * Open scenario manager core for sound card.
178 struct snd_scenario *snd_scenario_open(const char *card_name);
181 * \brief Reload and reparse scenario configuration
182 * \param scn Scenario
185 * Reloads and reparses sound card scenario configuration.
187 int snd_scenario_reload(struct snd_scenario *scn);
190 * \brief Close scenario core
191 * \param scn Scenario
193 * Free scenario manager core for sound card.
195 void snd_scenario_close(struct snd_scenario *scn);
198 * \brief Dump settings
199 * \param card_name Sound card name.
202 * Dump current sound card settings to stdout in scn format.
204 int snd_scenario_dump(const char *card_name);
206 #endif /* __ASCENARIO_H */