// plays selected track from currently selected playlist
        protected void zoneTracklistPlaySelectedTrack()
        {
            if (ZoneTracklistControl.SelectedItem == null)
            {
                return;
            }
            MediaItem_Track trackItem       = (MediaItem_Track)ZoneTracklistControl.SelectedItem;
            RendererVirtual rendererVirtual = rfController.rendererManager.getRendererByZoneUDN(currentSelectedZoneUDN);

            if (rendererVirtual == null)
            {
                return;
            }
            rendererVirtual.playTrack(trackItem.listIndex);
        }
Beispiel #2
0
        override protected void listActionDone()
        {
            int             trackIndex;
            RendererVirtual renderer = (RendererVirtual)Global.getRendererManager().getRendererByZoneUDN(zoneUDN);

            base.listActionDone();

            // search track in list
            trackIndex = this.getListPositionOfObjectId(objectIdTmp);
            if (trackIndex == -1)
            {
                if (this.list.Count == 0)
                {
                    renderer.getRendererObject().Connections[0].SetAvTransportUri("", "");
                    currentTrackIndexPlaying = 0;
                }
                else
                {
                    if (this.list.Count < currentTrackIndexPlaying)
                    {
                        currentTrackIndexPlaying = this.list.Count;
                    }
                    else if (currentTrackIndexPlaying < 0)
                    {
                        currentTrackIndexPlaying = 0;
                    }
                    // Track was not found. Play next one
                    renderer.playTrack(currentTrackIndexPlaying);
                    //this.setTrackNrPlaying((int)trackNrPlaying);
                }
            }
            else
            {
                currentTrackIndexPlaying = trackIndex;
                renderer.getRendererObject().Connections[0].BendAvTransportUri(this.buildAvTransportUri(), containerInfoMetaData);
            }

            this.setListItemSelectedForPlaying();
        }