Cleanup
[framework/multimedia/alsa-scenario-0.2.git] / include / ascenario.h
1 /*
2 *  ALSA Scenario header file
3 *
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.
8 *
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.
13 *
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
17 *
18 *  Copyright (C) 2008-2009 SlimLogic Ltd
19 *  Authors: Liam Girdwood <lrg@slimlogic.co.uk>
20 *           Stefan Schmidt <stefan@slimlogic.co.uk>
21 */
22
23 #ifndef __ASCENARIO_H
24 #define __ASCENARIO_H
25
26 #define EXPORT_API __attribute__((__visibility__("default")))
27
28 /**
29  * Scenario IDs
30  *
31  * Standard Scenario IDs - Add new scenarios at the end.
32  */
33
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"
41
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"
48
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"
55
56 /**
57  * QOS
58  *
59  * Defines Audio Quality of Service. Systems supporting different types of QoS
60  * often have lower power consumption on lower quality levels.
61  */
62 #define SND_POWER_QOS_HIFI                      0
63 #define SND_POWER_QOS_VOICE                     1
64 #define SND_POWER_QOS_SYSTEM                    2
65
66 #define SND_SCN_ON                                      0
67 #define SND_SCN_OFF                                     1
68 #define SND_SCN_RESET                           2
69
70 #define SND_SCN_GROUP_MAX                       3
71 #define SND_SCN_GROUP_NUM                       32
72
73 struct snd_scenario;
74
75 /* TODO: add notification */
76
77 /**
78  * \brief List supported scenarios
79  * \param scn Scenario
80  * \param list List of supported scenario names.
81  * \return Number of scenarios.
82  *
83  * List supported scenarios for this sound card.
84  */
85 int snd_scenario_list(struct snd_scenario *scn, const char **list[]);
86
87 /**
88  * \brief Set scenario
89  * \param scn Scenario
90  * \param scenario Scenario name
91  * \return Error code 
92  *
93  * Set new scenario for sound card.
94  */
95 int snd_scenario_set_scn(struct snd_scenario *scn, const char *scenario);
96
97 /**
98  * \brief Set scenario
99  * \param scn Scenario
100  * \param scenario Scenario name
101  * \return Error code 
102  *
103  * Un-set new scenario for sound card.
104  */
105
106 int snd_scenario_unset_scn(struct snd_scenario *scn, const char *scenario);
107
108 /**
109  * \brief Get scenario
110  * \param scn Scenario
111  * \return Scenario name
112  *
113  * Get current sound card scenario.
114  */
115 const char *snd_scenario_get_scn(struct snd_scenario *scn);
116
117 /**
118  * \brief Get playback volume
119  * \param scn Scenario
120  * \return Numerical control ID
121  *
122  * Get the master playback volume control name for the current scenario.
123  */
124 int snd_scenario_get_master_playback_volume(struct snd_scenario *scn);
125
126 /**
127  * \brief Get playback switch
128  * \param scn Scenario
129  * \return Numerical control ID
130  *
131  * Get the master playback switch control name for the current scenario.
132  */
133  int snd_scenario_get_master_playback_switch(struct snd_scenario *scn);
134
135 /**
136  * \brief Get capture volume
137  * \param scn Scenario
138  * \return Numerical control ID
139  *
140  * Get the master capture volume control name for the current scenario.
141  */
142 int snd_scenario_get_master_capture_volume(struct snd_scenario *scn);
143
144 /**
145  * \brief Get capture switch
146  * \parm scn Scenario
147  * \return Numerical control ID
148  *
149  * Get the master capture switch control name for the current scenario.
150  */
151 int snd_scenario_get_master_capture_switch(struct snd_scenario *scn);
152
153 /**
154  * \brief Set qos
155  * \param qos QoS
156  * \return Error code
157  *
158  * Set Quality of Service for this scenario.
159  */
160 int snd_scenario_set_qos(struct snd_scenario *scn, int qos);
161
162 /**
163  * \brief Get qos
164  * \param scn Scenario
165  * \return QoS enum
166  *
167  * Get Quality of Service for this scenario.
168  */
169 int snd_scenario_get_qos(struct snd_scenario *scn);
170
171 /**
172  * \brief Open scenario core
173  * \param card_name Sound card name.
174  * \return Sound scenario struct
175  *
176  * Open scenario manager core for sound card.
177  */
178 struct snd_scenario *snd_scenario_open(const char *card_name);
179
180 /**
181  * \brief Reload and reparse scenario configuration
182  * \param scn Scenario
183  * \return Error code
184  *
185  * Reloads and reparses sound card scenario configuration.
186  */
187 int snd_scenario_reload(struct snd_scenario *scn);
188
189 /**
190  * \brief Close scenario core
191  * \param scn Scenario
192  *
193  * Free scenario manager core for sound card.
194  */
195 void snd_scenario_close(struct snd_scenario *scn);
196
197 /**
198  * \brief Dump settings
199  * \param card_name Sound card name.
200  * \return Error code
201  *
202  * Dump current sound card settings to stdout in scn format.
203  */
204 int snd_scenario_dump(const char *card_name);
205
206 #endif /* __ASCENARIO_H */