public Group(Room aRoom, Layer1.IGroup aGroup) { iRoom = aRoom; iGroup = aGroup; iSourceList = new List <Source>(); iMasterGroup = this; if (iGroup.Preamp != null) { iPreamp = new Preamp(this, iGroup.Preamp); iMasterPreamp = iPreamp; } else { iMasterPreamp = null; } InitialiseSources(); iGroup.EventSourceChanged += SourceChanged; iGroup.EventCurrentSourceChanged += CurrentSourceChanged; iGroup.EventStandbyChanged += StandbyChanged; }
public ModelVolumeControlUpnpAv(Preamp aPreamp) { iPreamp = aPreamp; iInstanceId = 0; iVolumeLimiter = new VolumeLimiter(this); try { iServiceRenderingControl = new ServiceRenderingControl(aPreamp.Device, aPreamp.House.EventServer); } catch (ServiceException) { throw new ModelSourceException(301, "Service failure"); } iActionSetMute = iServiceRenderingControl.CreateAsyncActionSetMute(); iActionSetVolume = iServiceRenderingControl.CreateAsyncActionSetVolume(); }
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(); }
internal void SetPreamp(Preamp aPreamp) { Lock(); if (iPreamp != aPreamp) { iPreamp = aPreamp; Unlock(); Trace.WriteLine(Trace.kTopology, "House Preamp* " + this); if (EventPreampChanged != null) { EventPreampChanged(this, EventArgs.Empty); } } else { Unlock(); } }
internal void SetCurrentSourceAndPreamp(Source aSource) { Preamp preamp = null; Lock(); if (iCurrent != aSource) { iCurrent = aSource; if (iCurrent != null) { preamp = iCurrent.MasterPreamp; } Unlock(); SetPreamp(preamp); Trace.WriteLine(Trace.kTopology, "House Source* " + this); if (EventCurrentChanged != null) { EventCurrentChanged(this, EventArgs.Empty); } } else { if (iCurrent != null) { preamp = iCurrent.MasterPreamp; } Unlock(); SetPreamp(preamp); } }