internal static ITargetDevice CreateTvDevice(DeviceInfo deviceInfo, IPlayerNotificationProvider playerNotification, IBaseDispatcher dispatcher, ISecondTvSecurityProvider securityProvider)
        {
            if (deviceInfo == null)
            {
                throw new ArgumentNullException("deviceInfo");
            }
            if (playerNotification == null)
            {
                throw new ArgumentNullException("playerNotification");
            }
            if (dispatcher == null)
            {
                throw new ArgumentNullException("dispatcher");
            }
            SecondTvSyncTransport  secondTvSyncTransport  = new SecondTvSyncTransport(securityProvider);
            SecondTvAsyncTransport secondTvAsyncTransport = new SecondTvAsyncTransport(securityProvider);

            secondTvSyncTransport.Connect(deviceInfo.DeviceAddress);
            secondTvAsyncTransport.Connect(deviceInfo.DeviceAddress);
            SecondTv            secondTv            = new SecondTv(secondTvSyncTransport, deviceInfo.LocalAddress);
            SecondTvRemoteInput secondTvRemoteInput = new SecondTvRemoteInput(secondTvAsyncTransport, deviceInfo.LocalAddress);

            secondTvRemoteInput.Connect(secondTvSyncTransport);
            MbrKeySender         mbrKeySender         = new MbrKeySender(secondTvSyncTransport, deviceInfo.LocalAddress);
            RemoteControlFactory remoteControlFactory = new RemoteControlFactory(secondTvRemoteInput, mbrKeySender);

            return(new TvDevice(deviceInfo, secondTv, playerNotification, secondTvRemoteInput, remoteControlFactory, dispatcher, new HttpServer(), new MultiScreenController(), new DlnaServer(), new DataLibrary(dispatcher)));
        }
Example #2
0
        internal static ITargetDevice CreateTvDevice(DeviceInfo deviceInfo, IPlayerNotificationProvider playerNotification, IBaseDispatcher dispatcher, ISecondTvSecurityProvider securityProvider)
        {
            if (deviceInfo == null)
            {
                throw new ArgumentNullException("deviceInfo");
            }
            if (playerNotification == null)
            {
            }
            if (dispatcher == null)
            {
                Console.WriteLine("Dispatcher is null");
            }
            //Dispatcher backgroundSerialQeueue = new Dispatcher;
            SecondTvSyncTransport  secondTvSyncTransport  = new SecondTvSyncTransport(securityProvider);
            SecondTvAsyncTransport secondTvAsyncTransport = new SecondTvAsyncTransport(securityProvider);

            secondTvSyncTransport.Connect(deviceInfo.DeviceAddress);
            secondTvAsyncTransport.Connect(deviceInfo.DeviceAddress);
            SecondTv            secondTv            = new SecondTv(secondTvSyncTransport, deviceInfo.LocalAddress);
            SecondTvRemoteInput secondTvRemoteInput = new SecondTvRemoteInput(secondTvAsyncTransport, deviceInfo.LocalAddress);

            secondTvRemoteInput.Connect(secondTvSyncTransport);
            MbrKeySender         mbrKeySender         = new MbrKeySender(secondTvSyncTransport, deviceInfo.LocalAddress);
            RemoteControlFactory remoteControlFactory = new RemoteControlFactory(secondTvRemoteInput, mbrKeySender);

            HttpServer            _https = new HttpServer();
            MultiScreenController _msc   = new MultiScreenController();
            DlnaServer            _dlnas = new DlnaServer();
            DataLibrary           _dl    = new DataLibrary(_dispatcher);

            return(new TvDevice(deviceInfo, secondTv, playerNotification, secondTvRemoteInput, remoteControlFactory, dispatcher, _https, _msc, _dlnas, _dl));
        }