PeerCastStation.Core.AccessController.IsChannelPlayable C# (CSharp) Метод

IsChannelPlayable() публичный Метод

指定したチャンネルに新しい視聴接続ができるかどうかを取得します
public IsChannelPlayable ( Channel channel ) : bool
channel Channel 視聴接続先のチャンネル
Результат bool
    public virtual bool IsChannelPlayable(Channel channel)
    {
      int channel_bitrate = channel.ChannelInfo.Bitrate;
      var total_upstream_rate = PeerCast.Channels.Sum(c => c.OutputStreams.Sum(o => o.IsLocal ? 0 : o.UpstreamRate));
      var channel_upstream_rate = channel.OutputStreams.Sum(o => o.IsLocal ? 0 : o.UpstreamRate);
      return
        (this.MaxPlays<=0 || this.MaxPlays>PeerCast.Channels.Sum(c => c.LocalDirects)) &&
        (this.MaxPlaysPerChannel<=0 || this.MaxPlaysPerChannel>channel.LocalDirects) &&
        (this.MaxUpstreamRate<0 || this.MaxUpstreamRate>=total_upstream_rate+channel_bitrate) &&
        (this.MaxUpstreamRatePerChannel<=0 || this.MaxUpstreamRatePerChannel>=channel_upstream_rate+channel_bitrate);
    }

Same methods

AccessController::IsChannelPlayable ( Channel channel, IOutputStream output_stream ) : bool