Exemplo n.º 1
0
 public SequenceTypeDataModelBase()
 {
     Media          = new MediaCollection();
     LocalDataSet   = new ModuleLocalDataSet();
     SequenceLayers = new SequenceLayers();
     _InitDataStreams();
 }
Exemplo n.º 2
0
 public LayerEditorView(SequenceLayers layers)
 {
     CommandBindings.Add(new CommandBinding(LayerEditorCommands.AddLayer, OnAddLayer, CanExecuteAddLayer));
     CommandBindings.Add(new CommandBinding(LayerEditorCommands.RemoveLayer, OnRemoveLayer, CanExecuteRemoveLayer));
     CommandBindings.Add(new CommandBinding(LayerEditorCommands.ConfigureLayer, ConfigureLayer, CanExecuteConfigureLayer));
     _layers = layers;
     InitializeLayers();
     DataContext = this;
     Layers.CollectionChanged += Layers_CollectionChanged;
 }
Exemplo n.º 3
0
        private void SurrogateRead(StreamingContext context)
        {
            SelectedTimingProvider = _selectedTimingProviderSurrogate.CreateSelectedTimingProvider();
            Media = new MediaCollection(_mediaSurrogates.Select(x => x.CreateMedia()));

            // Rehydrate the local module data store.
            LocalDataSet            = new ModuleLocalDataSet();
            LocalDataSet.DataModels = _dataModels;

            // Rehydrate the modules.
            var elementNodes = VixenSystem.Nodes.Distinct().ToDictionary(x => x.Id);

            IEffectNode[] effectNodes = _effectNodeSurrogates.Select(x => x.CreateEffectNode(elementNodes)).ToArray();
            // weed out effects without nodes..
            effectNodes = effectNodes.Where(x => x.Effect.TargetNodes.Count() != 0).ToArray();

            ISequenceFilterNode[] sequenceFilterNodes = _filterNodeSurrogates.Select(x => x.CreateFilterNode()).ToArray();

            // Connect them to their respective data from the data store.
            // This was previously being done by adding the data to the sequence after loading the data.
            foreach (var effectNode in effectNodes)
            {
                LocalDataSet.AssignModuleInstanceData(effectNode.Effect);
            }
            foreach (var sequenceFilterNode in sequenceFilterNodes)
            {
                LocalDataSet.AssignModuleInstanceData(sequenceFilterNode.Filter);
            }

            if (SequenceLayers != null)
            {
                var layerMixingFilterModels = new ModuleLocalDataSet {
                    DataModels = _layerMixingFilterDataModels
                };
                //Bring in the layers
                foreach (var layer in SequenceLayers.Layers)
                {
                    var surrogate = _layerMixingFilterSurrogates.FirstOrDefault(x => x.LayerReferenceId == layer.Id);
                    if (surrogate != null)
                    {
                        layer.LayerMixingFilter = surrogate.CreateLayerMixingFilter();
                        layerMixingFilterModels.AssignModuleInstanceData(layer.LayerMixingFilter);
                    }
                }
            }
            else
            {
                SequenceLayers = new SequenceLayers();
            }

            // Get the modules back into their collections.
            _InitDataStreams();
            EffectData.AddData(effectNodes);
            SequenceFilterData.AddData(sequenceFilterNodes);
        }
Exemplo n.º 4
0
        public FindEffectForm(TimelineControl timelineControl, SequenceLayers layerManager)
        {
            InitializeComponent();
            _layerManager = layerManager;
            contextMenuStrip1.Renderer = new ThemeToolStripRenderer();
            Icon            = Resources.Icon_Vixen3;
            TimelineControl = timelineControl;

            comboBoxFind.SelectedIndex = 0;

            listViewEffectStartTime.BeginUpdate();
            listViewEffectStartTime.ColumnAutoSize();
            listViewEffectStartTime.SetLastColumnWidth();
            listViewEffectStartTime.EndUpdate();
            ThemeUpdateControls.UpdateControls(this);
        }
Exemplo n.º 5
0
        public LayerEditor(SequenceLayers layers)
        {
            InitializeComponent();

            var host = new ElementHost {
                Dock = DockStyle.Fill
            };

            Controls.Add(host);

            _layerEditorView = new Editor.LayerEditor.LayerEditorView(layers);

            host.Child = _layerEditorView;

            _layerEditorView.CollectionChanged += LayerEditorViewCollectionChanged;
        }
Exemplo n.º 6
0
        private static Color ProcessIntentNodes(KeyValuePair <Guid, IntentNodeCollection> effectIntent, TimeSpan effectRelativeTime)
        {
            IntentStateList states = new IntentStateList();

            foreach (IIntentNode intentNode in effectIntent.Value)
            {
                if (TimeNode.IntersectsInclusively(intentNode, effectRelativeTime))
                {
                    IIntentState intentState = intentNode.CreateIntentState(effectRelativeTime - intentNode.StartTime, SequenceLayers.GetDefaultLayer());
                    states.Add(intentState);
                }
            }

            return(IntentHelpers.GetOpaqueRGBMaxColorForIntents(states));
        }
Exemplo n.º 7
0
        private static Dictionary <Color, DiscreteValue> ProcessDiscreteIntentNodes(KeyValuePair <Guid, IntentNodeCollection> effectIntent, TimeSpan effectRelativeTime)
        {
            IntentStateList states = new IntentStateList();

            foreach (IIntentNode intentNode in effectIntent.Value)
            {
                if (TimeNode.IntersectsInclusively(intentNode, effectRelativeTime))
                {
                    IIntentState intentState = intentNode.CreateIntentState(effectRelativeTime - intentNode.StartTime, SequenceLayers.GetDefaultLayer());
                    states.Add(intentState);
                }
            }

            return(GetAlphaDiscreteColorsForIntents(states));
        }
Exemplo n.º 8
0
 protected override ILayer GetLayerForNode(IEffectNode node)
 {
     return(SequenceLayers.GetDefaultLayer());
 }
Exemplo n.º 9
0
 public StaticIntentState(ResultType value) : this(value, SequenceLayers.GetDefaultLayer())
 {
 }
Exemplo n.º 10
0
 public IntentState(IIntent <ResultType> intent, TimeSpan intentRelativeTime) : this(intent, intentRelativeTime, SequenceLayers.GetDefaultLayer())
 {
 }