private static void ListInputs(ATEMInputs.Format format, IList<string> args) { if (args.Count < 1) { ATEMInputs.Help(); throw new SwitcherLibException("Invalid arguments"); } Switcher switcher = new Switcher(args[0]); Log.Debug(String.Format("Switcher: {0}", switcher.GetProductName())); IList<SwitcherInput> inputs = switcher.GetInputs(); switch (format) { case ATEMInputs.Format.Text: foreach (SwitcherInput input in inputs) { Console.Out.WriteLine(); Console.Out.WriteLine(String.Format(" Name: {0}", input.Name)); Console.Out.WriteLine(String.Format(" ID: {0}", input.ID.ToString())); Console.Out.WriteLine(String.Format(" Label: {0}", input.Label)); Console.Out.WriteLine(String.Format(" Input Type: {0}", input.PortType)); } break; default: Console.Out.WriteLine(inputs.ToString()); break; } }
private static void ListMediaPool(MediaPool.Format format, IList<string> args) { if (args.Count < 1) { MediaPool.Help(); throw new SwitcherLibException("Invalid arguments"); } Switcher switcher = new Switcher(args[0]); Log.Debug(String.Format("Switcher: {0}", switcher.GetProductName())); IList<MediaStill> stills = switcher.GetStills(); switch (format) { case MediaPool.Format.Text: foreach (MediaStill still in stills) { Console.Out.WriteLine(); Console.Out.WriteLine(String.Format(" Name: {0}", still.Name)); Console.Out.WriteLine(String.Format(" Hash: {0}", still.Hash)); Console.Out.WriteLine(String.Format(" Slot: {0}", still.Slot.ToString())); Console.Out.WriteLine(String.Format(" Media Player: {0}", still.MediaPlayer.ToString())); } break; case MediaPool.Format.JSON: Console.Out.WriteLine(JsonConvert.SerializeObject(stills)); break; case MediaPool.Format.XML: XmlSerializer xml = new XmlSerializer(stills.GetType()); xml.Serialize(Console.Out, stills); break; case MediaPool.Format.CSV: foreach (MediaStill still in stills) { Console.Out.WriteLine(still.ToCSV()); } break; default: Console.Out.WriteLine(stills.ToString()); break; } }
private static void ListAux(IList<string> args) { if (args.Count < 1) { ATEMAux.Help(); throw new SwitcherLibException("Invalid arguments"); } Switcher switcher = new Switcher(args[0]); Log.Debug(String.Format("Switcher: {0}", switcher.GetProductName())); IList<SwitcherAuxPort> inputs = switcher.GetAuxInputs(); foreach (SwitcherAuxPort input in inputs) { Console.Out.WriteLine(); Console.Out.WriteLine(String.Format(" Name: {0}", input.Name)); Console.Out.WriteLine(String.Format(" ID: {0}", input.ID.ToString())); Console.Out.WriteLine(String.Format(" Label: {0}", input.Label)); Console.Out.WriteLine(String.Format(" Source: {0}", input.Source)); } }
private static void Upload(string name, IList<string> args) { if (args.Count < 3) { MediaUpload.Help(); throw new SwitcherLibException("Invalid arguments"); } Switcher switcher = new Switcher(args[0]); int slot = MediaUpload.GetSlot(args[1]); Log.Debug(String.Format("Switcher: {0}", switcher.GetProductName())); Log.Debug(String.Format("Resolution: {0}x{1}", switcher.GetVideoWidth().ToString(), switcher.GetVideoHeight().ToString())); args.RemoveAt(0); args.RemoveAt(0); string filename = String.Join(" ", args); Upload upload = new Upload(switcher, filename, slot); if (name != "") { upload.SetName(name); } upload.Start(); while (upload.InProgress()) { Log.Info(String.Format("Progress: {0}%", upload.GetProgress().ToString())); Thread.Sleep(100); } }
private static void SetAux(ATEMAux.Format format, IList<string> args, int aux, int source) { Switcher switcher = new Switcher(args[0]); Log.Debug(String.Format("Switcher: {0}", switcher.GetProductName())); if (aux < 1 ) { IList<SwitcherAuxPort> inputs = switcher.GetAuxInputs(); foreach (SwitcherAuxPort input in inputs) { Console.Out.WriteLine(); Console.Out.WriteLine(String.Format(" Name: {0}", input.Name)); Console.Out.WriteLine(String.Format(" ID: {0}", input.ID.ToString())); Console.Out.WriteLine(String.Format(" Label: {0}", input.Label)); Console.Out.WriteLine(String.Format(" Source: {0}", input.Source)); } } else { switcher.SetAuxInput((long)aux, (long)source); } }