Ejemplo n.º 1
0
        public XElement SerializeItem(object item, object parentItem)
        {
            MixerInput input = item as MixerInput;

            if (input == null)
            {
                return(null);
            }

            XElement xmlElement = new XElement(TAG_NAME);

            xmlElement.SetAttributeValue(ATTRIBUTE_NAME, input.Name);
            xmlElement.SetAttributeValue(ATTRIBUTE_INDEX, input.Index);
            xmlElement.SetAttributeValue(ATTRIBUTE_SOURCE, ((input.Source != null) ? input.Source.SignalUniqueId : ""));

            return(xmlElement);
        }
Ejemplo n.º 2
0
        public MixerInputTallyBoolean(MixerInput input, TallyColor color) :
            base(getName(input, color), getColor(color), getDescription(input, color))
        {
            this.input = input;
            this.color = color;
            //input.IndexChanged += indexChangedHandler;
            input.NameChanged       += nameChangedHandler;
            input.Mixer.IdChanged   += routerIdChangedHandler;
            input.Mixer.NameChanged += routerNameChangedHandler;
            switch (color)
            {
            case TallyColor.Red:
                CurrentState           = input.RedTally;
                input.RedTallyChanged += tallyChangedHandler;
                break;

            case TallyColor.Green:
                CurrentState             = input.GreenTally;
                input.GreenTallyChanged += tallyChangedHandler;
                break;
            }
        }
Ejemplo n.º 3
0
 private static string getDescription(MixerInput input, TallyColor color)
 => string.Format("The [(#{2}) {3}] input of mixer [(#{0}) {1}] has {4} tally.",
                  input.Mixer.ID, input.Mixer.Name,
                  input.Index, input.Name,
                  getColorString(color));
Ejemplo n.º 4
0
 private static string getName(MixerInput input, TallyColor color)
 => string.Format("mixer.{0}.input.{1}.{2}tally", input.Mixer.ID, input.Index, getColorString(color));
Ejemplo n.º 5
0
 private void nameChangedHandler(MixerInput output, string oldName, string newName)
 {
     Description = getDescription(output, color);
 }
Ejemplo n.º 6
0
 private void indexChangedHandler(MixerInput output, int oldIndex, int newIndex)
 {
     Name        = getName(output, color);
     Description = getDescription(output, color);
 }
Ejemplo n.º 7
0
 private void tallyChangedHandler(MixerInput output, bool newState)
 {
     CurrentState = newState;
 }