/*
* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using System;
namespace Tizen.Multimedia
{
///
/// Specifies the flags for the audio device options.
///
/// This enumeration has a attribute that allows a bitwise combination of its member values.
///
///
[Flags]
internal enum AudioDeviceOptions
{
///
/// Input devices.
///
Input = 0x0001,
///
/// Output devices.
///
Output = 0x0002,
///
/// Input and output devices (both directions are available).
///
InputAndOutput = 0x0004,
///
/// Built-in devices.
///
Internal = 0x00010,
///
/// External devices.
///
External = 0x0020,
///
/// Deactivated devices.
///
Deactivated = 0x1000,
///
/// Activated devices.
///
Activated = 0x2000,
///
/// All devices.
///
All = 0xFFFF
}
///
/// Specifies the audio device types.
///
public enum AudioDeviceType
{
///
/// Built-in speaker.
///
BuiltinSpeaker,
///
/// Built-in receiver.
///
BuiltinReceiver,
///
/// Built-in microphone.
///
BuiltinMic,
///
/// Audio jack that can be connected to wired accessories such as headphones and headsets.
///
AudioJack,
///
/// Bluetooth media (A2DP).
///
BluetoothMedia,
///
/// HDMI.
///
Hdmi,
///
/// Device for forwarding.
///
Forwarding,
///
/// USB audio.
///
UsbAudio,
///
/// Bluetooth voice (SCO).
///
BluetoothVoice
}
///
/// Specifies the audio device directions.
///
public enum AudioDeviceIoDirection
{
///
/// Input device.
///
Input,
///
/// Output device.
///
Output,
///
/// Input/output device (both directions are available).
///
InputAndOutput
}
///
/// Specifies the audio device states.
///
public enum AudioDeviceState
{
///
/// Deactivated state.
///
Deactivated,
///
/// Activated state.
///
Activated
}
///
/// Specifies the audio volume types.
///
public enum AudioVolumeType
{
///
/// System.
///
System,
///
/// Notification.
///
Notification,
///
/// Alarm.
///
Alarm,
///
/// Ringtone.
///
Ringtone,
///
/// Media.
///
Media,
///
/// Call.
///
Call,
///
/// VoIP.
///
Voip,
///
/// Voice.
///
Voice,
///
/// No volume exists.
///
///
None
}
///
/// Specifies the audio stream types.
///
public enum AudioStreamType
{
///
/// Media.
///
Media,
///
/// System.
///
System,
///
/// Alarm.
///
Alarm,
///
/// Notification.
///
Notification,
///
/// Emergency.
///
Emergency,
///
/// Voice information.
///
VoiceInformation,
///
/// Voice recognition.
///
VoiceRecognition,
///
/// Ringtone for VoIP.
///
RingtoneVoip,
///
/// VoIP.
///
Voip,
///
/// Media only for external devices.
///
MediaExternalOnly
}
///
/// Specifies the change reasons of the audio stream focus state.
///
public enum AudioStreamFocusChangedReason
{
///
/// Media.
///
Media,
///
/// System.
///
System,
///
/// Alarm.
///
Alarm,
///
/// Notification.
///
Notification,
///
/// Emergency.
///
Emergency,
///
/// Voice information.
///
VoiceInformation,
///
/// Voice recognition.
///
VoiceRecognition,
///
/// Ringtone.
///
RingtoneVoip,
///
/// VoIP.
///
Voip,
///
/// Voice-call or video-call.
///
Call,
///
/// Media only for external devices.
///
MediaExternalOnly
}
///
/// Specifies the flags for the audio stream focus options.
///
/// This enumeration has a attribute that allows a bitwise combination of its member values.
///
///
[Flags]
public enum AudioStreamFocusOptions
{
///
/// Playback focus.
///
Playback = 0x0001,
///
/// Recording focus.
///
Recording = 0x0002
}
///
/// Specifies the audio stream focus states.
///
public enum AudioStreamFocusState
{
///
/// Focus state for release.
///
Released,
///
/// Focus state for acquisition.
///
Acquired
}
///
/// Specifies the flags for the audio stream behaviors.
///
/// This enumeration has a attribute that allows a bitwise combination of its member values.
///
///
[Flags]
public enum AudioStreamBehaviors
{
///
/// No Resume.
///
NoResume = 0x0001,
///
/// Fading.
///
Fading = 0x0002
}
internal static class AudioManagerEnumExtensions
{
internal static bool IsValid(this AudioStreamFocusOptions value)
{
int mask = (int)(AudioStreamFocusOptions.Playback | AudioStreamFocusOptions.Recording);
return (mask & (int)value) != 0;
}
internal static bool IsValid(this AudioStreamBehaviors value)
{
int mask = (int)(AudioStreamBehaviors.NoResume | AudioStreamBehaviors.Fading);
return ((~mask) & (int)value) == 0;
}
}
}