// 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 { } }
void PlayerService_SendTunedChannel(string displayName, out WCFChannel ch) { if (playerWindows.Keys.Contains(displayName)) { ch = NetWCFConverter.ToWCF(playerWindows[displayName].GetChannel()); } else { ch = null; } }
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.ToWCF(display)); } return(res.ToArray()); }
public WCFScreenInformation GetPrimaryDisplay() { return(NetWCFConverter.ToWCF(Screen.PrimaryScreen)); }
public override void SetCurrentTVChannel(TV2Lib.Channel channel) { player.SetChannel(player.GetPrimaryDisplay().DeviceID, NetWCFConverter.ToWCF(channel)); }