internal PlaceholderStudioComponent GetPlaceholderClone(PlaceholderStudioComponent placeholderComponent)
        {
            var clone = placeholderComponent.Clone();

            clone.SetId(idGenerator.GetNewId());
            return(clone);
        }
 public virtual void RemovePlaceholder(PlaceholderStudioComponent placeholder)
 {
     if (_placeholders.Remove(placeholder))
     {
         PlaceholderRemoved?.Invoke(this, placeholder);
     }
 }
 public bool AddPlaceholder(PlaceholderStudioComponent placeholder)
 {
     if (AddPlaceholderStudioComponent(placeholder))
     {
         PlaceholderAdded?.Invoke(this, placeholder);
         return(true);
     }
     return(false);
 }
        protected virtual bool AddPlaceholderStudioComponent(PlaceholderStudioComponent component)
        {
            if (!PrepareAddComponent(component))
            {
                return(false);
            }

            _placeholders.Add(component);
            return(true);
        }
Exemple #5
0
        private void InitializeVirtualStudio(VirtualStudioWithArrangement virtualStudio)
        {
            var placeholder1 = new PlaceholderStudioComponent();

            placeholder1.SetName("Placeholder with input");
            placeholder1.AddInput("Input 1", DataKind.Audio, "WebRtc");
            placeholder1.AddInput("Input 2", DataKind.Video, "NDI");
            var placeholder2 = new PlaceholderStudioComponent();

            placeholder2.SetName("Placeholder with output");
            placeholder2.AddOutput("Output 1", DataKind.Audio, "WebRtc");
            virtualStudio.ComponentRepository.AddPlaceholder(placeholder1);
            virtualStudio.ComponentRepository.AddPlaceholder(placeholder2);
            var componentNode1 = virtualStudio.AddComponent(placeholder1, new Position2D(100, 100));
            var componentNode2 = virtualStudio.AddComponent(placeholder2, new Position2D(100, 250));
            //virtualStudio.CreateConnection(componentNode2.Component.Outputs[0], componentNode1.Component.Inputs[0]);
        }