コード例 #1
0
ファイル: House2.cs プロジェクト: daviddw/oss-public
        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;
        }
コード例 #2
0
ファイル: House2.cs プロジェクト: daviddw/oss-public
        internal bool Remove(Layer1.IGroup aGroup)
        {
            foreach (Group group in iGroupList)
            {
                if (group.Represents(aGroup))
                {
                    Source parent = group.Parent;

                    if (parent != null)
                    {
                        if (iCurrent != null)
                        {
                            if (iCurrent.Group == group)
                            {
                                SetCurrentSourceAndPreamp(parent);
                            }
                        }

                        parent.DeregisterChild(group);
                    }
                    else
                    {
                        if (iCurrent != null)
                        {
                            if (iCurrent.Group == group)
                            {
                                SetCurrentSourceAndPreamp(null);
                            }
                        }
                    }

                    Lock();

                    iGroupList.Remove(group);

                    Unlock();

                    group.Kill();
                    group.EventStandbyChanged -= StandbyChanged;

                    return(iGroupList.Count == 0);
                }
            }
            return(false);
        }
コード例 #3
0
ファイル: House2.cs プロジェクト: daviddw/oss-public
        internal void Add(Layer1.IGroup aGroup)
        {
            Group group = new Group(this, aGroup);

            if (iGroupList.Count > 0)
            {
                HookUpParent(group);
            }
            else
            {
                SetCurrentSourceAndPreamp(group.CurrentSource);
            }

            Lock();

            iGroupList.Add(group);

            Unlock();
            group.EventStandbyChanged += StandbyChanged;
        }
コード例 #4
0
ファイル: House2.cs プロジェクト: daviddw/oss-public
 public bool Represents(Layer1.IGroup aGroup)
 {
     return(iGroup == aGroup);
 }