Example #1
0
        // 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]);
            }
        }
Example #2
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
            {
            }
        }
Example #3
0
        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());
        }
Example #4
0
 void PlayerService_SendTunedChannel(string displayName, out WCFChannel ch)
 {
     if (playerWindows.Keys.Contains(displayName))
     {
         ch = NetWCFConverter.ToWCF(playerWindows[displayName].GetChannel());
     }
     else
     {
         ch = null;
     }
 }
Example #5
0
        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
            {
            }
        }
Example #6
0
 public WCFScreenInformation GetPrimaryDisplay()
 {
     return(NetWCFConverter.ToWCFScreenInformation(Screen.PrimaryScreen));
 }
Example #7
0
 void PlayerService_OpenPlayerWindow2(WCFPlayerWindowInformation2 config)
 {
     Player_OpenPlayerWindow2(NetWCFConverter.ToNET(config));
 }
Example #8
0
 void PlayerService_EditPlayerWindow(WCFPlayerWindowInformation config)
 {
     Player_EditPlayerWindow(NetWCFConverter.ToNET(config));
 }
Example #9
0
        void PlayerService_TuneToChannel(string deviceName, WCFChannel ch)
        {
            FormJanelaFinal window = playerWindows[deviceName];

            window.SetChannel(NetWCFConverter.ToNET(ch));
        }
Example #10
0
 public override void SetCurrentTVChannel(TV2Lib.Channel channel)
 {
     player.SetChannel(player.GetPrimaryDisplay().DeviceID, NetWCFConverter.ToWCF(channel));
 }
Example #11
0
 public override TV2Lib.Channel GetCurrentTVChannel()
 {
     return(NetWCFConverter.ToNET(player.GetCurrentTVChannel(player.GetPrimaryDisplay().DeviceID)));
 }
Example #12
0
        public override IEnumerable <TV2Lib.Channel> GetTVChannels()
        {
            var channels = player.GetChannels();

            return(NetWCFConverter.ToNET(channels));
        }
Example #13
0
        } //ALTERAR PARA RECEBER O DEVICEID DO MONITOR

        public override ScreenInformation[] GetDisplayInformation()
        {
            return(NetWCFConverter.ToNET(player.GetDisplayInformation()));
        }