Esempio n. 1
0
 private void checkBox1_CheckedChanged(object sender, EventArgs e)
 {
     if (checkBox1.Checked)
     {
         aa = new B_Live(int.Parse(textBox2.Text));
         aa.RecordStatusChanged += RecordStatus_Changed;
         aa.ReadyToRecord(textBox1.Text);
     }
 }
Esempio n. 2
0
        private void MyTimerCallBack(object state)
        {
            if (Status == StatusCode.Waiting)
            {
                switch (StartMode)
                {
                case StartModeType.WhenStart:
                    switch (Platform)
                    {
                    case PlatformType.None:
                        break;

                    case PlatformType.Bilibili:
                        if (B_Live.IsLiving(URL))
                        {
                            VideoUrl = B_Live.GetVideoURL(URL);
                            StartRecord();
                        }
                        break;

                    case PlatformType.Douyu:
                        break;

                    case PlatformType.Huya:
                        break;

                    case PlatformType.Panda:
                        break;

                    default:
                        break;
                    }
                    break;

                case StartModeType.WhenTime:
                    string DayOfWeekString = GetTodayDay();

                    if (Frequency.Contains("每天") || Frequency.Contains(DayOfWeekString) || (Frequency.Contains("仅一次") && Status == StatusCode.Waiting))
                    {
                        if (StartTime.Hour == DateTime.Now.Hour && StartTime.Minute == DateTime.Now.Minute && StartTime.Second == DateTime.Now.Second)
                        {
                            StartRecord();
                        }
                    }

                    break;

                default:
                    break;
                }
            }
        }
Esempio n. 3
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (textBox1.Text == "" || textBox2.Text == "")
     {
         MessageBox.Show("参数不能为空!");
     }
     else
     {
         aa = new B_Live(int.Parse(textBox2.Text));
         aa.RecordStatusChanged += RecordStatus_Changed;
         aa.StartRecord(textBox1.Text);
     }
 }
Esempio n. 4
0
        /// <summary>
        /// 开始录制
        /// </summary>
        public void StartRecord(bool IsManuelStart = false)
        {
            if (StartMode != StartModeType.WhenStart)
            {
                switch (Platform)
                {
                case PlatformType.None:
                    break;

                case PlatformType.Bilibili:
                    if (B_Live.IsLiving(URL))
                    {
                        VideoUrl = B_Live.GetVideoURL(URL);
                    }
                    else
                    {
                        StartMode = StartModeType.WhenStart;
                        MyTimer.Change(1000, 1000);
                        if (IsManuelStart)
                        {
                            System.Windows.Forms.MessageBox.Show("直播未开始,任务已切换至“直播开始时开始录制”模式。");
                        }
                        return;
                    }
                    break;

                case PlatformType.Douyu:
                    break;

                case PlatformType.Huya:
                    break;

                case PlatformType.Panda:
                    break;

                default:
                    break;
                }
            }

            Status = StatusCode.Recording;

            Recorder = new Thread(DoRecord);
            IsRecorderAbortRequested = false;
            Recorder.Start();
        }
Esempio n. 5
0
        /// <summary>
        /// URL解析
        /// </summary>
        /// <param name="URL"></param>
        /// <returns></returns>
        public static void AnalysisURL(string URL, ref Cls_WorkListItem item)
        {
            if (URL.Length == 0)
            {
                return;
            }
            Regex reg = new Regex("[^\\s]/\\d+");

            if (URL.Contains("live.bilibili.com") && reg.Match(URL).Success)
            {
                item.URL = URL;
                B_Live.GetRoomInfo(ref item);
            }
            else
            {
                item.Platform = Cls_WorkListItem.PlatformType.None;
                item.CallPropertyChanged("RoomInfoLong");
            }
        }
Esempio n. 6
0
        /// <summary>
        /// 是否在播查询
        /// </summary>
        /// <returns>是否在播</returns>
        private bool IsLiving()
        {
            switch (Platform)
            {
            case PlatformType.None:
                return(false);

            case PlatformType.Bilibili:
                return(B_Live.IsLiving(URL));

            case PlatformType.Douyu:
                return(false);

            case PlatformType.Huya:
                return(false);

            case PlatformType.Panda:
                return(false);

            default:
                return(false);
            }
        }