private void _StartRecord(TriggerType status)
 {
     Task.Run(() => StreamStatusChanged?.Invoke(this, new StreamStatusChangedArgs()
     {
         type = status
     }));
 }
 private void Obs_StreamStatus(OBSWebsocket sender, StreamStatus status)
 {
     lastStreamStatus = DateTime.Now;
     IsStreaming      = status.Streaming;
     IsRecording      = status.Recording;
     StreamStatusChanged?.Invoke(this, new StreamStatusEventArgs(status));
 }
        private void Receiver_ReceivedDanmaku(object sender, ReceivedDanmakuArgs e)
        {
            switch (e.Danmaku.MsgType)
            {
            case MsgTypeEnum.LiveStart:
                Task.Run(() => StreamStatusChanged?.Invoke(this, new StreamStatusChangedArgs()
                {
                    type = TriggerType.Danmaku
                }));
                break;

            case MsgTypeEnum.LiveEnd:
                break;

            default:
                break;
            }
        }
        public void Check(TriggerType type, int millisecondsDelay = 0)
        {
            if (disposedValue)
            {
                throw new ObjectDisposedException(nameof(StreamMonitor));
            }

            if (millisecondsDelay < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(millisecondsDelay), "不能小于0");
            }

            Task.Run(() =>
            {
                Task.Delay(millisecondsDelay).Wait();
                if (BililiveAPI.GetRoomInfo(Roomid).isStreaming)
                {
                    StreamStatusChanged?.Invoke(this, new StreamStatusChangedArgs()
                    {
                        type = type
                    });
                }
            });
        }