Esempio n. 1
0
        internal void OnUpdatedTemplatesList(List <TemplateInfo> templates)
        {
            TemplatesCollection newTemplates = new TemplatesCollection();

            newTemplates.Populate(templates);
            Templates = newTemplates;

            UpdatedTemplates?.Invoke(this, EventArgs.Empty);
        }
        internal void OnUpdatedTemplatesList(List <TemplateInfo> templates)
        {
            TemplatesCollection newTemplates = new TemplatesCollection();

            newTemplates.Populate(templates);
            Templates = newTemplates;

            if (UpdatedTemplates != null)
            {
                UpdatedTemplates(this, EventArgs.Empty);
            }
        }
Esempio n. 3
0
        public CasparDevice()
        {
            Settings   = new CasparDeviceSettings();
            Connection = new Network.ServerConnection();
            Channels   = new List <Channel>();
            Templates  = new TemplatesCollection();
            Mediafiles = new List <MediaInfo>();
            Datafiles  = new List <string>();

            Version = "unknown";

            Connection.ProtocolStrategy        = new AMCP.AMCPProtocolStrategy(this);
            Connection.ConnectionStateChanged += server__ConnectionStateChanged;
        }
Esempio n. 4
0
        public CasparDevice()
        {
            Settings = new CasparDeviceSettings();
            Connection = new Network.ServerConnection();
            Channels = new List<Channel>();
            Templates = new TemplatesCollection();
            Mediafiles = new List<MediaInfo>();
            Datafiles = new List<string>();

            Version = "unknown";

            Connection.ProtocolStrategy = new AMCP.AMCPProtocolStrategy(this);
            Connection.ConnectionStateChanged += server__ConnectionStateChanged;
        }
Esempio n. 5
0
        public CasparDevice()
        {
            Settings      = new CasparDeviceSettings();
            Connection    = new Network.ServerConnection();
            Channels      = new Channel[0];
            Recorders     = new Recorder[0];
            Templates     = new TemplatesCollection();
            Mediafiles    = new List <MediaInfo>();
            Datafiles     = new List <string>();
            HostAddresses = new System.Net.IPAddress[0];

            Version = "unknown";

            Connection.ProtocolStrategy        = new AMCP.AMCPProtocolStrategy(this);
            Connection.ConnectionStateChanged += server__ConnectionStateChanged;
        }
Esempio n. 6
0
        internal void OnUpdatedTemplatesList(List<TemplateInfo> templates)
        {
            TemplatesCollection newTemplates = new TemplatesCollection();
            newTemplates.Populate(templates);
            Templates = newTemplates;

            if (UpdatedTemplates != null)
                UpdatedTemplates(this, EventArgs.Empty);
        }
Esempio n. 7
0
		public void UpdateTemplates()
		{
			if (InvokeRequired)
				BeginInvoke(new SimpleDelegate(UpdateTemplates));
			else
			{
				string selectedChannel = (string)cbChannels_.SelectedItem;
				if (!string.IsNullOrEmpty(selectedChannel))
				{
					Hosts.ChannelInformation channelInfo = OperatorForm.HostsManager.GetChannelInfo(selectedChannel);
					if (channelInfo != null)
					{
						Hosts.DeviceHolder device = OperatorForm.HostsManager.GetDevice(channelInfo.Hostname);
						if (device != null)
						{
							cbCategory_.SuspendLayout();
							cbCategory_.Items.Clear();
							cbCategory_.Items.Add("_ALL_");
							cbCategory_.SelectedItem = cbCategory_.Items[0];
							templatePaths.Clear();

							try
							{
								templatesCollection_ = device.Templates;
								if (templatesCollection_ != null)
								{
									foreach (string folder in templatesCollection_.Folders)
									{
										List<Svt.Caspar.TemplateInfo> templates = templatesCollection_.GetTemplatesInFolder(folder);
										foreach (Svt.Caspar.TemplateInfo template in templates)
										{
											string fullpath = "";
											if (!string.IsNullOrEmpty(template.Folder))
												fullpath = template.Folder.Replace('\\', '/') + '/' + template.Name;
											else
												fullpath = template.Name;

											templatePaths.Add(fullpath);

											if (fullpath.IndexOf('/') != -1)
											{
												string category = fullpath.Substring(0, fullpath.IndexOf('/'));
												if (!cbCategory_.Items.Contains(category))
													cbCategory_.Items.Add(category);
											}
										}
									}
								}
							}
							finally
							{
								cbCategory_.ResumeLayout();
							}
							UpdateTemplateListBox();
						}
					}
				}
			}
		}