public static StreamingQuality ToStreamingQuality(this StreamingResolution resolution, StreamingLMH lmh)
        {
            var quality = string.Format("{0}{1}", resolution, lmh);
            if (resolution == StreamingResolution.ThreeSixty)
            {
                return StreamingQuality.ThreeSixty;
            }

            return (StreamingQuality) Enum.Parse(typeof (StreamingQuality), quality, true);
        }
 public static void BreakDown(this StreamingQuality quality, out StreamingResolution resolution, out StreamingLMH lmh)
 {
     switch (quality)
     {
         case StreamingQuality.ThreeSixty:
             lmh = StreamingLMH.Low;
             resolution = StreamingResolution.ThreeSixty;
             break;
         case StreamingQuality.FourEightyLow:
             lmh = StreamingLMH.Low;
             resolution = StreamingResolution.FourEighty;
             break;
         case StreamingQuality.FourEightyMedium:
             lmh = StreamingLMH.Medium;
             resolution = StreamingResolution.FourEighty;
             break;
         case StreamingQuality.FourEightyHigh:
             lmh = StreamingLMH.High;
             resolution = StreamingResolution.FourEighty;
             break;
         case StreamingQuality.SevenTwentyLow:
             lmh = StreamingLMH.Low;
             resolution = StreamingResolution.SevenTwenty;
             break;
         case StreamingQuality.SevenTwentyMedium:
             lmh = StreamingLMH.Medium;
             resolution = StreamingResolution.SevenTwenty;
             break;
         case StreamingQuality.SevenTwentyHigh:
             lmh = StreamingLMH.High;
             resolution = StreamingResolution.SevenTwenty;
             break;
         case StreamingQuality.TenEightyLow:
             lmh = StreamingLMH.Low;
             resolution = StreamingResolution.TenEighty;
             break;
         case StreamingQuality.TenEightyMedium:
             lmh = StreamingLMH.Medium;
             resolution = StreamingResolution.TenEighty;
             break;
         case StreamingQuality.TenEightyHigh:
             lmh = StreamingLMH.High;
             resolution = StreamingResolution.TenEighty;
             break;
         default:
             lmh = StreamingLMH.Low;
             resolution = StreamingResolution.ThreeSixty;
             break;
     }
 }
        private void SetQuality(StreamingLMH lmh, bool isWifi = false)
        {
            if (isWifi)
            {
                WifiStreamingLmhs = Enum <StreamingLMH> .GetNames();

                WifiStreamingLmh = WifiStreamingLmhs.FirstOrDefault(x => x == lmh);
            }
            else
            {
                StreamingLmhs = Enum <StreamingLMH> .GetNames();

                StreamingLmh = StreamingLmhs.FirstOrDefault(x => x == lmh);
            }
        }
 private void SetQuality(StreamingLMH lmh, bool isWifi = false)
 {
     if (isWifi)
     {
         WifiStreamingLmhs = Enum<StreamingLMH>.GetNames();
         WifiStreamingLmh = WifiStreamingLmhs.FirstOrDefault(x => x == lmh);
     }
     else
     {
         StreamingLmhs = Enum<StreamingLMH>.GetNames();
         StreamingLmh = StreamingLmhs.FirstOrDefault(x => x == lmh);
     }
 }
        public static void BreakDown(this StreamingQuality quality, out StreamingResolution resolution, out StreamingLMH lmh)
        {
            switch (quality)
            {
            case StreamingQuality.ThreeSixty:
                lmh        = StreamingLMH.Low;
                resolution = StreamingResolution.ThreeSixty;
                break;

            case StreamingQuality.FourEightyLow:
                lmh        = StreamingLMH.Low;
                resolution = StreamingResolution.FourEighty;
                break;

            case StreamingQuality.FourEightyMedium:
                lmh        = StreamingLMH.Medium;
                resolution = StreamingResolution.FourEighty;
                break;

            case StreamingQuality.FourEightyHigh:
                lmh        = StreamingLMH.High;
                resolution = StreamingResolution.FourEighty;
                break;

            case StreamingQuality.SevenTwentyLow:
                lmh        = StreamingLMH.Low;
                resolution = StreamingResolution.SevenTwenty;
                break;

            case StreamingQuality.SevenTwentyMedium:
                lmh        = StreamingLMH.Medium;
                resolution = StreamingResolution.SevenTwenty;
                break;

            case StreamingQuality.SevenTwentyHigh:
                lmh        = StreamingLMH.High;
                resolution = StreamingResolution.SevenTwenty;
                break;

            case StreamingQuality.TenEightyLow:
                lmh        = StreamingLMH.Low;
                resolution = StreamingResolution.TenEighty;
                break;

            case StreamingQuality.TenEightyMedium:
                lmh        = StreamingLMH.Medium;
                resolution = StreamingResolution.TenEighty;
                break;

            case StreamingQuality.TenEightyHigh:
                lmh        = StreamingLMH.High;
                resolution = StreamingResolution.TenEighty;
                break;

            default:
                lmh        = StreamingLMH.Low;
                resolution = StreamingResolution.ThreeSixty;
                break;
            }
        }
        public static StreamingQuality ToStreamingQuality(this StreamingResolution resolution, StreamingLMH lmh)
        {
            var quality = string.Format("{0}{1}", resolution, lmh);

            if (resolution == StreamingResolution.ThreeSixty)
            {
                return(StreamingQuality.ThreeSixty);
            }

            return((StreamingQuality)Enum.Parse(typeof(StreamingQuality), quality, true));
        }
        public static string GetBitrateLabel(this StreamingLMH lmh, bool isWifi)
        {
            var vm = SimpleIoc.Default.GetInstance <SettingsViewModel>();

            if (vm == null)
            {
                return(string.Empty);
            }

            var res = isWifi ? vm.WifiStreamingResolution : vm.StreamingResolution;

            switch (res)
            {
            case StreamingResolution.ThreeSixty:
                return("1Mbps");

            case StreamingResolution.FourEighty:
                switch (lmh)
                {
                case StreamingLMH.Low:
                    return("720Kbps");

                case StreamingLMH.Medium:
                    return("1.5Mbps");

                case StreamingLMH.High:
                    return("4.5Mpbs");
                }
                break;

            case StreamingResolution.SevenTwenty:
                switch (lmh)
                {
                case StreamingLMH.Low:
                    return("5Mpbs");

                case StreamingLMH.Medium:
                    return("7.5Mbps");

                case StreamingLMH.High:
                    return("10Mbps");
                }
                break;

            case StreamingResolution.TenEighty:
                switch (lmh)
                {
                case StreamingLMH.Low:
                    return("7.5Mbps");

                case StreamingLMH.Medium:
                    return("15Mbps");

                case StreamingLMH.High:
                    return("25Mbps");
                }
                break;
            }

            return(string.Empty);
        }