Exemplo n.º 1
0
        private void RefreshVM(Zone zone)
        {
            TheZone = zone;

            if (null == zone.Surround)
            {
                DSPTitle = "Default";
            }
            else
            {
                if (zone.Surround.StraitOn)
                {
                    DSPTitle = Surround.DSP_Strait;
                }
                else
                {
                    DSPTitle = zone.Surround.DSP;
                }
            }
            foreach (var dsp in DSPs)
            {
                dsp.IsSelected = (dsp.SelectString == DSPTitle);
            }

            IsOn           = zone.PowerOn;
            IsPureDirectOn = zone.PureDirectOn;

            //-- Updated Selected Input
            for (int i = 0; i < zone.Inputs.Length; i++)
            {
                if (zone.Inputs[i].Param == zone.SelectedInput)
                {
                    InputTitle           = Inputs[i].DisplayName;
                    ImageUri             = Inputs[i].ImageUri;
                    Inputs[i].IsSelected = true;

                    SelectedInput = zone.Inputs[i];
                    List          = new VMList(MainVM, zone.Inputs[i], zone);
                }
                else
                {
                    Inputs[i].IsSelected = false;
                }
            }

            Volume.Refresh();
            Playback.Refresh();
            ZoneTitle = zone.DisplayName;
        }
Exemplo n.º 2
0
        public void SelectInput(Input input, Action OnSuccess)
        {
            SaveOld();

            //-- Update our local VM with the newly selected Input
            var selString = GetSelectString(input);

            foreach (var i in Inputs)
            {
                if (i.SelectString == selString)
                {
                    i.IsSelected = true;
                    ImageUri     = i.ImageUri;
                    InputTitle   = i.DisplayName;
                }
                else
                {
                    i.IsSelected = false;
                }
            }

            //-- Make the call to select the input
            TheController.SelectInput(TheZone, input, result =>
            {
                if (result.Success)
                {
                    UI.Invoke(() =>
                    {
                        SelectedInput = input;
                        List          = new VMList(MainVM, input, TheZone);
                        Playback.Refresh();
                        OnSuccess.NullableInvoke();
                    });
                    return;
                }
                ;
                RestoreToOld();
            });
        }