Ejemplo n.º 1
0
        protected void mediaRendererFoundSink(CpAVRenderer _avRenderer)
        {
            Renderer.Renderer   renderer;

            this.writeLog(LogType.Info, String.Format("MediaRenderer '{0}' gefunden (UDN: {1})", _avRenderer.FriendlyName, _avRenderer.UniqueDeviceName));

            if (_avRenderer.isVirtualRenderer())
            {
                renderer = new RendererVirtual(_avRenderer);
                if (renderers.ContainsKey(renderer.udn))
                    renderers.Remove(renderer.udn);
                renderers.Add(renderer.udn, renderer);
                this.linkVirtualRendererToZone((RendererVirtual)renderer);
            }
            else
            {
                renderer = new RendererRoom(_avRenderer);
                if (renderers.ContainsKey(renderer.udn))
                    renderers.Remove(renderer.udn);
                renderers.Add(renderer.udn, renderer);
                this.linkRoomRendererToRoom((RendererRoom)renderer);
            }

            renderer.muteStateChanged += renderer_muteStateChangedSink;
            renderer.volumeChanged += renderer_volumeChangedSink;

            if (mediaRendererFound != null) mediaRendererFound();
        }
Ejemplo n.º 2
0
        public void linkRoomRendererToRoom(RendererRoom _roomRenderer, Boolean _unlink = false, Boolean _crossLink = true)
        {
            Room room;
            ZoneManager zoneManager = Global.getZoneManager();

            // the renderer id is given by the xml we get from the zoneInformation
            room = zoneManager.getRoomByRendererUDN(_roomRenderer.getRendererObject().UniqueDeviceName);
            if (room != null)
            {
                if (_unlink)
                    room.rendererUDN = String.Empty;
                else
                    room.rendererUDN = _roomRenderer.udn;
                room.rendererLinked();
                //zoneManager.updateRoomsValue(room);
                if (_crossLink)
                    zoneManager.linkRoomToRoomRenderer(room, _unlink, false);

                if (_unlink == true)
                    this.writeLog(LogType.Info, String.Format("Renderer '{1}' wurde von Raum '{0}' entfernt", room.name, _roomRenderer.udn));
                else
                    this.writeLog(LogType.Info, String.Format("Renderer '{1}' wurde zu Raum '{0}' zugeordnet", room.name, _roomRenderer.udn));
            }
            else
            {
                this.writeLog(LogType.Warning, String.Format("Kein Raum für Renderer '{0}' für Zuordnung gefunden", _roomRenderer.getRendererObject().UniqueDeviceName));
            }
        }