[Multimedia] Modified a constructor of the Display class not to check the raw video...
[platform/core/csapi/tizenfx.git] / src / Tizen.Multimedia / AudioManager / AudioManagerEnums.cs
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 using System;
18
19 namespace Tizen.Multimedia
20 {
21     /// <summary>
22     /// Specifies the flags for the audio device options.
23     /// <para>
24     /// This enumeration has a <see cref="FlagsAttribute"/> attribute that allows a bitwise combination of its member values.
25     /// </para>
26     /// </summary>
27     [Flags]
28     internal enum AudioDeviceOptions
29     {
30         /// <summary>
31         /// Input devices.
32         /// </summary>
33         Input = 0x0001,
34         /// <summary>
35         /// Output devices.
36         /// </summary>
37         Output = 0x0002,
38         /// <summary>
39         /// Input and output devices (both directions are available).
40         /// </summary>
41         InputAndOutput = 0x0004,
42         /// <summary>
43         /// Built-in devices.
44         /// </summary>
45         Internal = 0x00010,
46         /// <summary>
47         /// External devices.
48         /// </summary>
49         External = 0x0020,
50         /// <summary>
51         /// Deactivated devices.
52         /// </summary>
53         Deactivated = 0x1000,
54         /// <summary>
55         /// Activated devices.
56         /// </summary>
57         Activated = 0x2000,
58
59         /// <summary>
60         /// All devices.
61         /// </summary>
62         All = 0xFFFF
63     }
64
65     /// <summary>
66     /// Specifies the audio device types.
67     /// </summary>
68     /// <since_tizen> 3 </since_tizen>
69     public enum AudioDeviceType
70     {
71         /// <summary>
72         /// Built-in speaker.
73         /// </summary>
74         BuiltinSpeaker,
75         /// <summary>
76         /// Built-in receiver.
77         /// </summary>
78         BuiltinReceiver,
79         /// <summary>
80         /// Built-in microphone.
81         /// </summary>
82         BuiltinMic,
83         /// <summary>
84         /// Audio jack that can be connected to wired accessories such as headphones and headsets.
85         /// </summary>
86         AudioJack,
87         /// <summary>
88         /// Bluetooth media (A2DP).
89         /// </summary>
90         BluetoothMedia,
91         /// <summary>
92         /// HDMI.
93         /// </summary>
94         Hdmi,
95         /// <summary>
96         /// Device for forwarding.
97         /// </summary>
98         Forwarding,
99         /// <summary>
100         /// USB audio.
101         /// </summary>
102         UsbAudio,
103         /// <summary>
104         /// Bluetooth voice (SCO).
105         /// </summary>
106         BluetoothVoice
107     }
108
109     /// <summary>
110     /// Specifies the audio device directions.
111     /// </summary>
112     /// <since_tizen> 3 </since_tizen>
113     public enum AudioDeviceIoDirection
114     {
115         /// <summary>
116         /// Input device.
117         /// </summary>
118         Input,
119         /// <summary>
120         /// Output device.
121         /// </summary>
122         Output,
123         /// <summary>
124         /// Input/output device (both directions are available).
125         /// </summary>
126         InputAndOutput
127     }
128
129     /// <summary>
130     /// Specifies the audio device states.
131     /// </summary>
132     /// <since_tizen> 3 </since_tizen>
133     public enum AudioDeviceState
134     {
135         /// <summary>
136         /// Deactivated state.
137         /// </summary>
138         Deactivated,
139         /// <summary>
140         /// Activated state.
141         /// </summary>
142         Activated
143     }
144
145     /// <summary>
146     /// Specifies the audio volume types.
147     /// </summary>
148     /// <since_tizen> 3 </since_tizen>
149     public enum AudioVolumeType
150     {
151         /// <summary>
152         /// System.
153         /// </summary>
154         System,
155         /// <summary>
156         /// Notification.
157         /// </summary>
158         Notification,
159         /// <summary>
160         /// Alarm.
161         /// </summary>
162         Alarm,
163         /// <summary>
164         /// Ringtone.
165         /// </summary>
166         Ringtone,
167         /// <summary>
168         /// Media.
169         /// </summary>
170         Media,
171         /// <summary>
172         /// Call.
173         /// </summary>
174         Call,
175         /// <summary>
176         /// VoIP.
177         /// </summary>
178         Voip,
179         /// <summary>
180         /// Voice.
181         /// </summary>
182         Voice,
183         /// <summary>
184         /// No volume exists.
185         /// </summary>
186         /// <seealso cref="AudioStreamPolicy.VolumeType"/>
187         None
188     }
189
190     /// <summary>
191     /// Specifies the audio stream types.
192     /// </summary>
193     /// <since_tizen> 3 </since_tizen>
194     public enum AudioStreamType
195     {
196         /// <summary>
197         /// Media.
198         /// </summary>
199         Media,
200         /// <summary>
201         /// System.
202         /// </summary>
203         System,
204         /// <summary>
205         /// Alarm.
206         /// </summary>
207         Alarm,
208         /// <summary>
209         /// Notification.
210         /// </summary>
211         Notification,
212         /// <summary>
213         /// Emergency.
214         /// </summary>
215         Emergency,
216         /// <summary>
217         /// Voice information.
218         /// </summary>
219         VoiceInformation,
220         /// <summary>
221         /// Voice recognition.
222         /// </summary>
223         VoiceRecognition,
224         /// <summary>
225         /// Ringtone for VoIP.
226         /// </summary>
227         RingtoneVoip,
228         /// <summary>
229         /// VoIP.
230         /// </summary>
231         Voip,
232         /// <summary>
233         /// Media only for external devices.
234         /// </summary>
235         MediaExternalOnly
236     }
237
238     /// <summary>
239     /// Specifies the change reasons of the audio stream focus state.
240     /// </summary>
241     /// <since_tizen> 3 </since_tizen>
242     public enum AudioStreamFocusChangedReason
243     {
244         /// <summary>
245         /// Media.
246         /// </summary>
247         Media,
248         /// <summary>
249         /// System.
250         /// </summary>
251         System,
252         /// <summary>
253         /// Alarm.
254         /// </summary>
255         Alarm,
256         /// <summary>
257         /// Notification.
258         /// </summary>
259         Notification,
260         /// <summary>
261         /// Emergency.
262         /// </summary>
263         Emergency,
264         /// <summary>
265         /// Voice information.
266         /// </summary>
267         VoiceInformation,
268         /// <summary>
269         /// Voice recognition.
270         /// </summary>
271         VoiceRecognition,
272         /// <summary>
273         /// Ringtone.
274         /// </summary>
275         RingtoneVoip,
276         /// <summary>
277         /// VoIP.
278         /// </summary>
279         Voip,
280         /// <summary>
281         /// Voice-call or video-call.
282         /// </summary>
283         Call,
284         /// <summary>
285         /// Media only for external devices.
286         /// </summary>
287         MediaExternalOnly
288     }
289
290     /// <summary>
291     /// Specifies the flags for the audio stream focus options.
292     /// <para>
293     /// This enumeration has a <see cref="FlagsAttribute"/> attribute that allows a bitwise combination of its member values.
294     /// </para>
295     /// </summary>
296     /// <since_tizen> 3 </since_tizen>
297     [Flags]
298     public enum AudioStreamFocusOptions
299     {
300         /// <summary>
301         /// Playback focus.
302         /// </summary>
303         Playback = 0x0001,
304         /// <summary>
305         /// Recording focus.
306         /// </summary>
307         Recording = 0x0002
308     }
309
310     /// <summary>
311     /// Specifies the audio stream focus states.
312     /// </summary>
313     /// <since_tizen> 3 </since_tizen>
314     public enum AudioStreamFocusState
315     {
316         /// <summary>
317         /// Focus state for release.
318         /// </summary>
319         Released,
320         /// <summary>
321         /// Focus state for acquisition.
322         /// </summary>
323         Acquired
324     }
325
326     /// <summary>
327     /// Specifies the flags for the audio stream behaviors.
328     /// <para>
329     /// This enumeration has a <see cref="FlagsAttribute"/> attribute that allows a bitwise combination of its member values.
330     /// </para>
331     /// </summary>
332     /// <since_tizen> 4 </since_tizen>
333     [Flags]
334     public enum AudioStreamBehaviors
335     {
336         /// <summary>
337         /// No Resume.
338         /// </summary>
339         NoResume = 0x0001,
340         /// <summary>
341         /// Fading.
342         /// </summary>
343         Fading = 0x0002
344     }
345
346
347     internal static class AudioManagerEnumExtensions
348     {
349         internal static bool IsValid(this AudioStreamFocusOptions value)
350         {
351             int mask = (int)(AudioStreamFocusOptions.Playback | AudioStreamFocusOptions.Recording);
352
353             return (mask & (int)value) != 0;
354         }
355
356         internal static bool IsValid(this AudioStreamBehaviors value)
357         {
358             int mask = (int)(AudioStreamBehaviors.NoResume | AudioStreamBehaviors.Fading);
359
360             return ((~mask) & (int)value) == 0;
361         }
362     }
363
364 }