コード例 #1
0
        public ModelVolumeControlPreamp(Preamp aPreamp)
        {
            iPreamp = aPreamp;

            iVolumeLimiter = new VolumeLimiter(this);

            try
            {
                iServiceVolume = new ServiceVolume(iPreamp.Device, iPreamp.House.EventServer);
            }
            catch (ServiceException)
            {
                throw new ModelSourceException(301, "Service failure");
            }

            iActionSetMute   = iServiceVolume.CreateAsyncActionSetMute();
            iActionSetVolume = iServiceVolume.CreateAsyncActionSetVolume();
            iActionVolumeInc = iServiceVolume.CreateAsyncActionVolumeInc();
            iActionVolumeDec = iServiceVolume.CreateAsyncActionVolumeDec();
        }
コード例 #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();
            }
        }