using MediaBrowser.Model.Dto;
using System.Collections.Generic;
namespace MediaBrowser.Model.Dlna
{
    /// 
    /// Class AudioOptions.
    /// 
    public class AudioOptions
    {
        public AudioOptions()
        {
            Context = EncodingContext.Streaming;
        }
        public string ItemId { get; set; }
        public List MediaSources { get; set; }
        public DeviceProfile Profile { get; set; }
        /// 
        /// Optional. Only needed if a specific AudioStreamIndex or SubtitleStreamIndex are requested.
        /// 
        public string MediaSourceId { get; set; }
        public string DeviceId { get; set; }
        /// 
        /// Allows an override of supported number of audio channels
        /// Example: DeviceProfile supports five channel, but user only has stereo speakers
        /// 
        public int? MaxAudioChannels { get; set; }
        /// 
        /// The application's configured quality setting
        /// 
        public int? MaxBitrate { get; set; }
        /// 
        /// Gets or sets the context.
        /// 
        /// The context.
        public EncodingContext Context { get; set; }
        /// 
        /// Gets or sets the audio transcoding bitrate.
        /// 
        /// The audio transcoding bitrate.
        public int? AudioTranscodingBitrate { get; set; }
        
        /// 
        /// Gets the maximum bitrate.
        /// 
        /// System.Nullable<System.Int32>.
        public int? GetMaxBitrate()
        {
            if (MaxBitrate.HasValue)
            {
                return MaxBitrate;
            }
            if (Profile != null)
            {
                if (Context == EncodingContext.Static)
                {
                    return Profile.MaxStaticBitrate;
                }
                return Profile.MaxStreamingBitrate;
            }
            return null;
        }
    }
}