示例#1
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();
            }
        }