Example #1
0
        internal Input(AtemSwitcher switcher, IBMDSwitcherInput input)
        {
            inputMonitor                 = new InputMonitor();
            inputMonitor.NameChanged    += (s, e) => UpdateFields();
            inputMonitor.ProgramChanged += (s, e) => UpdateFields();
            inputMonitor.PreviewChanged += (s, e) => UpdateFields();
            this.input = input;
            this.input.AddCallback(inputMonitor);

            long id;

            this.input.GetInputId(out id);
            Id = (int)id;
            UpdateFields();
        }
Example #2
0
        static void Main(string[] args)
        {
            var upd  = new UdpSender("224.100.0.1", 1052); // Send updates over UDP channel
            var atem = new AtemSwitcher("192.168.10.240"); // Set the ip-address of your Blackmagic Atem switch

            atem.Connect();
            Console.WriteLine($"Connected {atem.Name}");
            foreach (var item in atem.Inputs)
            {
                item.PropertyChanged += (s, e) =>
                {
                    var data = atem.Inputs.Where(x => x.Id < 127 && x.IsPreview).Select(x => (byte)x.Id).ToList();
                    data.AddRange(atem.Inputs.Where(x => x.Id < 127 && x.IsProgram).Select(x => (byte)((byte)x.Id | 0x80)));
                    upd.SendAll(data.ToArray());
                };
            }

            Console.ReadLine();
        }