private void sourceBtn_Network_Click(object sender, EventArgs e) { if (Enabled) { SelectedSource = TVSource.Network; } }
private void sourceBtn_LocalAnalog_Click(object sender, EventArgs e) { if (Enabled) { SelectedSource = TVSource.LocalAnalog; } }
public bool HasGraphFor(TVSource type) { foreach (Graph g in Graph) { if (g.Type == type) { return(true); } } return(false); }
public Graph this[TVSource type] { get { foreach (Graph g in Graph) { if (g.Type == type) { return(g); } } throw new SourceConfigException("No graph for type \"" + type.ToString() + "\" exists for this capture device!"); } }
/// <summary> /// Returns a reference to the currently selected source button /// </summary> private FCButton GetSourceButton(TVSource source) { switch (source) { case TVSource.LocalAnalog: return(sourceBtn_LocalAnalog); case TVSource.LocalDigital: return(sourceBtn_LocalDigital); case TVSource.Network: return(sourceBtn_Network); } return(null); }
public void Add(TVSource type, ChannelCollection favorites) { Source.Add(new SourceChannelsStoreItem(type, favorites)); }
public SourceChannelsStoreItem(TVSource type, ChannelCollection channels) { this.Type = type; this.Channels = channels; }
/// <summary> /// Shows or hides the associated button. /// </summary> /// <param name="source">Type of TVSource</param> /// <param name="available">true if available (show), false if not available (hide)</param> public void SetSourceAvailable(TVSource source, bool available) { GetSourceButton(source).Visible = available; }
protected ARoom(ASystem system, RoomConfig config) : base(system) { try { _config = config; Debug.WriteInfo("Loading Room Config", "Room {0} \"{1}\"", config.Id, config.Name); Name = string.IsNullOrEmpty(config.Name) ? string.Format("Room {0}", Id) : config.Name; DivisibleRoomType = config.DivisibleRoomType; SystemSwitcher = system.Switcher; if (system.Dsp != null) { system.Dsp.HasIntitialized += DspOnHasIntitialized; } if (SystemSwitcher != null) { SystemSwitcher.InputStatusChanged += SwitcherOnInputStatusChanged; } try { if (config.Displays == null) { config.Displays = new List <DisplayConfig>(); } foreach (var displayConfig in config.Displays .Where(d => d.Enabled) .OrderBy(d => d.Id)) { Debug.WriteInfo("Loading Display Config", "{0} {1}", displayConfig.DisplayType, displayConfig.DeviceAddressString); switch (displayConfig.DisplayType) { case DisplayType.Samsung: if (SystemSwitcher != null && displayConfig.DeviceConnectionType == DeviceConnectionType.Serial) { var comports = SystemSwitcher.GetEndpointForOutput(displayConfig.SwitcherOutputIndex) as IComPorts; new ADisplay(this, new SamsungDisplay(displayConfig.Name, 1, new SamsungDisplayComPortHandler(comports.ComPorts[1])), displayConfig); } else { new ADisplay(this, new SamsungDisplay(displayConfig.Name, 1, new SamsungDisplaySocket(displayConfig.DeviceAddressString)), displayConfig); } break; case DisplayType.CrestronConnected: var proj = new ADisplay(this, new CrestronConnectedDisplay(displayConfig.DeviceAddressNumber, system.ControlSystem, displayConfig.Name), displayConfig); if (displayConfig.UsesRelaysForScreenControl && SystemSwitcher != null) { var relayEndpoint = SystemSwitcher.GetEndpointForOutput(displayConfig.SwitcherOutputIndex) as IRelayPorts; if (relayEndpoint == null) { CloudLog.Error("Could not get relays for projector"); break; } var relays = new UpDownRelays(relayEndpoint.RelayPorts[2], relayEndpoint.RelayPorts[1], UpDownRelayModeType.Momentary); relays.Register(); proj.SetScreenController(relays); } break; default: new ADisplay(this, null, displayConfig); break; } } } catch (Exception e) { CloudLog.Error("Error setting up displays in Room {0}, {1}", Id, e.Message); } if (config.Sources != null) { foreach (var sourceConfig in config.Sources .Where(s => s.Enabled) .OrderBy(s => s.Id)) { try { ASource source; switch (sourceConfig.SourceType) { case SourceType.PC: source = new PCSource(this, sourceConfig); break; case SourceType.IPTV: source = new TVSource(this, sourceConfig); break; default: source = new GenericSource(this, sourceConfig); break; } if (!String.IsNullOrEmpty(sourceConfig.GroupName)) { source.AddToGroup(sourceConfig.GroupName); } } catch (Exception e) { CloudLog.Error("Error setting up source \"{0}\" in Room {1}, {2}", sourceConfig.Name, Id, e.Message); } } } foreach (var source in Sources.Cast <ASource>()) { if (source.Type == SourceType.Laptop) { source.VideoStatusChangeDetected += LaptopSourceOnVideoDetected; } } } catch (Exception e) { CloudLog.Exception(e); } }