Esempio n. 1
0
        protected IEnumerable <WebServiceSet> ComposeAll()
        {
            List <WebServiceSet> sets       = new List <WebServiceSet>();
            IPEndPoint           tveAddress = hinter.GetConfiguredTVServerAddress();
            string tveAddressInSet          = tveAddress != null?tveAddress.ToString() : null;

            IMetaService tveMeta = tveAddress != null?ServiceClientFactory.CreateMeta(tveAddress) : null;

            // Start with the most simple case: full singleseat
            if (HasActiveMAS && HasActiveTAS && HasActiveWSS)
            {
                sets.Add(CreateServiceSet(
                             OurAddress,
                             HasActiveTAS ? OurAddress : null,
                             HasActiveUI ? OurAddress : null
                             ));
            }

            // Singleseat installation without using TV server
            if (HasActiveMAS && HasActiveWSS)
            {
                sets.Add(CreateServiceSet(OurAddress, null, HasActiveUI ? OurAddress : null));
            }

            // Multiseat installation with UI + MAS + WSS on client and TAS + WSS on server (and we're the client)
            if (HasActiveMAS && HasActiveWSS && !HasActiveTAS && tveMeta != null)
            {
                if (!tveMeta.GetActiveServices().Contains(WebService.MediaAccessService) &&
                    !tveMeta.HasUI())
                {
                    sets.Add(CreateServiceSet(OurAddress, tveAddressInSet, HasActiveUI ? OurAddress : null));
                }
            }

            // Same as previous, but now we're the server
            if (HasActiveTAS && HasActiveWSS && !HasActiveMAS)
            {
                sets.Add(CreateServiceSet(null, OurAddress, null));
            }

            // Multiseat installation with MAS + TAS + WSS on server and only UI on the client (we're the client)
            if (HasActiveUI && !HasActiveMAS && !HasActiveTAS && !HasActiveWSS && tveMeta != null)
            {
                if (tveMeta.GetActiveServices().Contains(WebService.MediaAccessService))
                {
                    sets.Add(CreateServiceSet(tveAddressInSet, tveAddressInSet, OurAddress));
                }
            }

            // Idem, but now we're the server
            if (HasActiveMAS && HasActiveTAS && HasActiveWSS)
            {
                sets.Add(CreateServiceSet(OurAddress, OurAddress, null));
            }

            // TODO: external WSS

            return(sets);
        }