コード例 #1
0
        public ModelSourceMediaRendererDs(Source aSource)
            : base(aSource)
        {
            iSource    = aSource;
            iInserting = false;

            try
            {
                iServicePlaylist = new ServicePlaylist(iSource.Device, iSource.House.EventServer);
            }
            catch (ServiceException)
            {
                throw new ModelSourceException(301, "Service failure");
            }

            iActionPlay               = iServicePlaylist.CreateAsyncActionPlay();
            iActionPause              = iServicePlaylist.CreateAsyncActionPause();
            iActionStop               = iServicePlaylist.CreateAsyncActionStop();
            iActionNext               = iServicePlaylist.CreateAsyncActionNext();
            iActionPrevious           = iServicePlaylist.CreateAsyncActionPrevious();
            iActionSeekSecondAbsolute = iServicePlaylist.CreateAsyncActionSeekSecondAbsolute();
            iActionSeekIndex          = iServicePlaylist.CreateAsyncActionSeekIndex();
            iActionDelete             = iServicePlaylist.CreateAsyncActionDeleteId();
            iActionDeleteAll          = iServicePlaylist.CreateAsyncActionDeleteAll();
            iActionSetRepeat          = iServicePlaylist.CreateAsyncActionSetRepeat();
            iActionSetShuffle         = iServicePlaylist.CreateAsyncActionSetShuffle();

            iIdArray = new ModelIdArray(new PlaylistIdArray(iServicePlaylist));
        }
コード例 #2
0
        public Playback(Helper aHelper, Device aDevice, EventServerUpnp aEventServer)
        {
            iLock        = new object();
            iHelper      = aHelper;
            iDevice      = aDevice;
            iEventServer = aEventServer;

            if (iDevice.HasService(ServicePlaylist.ServiceType(1)) > 0)
            {
                iServicePlaylist = new ServicePlaylist(iDevice, iEventServer);
                iServicePlaylist.EventInitial += EventHandlerPlaylistInitial;
                iActionInsert    = iServicePlaylist.CreateAsyncActionInsert();
                iActionPlay      = iServicePlaylist.CreateAsyncActionPlay();
                iActionSetRepeat = iServicePlaylist.CreateAsyncActionSetRepeat();
                iActionDeleteAll = iServicePlaylist.CreateAsyncActionDeleteAll();
            }

            if (iDevice.HasService(ServiceProduct.ServiceType(1)) > 0)
            {
                iServiceProduct = new ServiceProduct(iDevice, iEventServer);
                iServiceProduct.EventInitial += EventHandlerProductInitial;
                iActionStandby              = iServiceProduct.CreateAsyncActionStandby();
                iActionSetStandby           = iServiceProduct.CreateAsyncActionSetStandby();
                iActionSetSourceIndex       = iServiceProduct.CreateAsyncActionSetSourceIndex();
                iActionSourceIndex          = iServiceProduct.CreateAsyncActionSourceIndex();
                iActionSetSourceIndexByName = iServiceProduct.CreateAsyncActionSetSourceIndexByName();
            }

            if (iDevice.HasService(ServiceVolume.ServiceType(1)) > 0)
            {
                iServiceVolume = new ServiceVolume(iDevice, iEventServer);
                iServiceVolume.EventInitial += EventHandlerVolumeInitial;
                iActionVolumeInc             = iServiceVolume.CreateAsyncActionVolumeInc();
                iActionVolumeDec             = iServiceVolume.CreateAsyncActionVolumeDec();
            }
        }