// Adicionar um método estático na classe do player de tv para devolver os canais public WCFChannel[] GetChannels() { try { var temp = new TV2Lib.DigitalTVScreen(); temp.Channels.CurrentChannel.Frequency = 754000; try { temp.Channels.LoadFromXML(); } catch (Exception) { temp.Channels.RefreshChannels(); //Só funciona em Portugal. Compor o ecra de opçoes no composer temp.Channels.SaveToXML(); } var channels = temp.Channels.ChannelList; return(NetWCFConverter.ToWCF(channels.ToArray())); } catch { return(new WCFChannel[0]); } }
//A partir daqui é tudo feito a partir do Player // TODO - Alterar os métodos para receberem o id do display em vez de chamar sempre o principal #region Janela do Player public override void OpenPlayerWindow(PlayerWindowInformation configurations) { try { player.OpenPlayer(NetWCFConverter.ToWCF(configurations)); } catch { } }
public WCFScreenInformation[] GetDisplayInformation() //Não está a dar. Verificar os callbacks (sucatada) { List <WCFScreenInformation> res = new List <WCFScreenInformation>(); foreach (var display in Screen.AllScreens) { res.Add(NetWCFConverter.ToWCFScreenInformation(display)); } return(res.ToArray()); }
void PlayerService_SendTunedChannel(string displayName, out WCFChannel ch) { if (playerWindows.Keys.Contains(displayName)) { ch = NetWCFConverter.ToWCF(playerWindows[displayName].GetChannel()); } else { ch = null; } }
private void computadoresToolStripMenuItem_Click(object sender, EventArgs e) { try { ServiceList lista = new ServiceList(); if (lista.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Connection = new WCFConnection(lista.PC); Connection.Open(); groupBoxPC.Text = string.Format("Ligado a: {0}", lista.PC.Name); listViewDisplays.Items.Clear(); foreach (var display in lista.PC.Displays) { var item = new ListViewItem(display.DeviceID) { Tag = display, ToolTipText = string.Format("Nome: {0}{1}Resolução: {2}{1}Primário: {3}", display.DeviceID, Environment.NewLine, display.Bounds.Size.ToString(), (display.Primary ? "Sim" : "Não")) }; listViewDisplays.Items.Add(item); if (display.Primary) { this.finalResolution = NetWCFConverter.ToNET(display.Bounds.Size); } } } } catch { } }
public WCFScreenInformation GetPrimaryDisplay() { return(NetWCFConverter.ToWCFScreenInformation(Screen.PrimaryScreen)); }
void PlayerService_OpenPlayerWindow2(WCFPlayerWindowInformation2 config) { Player_OpenPlayerWindow2(NetWCFConverter.ToNET(config)); }
void PlayerService_EditPlayerWindow(WCFPlayerWindowInformation config) { Player_EditPlayerWindow(NetWCFConverter.ToNET(config)); }
void PlayerService_TuneToChannel(string deviceName, WCFChannel ch) { FormJanelaFinal window = playerWindows[deviceName]; window.SetChannel(NetWCFConverter.ToNET(ch)); }
public override void SetCurrentTVChannel(TV2Lib.Channel channel) { player.SetChannel(player.GetPrimaryDisplay().DeviceID, NetWCFConverter.ToWCF(channel)); }
public override TV2Lib.Channel GetCurrentTVChannel() { return(NetWCFConverter.ToNET(player.GetCurrentTVChannel(player.GetPrimaryDisplay().DeviceID))); }
public override IEnumerable <TV2Lib.Channel> GetTVChannels() { var channels = player.GetChannels(); return(NetWCFConverter.ToNET(channels)); }
} //ALTERAR PARA RECEBER O DEVICEID DO MONITOR public override ScreenInformation[] GetDisplayInformation() { return(NetWCFConverter.ToNET(player.GetDisplayInformation())); }