Beispiel #1
0
        public new async Task <bool> AddChannel(string channel)
        {
            await base.AddChannel(channel);

            if (!Config.Contains(Config.SwitchOnJoin))
            {
                Config.SetBoolean(Config.SwitchOnJoin, true);
            }

            if (ChannelList.Contains(channel) && Config.GetBoolean(Config.SwitchOnJoin) && !IsBouncer)
            {
                MainPage.instance.SwitchChannel(Server.Name, channel, true);
            }

            return(ChannelList.Contains(channel));
        }
Beispiel #2
0
        public void SwitchChannel(string channel)
        {
            if (channel != null && ChannelList.Contains(channel))
            {
                if (currentChannel != null)
                {
                    ChannelList[currentChannel].CurrentlyViewing = false;
                }
                currentChannel = channel;
                ircMessages    = (ChannelList[channel].Buffers as UWPBuffer).Collection;
                ChannelList[channel].CurrentlyViewing = true;
                return;
            }

            currentChannel = "Server";
            ircMessages    = (ChannelList.ServerLog.Buffers as UWPBuffer).Collection;
        }
Beispiel #3
0
        public void SwitchChannel(string channel)
        {
            if (channel == null)
            {
                return;
            }

            if (ChannelList.Contains(channel))
            {
                if (currentChannel != null)
                {
                    ChannelList[currentChannel].CurrentlyViewing = false;
                }
                currentChannel = channel;
                ircMessages    = ChannelList[channel].Buffers as MessageCollection;
                ChannelList[channel].CurrentlyViewing = true;
            }
        }
Beispiel #4
0
 public bool CheckChannel(Channel channel)
 {
     Debug.Assert(!channel.Name.Contains(splitChar), "频道名称应不含换行符");
     return(ChannelList.Contains(channel));
 }
Beispiel #5
0
        public void Evaluate(int SpreadMax)
        {
            #region Reset the mixer
            if (this.FPinInChanCount.PinIsChanged || this.FPinInIsDecoding.PinIsChanged)
            {
                while (this.FMixerInfo.Streams.Count > 0)
                {
                    this.FMixerInfo.DetachChannel(this.FMixerInfo.Streams[0]);
                }

                if (this.FMixerInfo.InternalHandle != 0)
                {
                    if (this.FMixerInfo.BassHandle != null)
                    {
                        bool free = Bass.BASS_StreamFree(this.FMixerInfo.BassHandle.Value);
                    }
                    this.manager.Delete(this.FMixerInfo.InternalHandle);
                }

                ChannelList channels = this.ListChannels();

                double numchans;
                this.FPinInChanCount.GetValue(0, out numchans);

                double decoding;
                this.FPinInIsDecoding.GetValue(0, out decoding);

                double isplay;
                this.FPinInPlay.GetValue(0, out isplay);

                MixerChannelInfo newmixerinfo = new MixerChannelInfo();
                newmixerinfo.IsDecoding = decoding == 1;
                newmixerinfo.NumChans   = Convert.ToInt32(numchans);
                newmixerinfo.Play       = isplay == 1;
                this.manager.CreateChannel(newmixerinfo);

                this.FMixerInfo = newmixerinfo;

                foreach (ChannelInfo info in this.ListChannels())
                {
                    this.FMixerInfo.AttachChannel(info);
                }

                this.FPinOutHandle.SetValue(0, this.FMixerInfo.InternalHandle);
            }
            #endregion

            #region Update Mixer pins
            bool update = false;
            foreach (IValueIn pin in this.FPinHandles)
            {
                if (pin.PinIsChanged)
                {
                    update = true;
                }
            }

            #region Update Channels
            if (update)
            {
                ChannelList channels = this.ListChannels();

                ChannelList todetach = new ChannelList();

                foreach (ChannelInfo info in this.FMixerInfo.Streams)
                {
                    if (!channels.Contains(info))
                    {
                        todetach.Add(info);
                    }
                }

                foreach (ChannelInfo info in todetach)
                {
                    this.FMixerInfo.DetachChannel(info);
                }

                foreach (ChannelInfo info in channels)
                {
                    if (!this.FMixerInfo.Streams.Contains(info))
                    {
                        this.FMixerInfo.AttachChannel(info);
                        UpdateMatrix(this.FMixerInfo.Streams.IndexOf(info));
                    }
                }
            }
            #endregion


            for (int i = 0; i < this.FPinLevels.Count; i++)
            {
                if (this.FPinLevels[i].PinIsChanged)
                {
                    UpdateMatrix(i);
                }
            }
            #endregion

            if (this.FPinInPlay.PinIsChanged)
            {
                double isplay;
                this.FPinInPlay.GetValue(0, out isplay);
                this.FMixerInfo.Play = isplay == 1;
            }
        }