Esempio n. 1
0
        public Group(SnapDotNet.ControlClient.SnapcastClient snapcastClient, SnapDotNet.ControlClient.JsonRpcData.Group group)
        {
            InitializeComponent();
            m_Group          = group;
            m_SnapcastClient = snapcastClient;

            foreach (SnapDotNet.ControlClient.JsonRpcData.Client client in m_Group.clients)
            {
                if (SnapSettings.HideOfflineClients == false || client.connected == true)
                {
                    Client c = new Client(client, m_SnapcastClient.ServerData.server.snapserver);
                    c.HorizontalAlignment        = HorizontalAlignment.Stretch;
                    c.HorizontalContentAlignment = HorizontalAlignment.Center;
                    m_ClientControls.Add(c);
                    spClients.Children.Add(c);
                }
            }

            m_Group.SERVER_OnGroupUpdated += () =>
            {
                System.Windows.Application.Current.Dispatcher.BeginInvoke(new Action(_OnGroupUpdated));
            };

            m_Group.CLIENT_OnVolumeUpdated += () =>
            {
                System.Windows.Application.Current.Dispatcher.BeginInvoke(new Action(_OnGroupUpdated));
            };

            vcGroup.OnMuteToggled       += VcGroup_OnMuteToggled;
            vcGroup.OnVolumeChanged     += VcGroup_OnVolumeChanged;
            vcGroup.OnVolumeChangeStart += VcGroup_OnVolumeChangeStart;

            _OnGroupUpdated();
        }
Esempio n. 2
0
        public EditGroup(SnapDotNet.ControlClient.SnapcastClient snapcastClient, SnapDotNet.ControlClient.JsonRpcData.Group group)
        {
            InitializeComponent();
            m_Group          = group;
            m_SnapcastClient = snapcastClient;

            m_Group.SERVER_OnInvalidate += () =>
            {
                // server is sending us a full data refresh - close this window (this group might be getting deleted for all we know)
                Application.Current.Dispatcher.Invoke(() =>
                {
                    this.Close();
                });
            };

            m_Group.CLIENT_OnNameModified += Group_Updated;
            m_Group.SERVER_OnGroupUpdated += Group_Updated;

            _UpdateData();
        }
Esempio n. 3
0
        public GroupEditPage(SnapDotNet.ControlClient.SnapcastClient snapcastClient, SnapDotNet.ControlClient.JsonRpcData.Group group)
        {
            InitializeComponent();

            m_Group          = group;
            m_SnapcastClient = snapcastClient;

            m_Group.SERVER_OnInvalidate += () =>
            {
                // server is sending us a full data refresh - close this window (this group might be getting deleted for all we know)
                MainThread.BeginInvokeOnMainThread(() =>
                {
                    Navigation.PopAsync().ConfigureAwait(false);
                });
            };

            m_Group.CLIENT_OnNameModified += Group_Updated;
            m_Group.SERVER_OnGroupUpdated += Group_Updated;

            _UpdateData();
        }