Пример #1
0
        /*
         * If the caspar device changes its connection status, this function is triggered.
         * Just changes the connect button and the status bar.
         * */
        void casparDevice_ConnectionStatusChanged(object sender, ConnectionEventArgs e)
        {
            if (casparDevice.IsConnected)
            {
                System.Diagnostics.Debug.WriteLine(DateTime.Now + ": Caspar connected");
                statusStrip1.BackColor = System.Drawing.Color.Green;
                lb_status.Text         = "Connected";
                ChangeConnectButton("Disconnect");

                casparDevice.RefreshMediafiles();
                casparDevice.RefreshDatalist();
                casparDevice.RefreshTemplates();
                casparDevice.DataRetrieved += casparDevice_DataRetrieved;
                System.Diagnostics.Debug.WriteLine(DateTime.Now + " Channels: " + casparDevice.Channels.Count);
            }
            else
            {
                System.Diagnostics.Debug.WriteLine(DateTime.Now + ": Caspar disconnected");
                statusStrip1.BackColor = System.Drawing.Color.Red;
                lb_status.Text         = "Disconnected";
                ChangeConnectButton("Connect");
            }
        }
 public void RefreshTemplates()
 {
     CasparDevice.RefreshTemplates();
 }