public static RecInfo Read(string filePath)
    {
        XmlDocument Document = new XmlDocument();

        Document.Load(filePath);
        XmlElement InfoElement = Document["Info"];

        char sp = ',';

        RecInfo Info = new RecInfo();

        Info.SceneName     = InfoElement.GetAttribute("SceneName");
        Info.CharacterName = InfoElement.GetAttribute("CharacterName");
        string[] sppos = InfoElement.GetAttribute("ch_pos").Split(sp);
        float[]  fpos  = new float[sppos.Length];
        for (int i = 0; i < sppos.Length; i++)
        {
            fpos[i] = System.Convert.ToSingle(sppos[i]);
        }
        Info.ch_pos = new Vector3(fpos[0], fpos[1], fpos[2]);
        string[] sprot = InfoElement.GetAttribute("ch_rot").Split(sp);
        float[]  frot  = new float[sprot.Length];
        for (int i = 0; i < sprot.Length; i++)
        {
            frot[i] = System.Convert.ToSingle(sprot[i]);
        }
        Info.ch_rot = new Vector3(frot[0], frot[1], frot[2]);

        return(Info);
    }
Exemplo n.º 2
0
        public FormRecSettings(string projfolder, RecInfo ri)
        {
            InitializeComponent();
            this.ProjectRoot    = projfolder;
            tb_recdatetime.Text = ri.recordname.Substring(0, 8);
            tb_recsuffix.Text   = ri.recordname.Substring(9);
            tb_filename.Text    = ri.antigenelistfile;
            if (ri.meanmethod == "UK")
            {
                rbtn_UK.Checked = true;
            }
            else
            {
                rbtn_DE.Checked = true;
            }

            if (ri.invglobalhandling == "Yes")
            {
                rbtn_invyes.Checked = true;
            }
            else
            {
                rbtn_invno.Checked = true;
            }
        }
Exemplo n.º 3
0
        public override String ConvertInfoText(object param = null)
        {
            if (RecInfo == null)
            {
                return("");
            }
            //
            var mode = param is Int32 ? (Int32)param : Settings.Instance.RecInfoToolTipMode;

            if (mode == 1)
            {
                return(RecInfo.ProgramInfo);
            }

            String view = CommonManager.ConvertTimeText(RecInfo.StartTime, RecInfo.DurationSecond, false, false, false) + "\r\n";

            view += ServiceName + "(" + NetworkName + ")" + "\r\n";
            view += EventName + "\r\n\r\n";

            view += "録画結果 : " + Result + "\r\n";
            view += "録画ファイルパス : " + RecFilePath + "\r\n";
            view += ConvertDropText() + "\r\n";
            view += ConvertScrambleText() + "\r\n\r\n";

            view += CommonManager.Convert64PGKeyString(RecInfo.Create64PgKey());

            return(view);
        }
Exemplo n.º 4
0
        void reAddRowMenu_Click(object sender, EventArgs e)
        {
            if (recList.SelectedCells.Count == 0)
            {
                return;
            }
            var selectedCell = recList.SelectedCells[0];
            var ri           = (RecInfo)recListDataSource[selectedCell.RowIndex];

            if (ri.state == "録画中")
            {
                MessageBox.Show("録画中は再登録できません", "", MessageBoxButtons.OK, MessageBoxIcon.None);

                /*
                 * DialogResult res = MessageBox.Show("録画中ですが中断しますか?", "確認", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                 * if (res == DialogResult.No) return;
                 * try {
                 *      ri.process.Kill();
                 * } catch (Exception ee) {
                 *      util.debugWriteLine("reAdd kill exception " + ee.Message + ee.Source + ee.StackTrace + ee.TargetSite);
                 * }
                 */
                return;
            }
            var _ri = new RecInfo(ri.id, ri.url, ri.rdg, ri.afterConvertType, ri.tsConfig, ri.timeShift, ri.quality, ri.qualityRank, ri.recComment, ri.isChase);

            Task.Run(() => _ri.setHosoInfo(this));

            recListDataSource[selectedCell.RowIndex] = _ri;
            resetBindingList(selectedCell.RowIndex);
            displayRiInfo(_ri);
        }
Exemplo n.º 5
0
    /*public void SendWordSelectionAllRounds()
     * {
     *  string url = GameSettings.POSTPublishScoreURL + GameSettings.username + "&type=" + GameSettings.selected_mode;
     *  sfAll.cycle_id = GameInfo.info.cycle_id;
     *
     *  if (GameSettings.selected_mode.Equals(GameSettings.MODE_CHOOSE))
     *  {
     *      FillScoreFormAllRoundForChoose(sfAll);
     *  } else if(GameSettings.selected_mode.Equals(GameSettings.MODE_DRAG))
     *  {
     *      FillScoreFormAllRoundForDrag(sfAll);
     *  } else if(GameSettings.selected_mode.Equals(GameSettings.MODE_INSERT))
     *  {
     *      FillScoreFormAllRoundForInsert(sfAll);
     *  }
     *
     *  string json = JsonUtility.ToJson(sfAll);
     *  GameSettings.MyDebug(json);
     *
     *  StartCoroutine(PostRequest(url, json));
     * }*/



    /*void FillScoreFormAllRoundForChoose(ScoreFormAll sf)
     * {
     *  for (int i = 0; i < GameInfo.info.number_of_rounds; i++)
     *  {
     *      sf.words[i] = new WordFormAll();
     *      sf.words[i].word = GameInfo.info.words[i].word;
     *      sf.words[i].buttons = new string[GameInfo.info.max_select];
     *      for (int j = 0; j < GameInfo.info.max_select; j++)
     *      {
     *          sf.words[i].buttons[j] = GameInfo.selectedWords[i, j];
     *      }
     *  }
     * }*/



    /*void FillScoreFormAllRoundForDrag(ScoreFormAll sf)
     * {
     *  for (int i = 0; i < 2*GameInfo.info.number_of_rounds; i++)
     *  {
     *      sf.words[i] = new WordFormAll();
     *      sf.words[i].word = GameInfo.info.words[i].word;
     *      sf.words[i].buttons = new string[GameInfo.info.buttons_number];
     *      for (int j = 0; j < GameInfo.info.buttons_number; j++)
     *      {
     *          sf.words[i].buttons[j] = GameInfo.selectedWords[i, j];
     *      }
     *
     *
     *  }
     * }*/



    /*void FillScoreFormAllRoundForInsert(ScoreFormAll sf)
     * {
     *  for (int i = 0; i < GameInfo.info.number_of_rounds; i++)
     *  {
     *      sf.words[i] = new WordFormAll();
     *      sf.words[i].word = GameInfo.info.words[i].word;
     *      sf.words[i].buttons = new string[GameInfo.info.max_select];
     *      for (int j = 0; j < GameInfo.info.max_select; j++)
     *      {
     *          sf.words[i].buttons[j] = GameInfo.selectedWords[i, j];
     *      }
     *  }
     * }*/


    IEnumerator PostRequest(string url, string json)
    {
        var uwr = new UnityWebRequest(url, "POST");

        byte[] jsonToSend = new System.Text.UTF8Encoding().GetBytes(json);
        uwr.uploadHandler      = (UploadHandler) new UploadHandlerRaw(jsonToSend);
        uwr.downloadHandler    = (DownloadHandler) new DownloadHandlerBuffer();
        uwr.certificateHandler = new AcceptAllCertificatesSignedWithASpecificKeyPublicKey();
        uwr.SetRequestHeader("Content-Type", "application/json");
        {
            //Send the request then wait here until it returns
            uwr.timeout = 5;
            yield return(uwr.SendWebRequest());

            if (uwr.isNetworkError || uwr.isHttpError)
            {
                if (uwr.isHttpError)
                {
                    SceneSwitcher.LoadScene2Back2(GameSettings.COMPETITIVE_MODE_SELECTION_MENU);
                }
                else
                {
                    StartCoroutine(PostRequest(url, json));
                    GameSettings.MyDebug("Error While Sending: " + uwr.error);
                }
            }
            else
            {
                if (GameSettings.THEMATIC)
                {
                    GameSettings.numberOfPlayedRounds += 1;
                }

                RecInfo recInfo = new RecInfo();
                recInfo = JsonUtility.FromJson <RecInfo>(uwr.downloadHandler.text);
                GameSettings.MyDebug("Received: " + uwr.downloadHandler.text);

                /*int output = System.Int32.Parse(Regex.Replace(recInfo.success, "[^0-9]+", string.Empty));
                 * GameInfoInsert.score = output;*/
                if (GameSettings.CURRENT_MODE.Equals(GameSettings.GAME_MODE_INSERT))
                {
                    GameInfoInsert.SetRoundOverInfo(uwr.downloadHandler.text);

                    GameSettings.MyDebug(JsonUtility.ToJson(GameInfoInsert.rec));
                }

                if (GameSettings.CURRENT_MODE.Equals(GameSettings.GAME_MODE_SYNONYM))
                {
                    GameInfoSynonym.SetRoundOverInfo(uwr.downloadHandler.text);

                    GameSettings.MyDebug(JsonUtility.ToJson(GameInfoSynonym.rec));
                }

                dataReceived = true;
            }
        }
    }
Exemplo n.º 6
0
        private void frm_EditRec_EditRecUpdated(object sender, NewRecUpdateEventArgs e)
        {
            RecInfo ri = new RecInfo();

            ri.recordname        = e.RecName;
            ri.antigenelistfile  = e.AntigeneListFile;
            ri.meanmethod        = e.MeanMethod;
            ri.invglobalhandling = e.InvHandling;

            Records.UpdateRecord(LastRightClickedNode.Text, ri);
        }
Exemplo n.º 7
0
        public bool add(string t)
        {
            util.debugWriteLine("rlm add");

            var lvid = util.getRegGroup(t, "(lv\\d+(,\\d+)*)");
            //util.setLog(cfg, lv);

            var url = "";

            if (lvid != null)
            {
                url = "https://live2.nicovideo.jp/watch/" + lvid;

                try {
                    if (bool.Parse(cfg.get("IsDuplicateConfirm")))
                    {
                        var delList = new List <RecInfo>();
                        foreach (RecInfo d in recListData)
                        {
                            if (d.id == lvid)
                            {
                                delList.Add(d);
                            }
                        }

                        foreach (var _ri in delList)
                        {
                            if (MessageBox.Show(_ri.id + "はリスト内に含まれています。既にある行を削除しますか?\n[" + _ri.quality + "] [" + _ri.timeShift + "]", "確認", MessageBoxButtons.YesNo) == DialogResult.Yes)
                            {
                                form.deleteRow(_ri);
                            }
                        }
                    }
                } catch (Exception e) {
                    util.debugWriteLine(e.Message + e.Source + e.StackTrace + e.TargetSite);
                }
            }
            else
            {
                MessageBox.Show("not found lvID");
                return(false);
            }
            //if (lvid != null) form.urlText.Text = "https://cas.nicovideo.jp/user/77252622/lv313508832";

            var rdg = new RecDataGetter(this);
            var ri  = new RecInfo(lvid, t, rdg, form.afterConvertModeList.Text, form.setTsConfig, form.setTimeshiftBtn.Text, form.qualityBtn.Text, form.qualityRank, form.recCommmentList.Text, form.isChaseChkBox.Checked);

            Task.Run(() => ri.setHosoInfo(form));

            form.addList(ri);

            return(true);
        }
Exemplo n.º 8
0
 private bool isListTop(int nowIndex)
 {
     for (var i = 0; i < nowIndex; i++)
     {
         RecInfo ri = (RecInfo)rlm.recListData[i];
         if (ri.state == "待機中")
         {
             return(false);
         }
     }
     return(true);
 }
Exemplo n.º 9
0
 private void readResProcess(string res, StreamWriter w, RecInfo ri)
 {
     if (res.StartsWith("info"))
     {
         setInfo(res, ri);
         return;
     }
     if (res.StartsWith("msgbox:"))
     {
         //showMsgBox(res);
     }
 }
Exemplo n.º 10
0
        public RecInfo GetRecordInfo(string recordname)
        {
            RecInfo ri = new RecInfo();

            int rowindex = FindRecordIndexByName(recordname);

            ri.recordname        = Data.Rows[rowindex]["RecordName"].ToString();
            ri.antigenelistfile  = Data.Rows[rowindex]["AntigeneListFile"].ToString();
            ri.meanmethod        = Data.Rows[rowindex]["MeanMethod"].ToString();
            ri.invglobalhandling = Data.Rows[rowindex]["InvGlobalHandling"].ToString();

            return(ri);
        }
Exemplo n.º 11
0
        private void startRecProcess(RecInfo ri)
        {
            util.debugWriteLine("startrecprocess " + ri);
            try {
                ri.process = new Process();
                var si = new ProcessStartInfo();
                si.FileName = "ニコ生新配信録画ツール(仮.exe";
                //si.FileName = "nicoNewStreamRecorderKakkoKari.exe";
                var isGetComment = (ri.recComment == "映像+コメント" || ri.recComment == "コメントのみ") ? " -IsgetComment=true" : " -IsgetComment=false";
                var isGetRec     = (ri.recComment == "映像+コメント" || ri.recComment == "映像のみ") ?
                                   ((rlm.cfg.get("EngineMode") == "3") ? " -EngineMode=0" : "") :
                                   " -EngineMode=3";

                si.Arguments  = "-nowindo -stdIO -IsmessageBox=false";
                si.Arguments += " -IscloseExit=true " + ri.id;
                si.Arguments += " -ts-start=" + ri.tsConfig.startTimeStr;
                si.Arguments += " -ts-end=" + ri.tsConfig.endTimeSeconds + "s";
                si.Arguments += " -ts-list=" + ri.tsConfig.isOutputUrlList.ToString().ToLower();
                si.Arguments += " -ts-list-m3u8=" + ri.tsConfig.isM3u8List.ToString().ToLower();
                si.Arguments += " -ts-list-update=" + (int)ri.tsConfig.m3u8UpdateSeconds;
                si.Arguments += " -ts-list-open=" + ri.tsConfig.isOpenUrlList.ToString().ToLower();
                si.Arguments += " -ts-list-command=\"" + ri.tsConfig.openListCommand + "\"";
                si.Arguments += " -ts-vpos-starttime=" + ri.tsConfig.isVposStartTime.ToString().ToLower();
                si.Arguments += " -ts-starttime-comment=" + ri.tsConfig.isAfterStartTimeComment.ToString().ToLower();
                si.Arguments += " -ts-endtime-comment=" + ri.tsConfig.isBeforeEndTimeComment.ToString().ToLower();
                si.Arguments += " -ts-starttime-open=" + ri.tsConfig.isOpenTimeBaseStartArg.ToString().ToLower();
                si.Arguments += " -ts-endtime-open=" + ri.tsConfig.isOpenTimeBaseEndArg.ToString().ToLower();
                si.Arguments += " -afterConvertMode=" + ri.getAfterConvertTypeNum();
                si.Arguments += " -qualityRank=" + ri.qualityRank;
                si.Arguments += " -std-read ";
                si.Arguments += isGetComment + isGetRec;
                if (ri.isChase)
                {
                    si.Arguments += " -chase ";
                }

                util.debugWriteLine(si.Arguments);
                //si.CreateNoWindow = true;
                si.UseShellExecute = false;
                //si.WindowStyle = ProcessWindowStyle.Hidden;
                si.RedirectStandardInput  = true;
                si.RedirectStandardOutput = true;
                si.RedirectStandardError  = true;
                ri.process.StartInfo      = si;
                ri.process.Start();
            } catch (Exception e) {
                rlm.form.addLogText("ニコ生新配信録画ツール(仮.exeを呼び出せませんでした");
                util.debugWriteLine("process start exception " + e.Message + e.Source + e.StackTrace + e.TargetSite);
            }
        }
Exemplo n.º 12
0
    public void OnClickSave()
    {
        playerCtrl = GameObject.FindWithTag("Player").GetComponent <PlayerCtrl>();
        game       = GameObject.FindWithTag("World").GetComponent <Game>();

        RecInfo info = new RecInfo();

        info.SceneName     = game.SceneName;
        info.CharacterName = playerCtrl.CharacterName;
        info.ch_pos        = playerCtrl.ch_pos;
        info.ch_rot        = playerCtrl.ch_rot;

        SaveLoadData.Write(info, Application.dataPath + "/Output/Info_Attributes.xml");
    }
Exemplo n.º 13
0
        private int getRecordingNum(int count, BindingSource list)
        {
            var c = 0;

            for (var i = 0; i < count; i++)
            {
                RecInfo ri = (RecInfo)rlm.recListData[i];
                if (ri.state == "録画中")
                {
                    c++;
                }
            }
            return(c);
        }
Exemplo n.º 14
0
 public void updateRecListCell(RecInfo ri)
 {
     formAction(() => {
         var i = recListDataSource.IndexOf(ri);
         if (i == -1)
         {
             return;
         }
         var cellNum = recList.Columns.Count;
         for (var j = 0; j < cellNum; j++)
         {
             recList.UpdateCellValue(j, i);
         }
     });
 }
Exemplo n.º 15
0
        int _lastPulseIndex;         // We inherit from AGATPulseClient to receive pulses in OnPulse.
        // The last pulse index is stored to display a rec count down in OnGUI.

        void Start()
        {
            // Compute how many samples are needed for one loop at current bpm and sample rate
            int numSamples = ( int )(GATInfo.OutputSampleRate * (Pulse.Period * Pulse.Steps.Length));

            // Setup the Rec objects which will allocate caches
            _recs = new RecInfo[_numTracks];

            for (int i = 0; i < _numTracks; i++)
            {
                _recs[i] = new RecInfo(numSamples, 1, i + 1);
            }

            // Grab track and filter info, and re-route mic data if needed
            UpdateCurrentTrack();
        }
Exemplo n.º 16
0
        private void recProcess(RecInfo ri)
        {
            util.debugWriteLine("recProcess " + ri.id);
//			ri.state = "録画中";
            var row = rlm.recListData.IndexOf(ri);

            if (row == -1)
            {
                return;
            }
            rlm.form.resetBindingList(row, "状態", "録画中");
            startRecProcess(ri);
            var r = ri.process.StandardOutput;
            var w = ri.process.StandardInput;

            try {
                while (!ri.process.HasExited && rlm.rdg == this)
                {
                    var res = r.ReadLine();
                    if (res == null)
                    {
                        break;
                    }
                    util.debugWriteLine("res " + res);

                    readResProcess(res, w, ri);
                }
                util.debugWriteLine("recProcess loop end wait mae " + ri.id + " " + ri.state);
                ri.process.WaitForExit();
                ri.state = (ri.process.ExitCode == 5) ? "録画完了" : "録画失敗";
            } catch (Exception e) {
                util.debugWriteLine("ri " + ri + " ri.process " + (ri.process == null ? null : ri.process));
                if (ri != null && ri.process != null)
                {
                    util.debugWriteLine(ri.process.HasExited + " " + ri.process.ExitCode);
                }
                util.debugWriteLine(e.Message + e.Source + e.StackTrace + e.TargetSite);
                ri.state = "録画終了";
            }

            util.debugWriteLine("recProcess loop end wait go " + ri.id + " " + ri.state);
            row = rlm.recListData.IndexOf(ri);
            rlm.form.resetBindingList(row);
        }
Exemplo n.º 17
0
        private void frm_NewRec_NewRecUpdated(object sender, NewRecUpdateEventArgs e)
        {
            RecInfo ri = new RecInfo();
            //string ProjName = ExtractProjectName(LastRightClickedNode.Text);
            string ProjName = LastRightClickedNode.Text;

            ri.recordname        = e.RecName;
            ri.owner             = ProjName;
            ri.antigenelistfile  = e.AntigeneListFile;
            ri.meanmethod        = e.MeanMethod;
            ri.invglobalhandling = e.InvHandling;

            //add project root only once per project session
            if (Records.ProjectRoot.Length == 0)
            {
                Records.ProjectRoot = this.ProjectRoot;
            }
            Records.AddNewRecord(ri);
        }
Exemplo n.º 18
0
        public void clearRiInfo(RecInfo ri)
        {
            startTimeLabel.Text    = "";
            endTimeLabel.Text      = "";
            programTimeLabel.Text  = "";
            keikaTimeLabel.Text    = "";
            titleLabel.Text        = "";
            hostLabel.Text         = "";
            communityLabel.Text    = "";
            urlLabel.Text          = "";
            communityUrlLabel.Text = "";
            descriptLabel.Text     = "";
//			qualityLabel.Text = "";
//			timeshiftLabel.Text = "";
//			afterConvertModeLabel.Text = "";
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
            samuneBox.Image = ((System.Drawing.Image)(resources.GetObject("samuneBox.Image")));
            logText.Text    = "";
        }
Exemplo n.º 19
0
 private void displayKeikaTime(RecInfo ri)
 {
     this.Invoke((MethodInvoker) delegate() {
         keikaTimeLabel.Text = "";
         keikaTimeLabel.Text = ri.keikaTime;
     });
     while (ri == displayingRi && (ri.state == "録画中" || ri.state == "待機中"))
     {
         if (ri.keikaTimeStart == DateTime.MinValue)
         {
             Thread.Sleep(500);
             continue;
         }
         var keikaDt = DateTime.Now - ri.keikaTimeStart;
         this.Invoke((MethodInvoker) delegate() {
             keikaTimeLabel.Text = keikaDt.ToString("h'時間'mm'分'ss'秒'");
             ri.keikaTime        = keikaTimeLabel.Text;
         });
         Thread.Sleep(500);
     }
 }
Exemplo n.º 20
0
        public void UpdateRecord(string recordname, RecInfo ri)
        {
            int rowindex = FindRecordIndexByName(recordname);

            Data.Rows[rowindex]["RecordName"]        = ri.recordname;
            Data.Rows[rowindex]["AntigeneListFile"]  = ri.antigenelistfile;
            Data.Rows[rowindex]["MeanMethod"]        = ri.meanmethod;
            Data.Rows[rowindex]["InvGlobalHandling"] = ri.invglobalhandling;

            DataSet ds = new DataSet();

            ds.ReadXml(this.ProjectRoot + "\\Info\\" + ri.antigenelistfile);

            int i = 0;

            foreach (DataRow drs in ds.Tables[0].Rows)
            {
                Data.Rows[rowindex][5 + i] = drs["Spot Name"].ToString();
                i++;
            }
        }
    public static void Write(RecInfo Info, string filePath)
    {
        StrRecInfo sri = new StrRecInfo();

        XmlDocument Document    = new XmlDocument();
        XmlElement  InfoElement = Document.CreateElement("Info");

        Document.AppendChild(InfoElement);

        //Info.SceneName을 숫자로 처리하는 방법이 있나?

        /*for(int i = 0; i < StrRecInfo.INFOCOUNT; i++)
         * {
         *  InfoElement.SetAttribute(sri[i], Info.???);
         * }*/
        InfoElement.SetAttribute(sri[0], Info.SceneName);
        InfoElement.SetAttribute(sri[1], Info.CharacterName);
        InfoElement.SetAttribute(sri[2], Info.ch_pos.x.ToString() + "," + Info.ch_pos.y.ToString() + "," + Info.ch_pos.z.ToString());
        InfoElement.SetAttribute(sri[3], Info.ch_rot.x.ToString() + "," + Info.ch_rot.y.ToString() + "," + Info.ch_rot.z.ToString());
        Document.Save(filePath);
    }
Exemplo n.º 22
0
        public bool deleteRow(RecInfo ri)
        {
            if (ri.state == "録画中")
            {
                //MessageBox.Show("録画中は登録できません", "", MessageBoxButtons.OK, MessageBoxIcon.None);

                DialogResult res = MessageBox.Show("録画中ですが中断しますか?", "確認", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (res == DialogResult.No)
                {
                    return(false);
                }
                try {
                    ri.process.Kill();
                } catch (Exception ee) {
                    util.debugWriteLine("reAdd kill exception " + ee.Message + ee.Source + ee.StackTrace + ee.TargetSite);
                }
            }
            recListDataSource.Remove(ri);
            //recList.Rows.RemoveAt(selectedCell.RowIndex);
            //resetBindingList(selectedCell.RowIndex);
            return(true);
        }
Exemplo n.º 23
0
        public void AddNewRecord(RecInfo ri)
        {
            DataRow dr = Data.NewRow();

            dr["RecordName"]        = ri.recordname;
            dr["Owner"]             = ri.owner;
            dr["AntigeneListFile"]  = ri.antigenelistfile;
            dr["MeanMethod"]        = ri.meanmethod;
            dr["InvGlobalHandling"] = ri.invglobalhandling;

            DataSet ds = new DataSet();

            ds.ReadXml(this.ProjectRoot + "\\Info\\" + ri.antigenelistfile);

            int i = 0;

            foreach (DataRow drs in ds.Tables[0].Rows)
            {
                dr[5 + i] = drs["Spot Name"].ToString();
                i++;
            }
            Data.Rows.Add(dr);
        }
Exemplo n.º 24
0
 public void saveList()
 {
     try {
         var list = new List <RecInfo>();
         foreach (RecInfo ri in recListDataSource)
         {
             var _ri = new RecInfo(ri.id, ri.url, ri.rdg, ri.afterConvertType, ri.tsConfig, ri.timeShift, ri.quality, ri.qualityRank, ri.recComment, ri.isChase);
             _ri.samune        = null;
             _ri.process       = null;
             _ri.rdg           = null;
             _ri.title         = ri.title;
             _ri.state         = ri.state;
             _ri.host          = ri.host;
             _ri.communityName = ri.communityName;
             _ri.startTime     = ri.startTime;
             //_ri.keikaTime = ri.keikaTime;
             _ri.keikaTimeStart = ri.keikaTimeStart;
             _ri.endTime        = ri.endTime;
             _ri.programTime    = ri.programTime;
             _ri.communityUrl   = ri.communityUrl;
             _ri.description    = ri.description;
             _ri.log            = ri.log;
             _ri.samuneUrl      = ri.samuneUrl;
             list.Add(_ri);
         }
         var json = JToken.FromObject(list).ToString(Formatting.None);
         var f    = util.getJarPath()[0] + "/recList.ini_";
         var sw   = new StreamWriter(f, false);
         sw.Write(json);
         sw.Close();
         File.Copy(f, f.Substring(0, f.Length - 1), true);
         File.Delete(f);
     } catch (Exception e) {
         util.debugWriteLine(e.Message + e.Source + e.StackTrace + e.TargetSite);
     }
 }
Exemplo n.º 25
0
        public void displayRiInfo(RecInfo ri, string ctrl = null, string val = null)
        {
            var isChange = displayingRi != ri;

            displayingRi = ri;
            //util.debugWriteLine("display c " + recList.RowCount + " " + recListDataSource.Count);

            this.Invoke((MethodInvoker) delegate() {
                if (ctrl == "startTime" || ctrl == null)
                {
                    startTimeLabel.Text = ri.startTime;
                }
                if (ctrl == "endTime" || ctrl == null)
                {
                    endTimeLabel.Text = ri.endTime;
                }
                if (ctrl == "programTime" || ctrl == null)
                {
                    programTimeLabel.Text = ri.programTime;
                }

                if (ctrl == "keikaTime" || ctrl == null)
                {
                    if (isChange)
                    {
                        Task.Run(() => displayKeikaTime(ri));
//						Task.Run(() => util.debugWriteLine("aa"));
                    }
                }

                if (ctrl == "title" || ctrl == null)
                {
                    titleLabel.Text = ri.title;
                }
                if (ctrl == "host" || ctrl == null)
                {
                    hostLabel.Text = ri.host;
                }
                if (ctrl == "communityName" || ctrl == null)
                {
                    communityLabel.Text = ri.communityName;
                }
                if (ctrl == "url" || ctrl == null)
                {
                    urlLabel.Text = ri.url;
                }
                if (ctrl == "communityUrl" || ctrl == null)
                {
                    communityUrlLabel.Text = ri.communityUrl;
                }
                if (ctrl == "description" || ctrl == null)
                {
                    descriptLabel.Text = ri.description;
                }
//				if (ctrl == "quality" || ctrl == null) qualityLabel.Text = ri.quality;
//				if (ctrl == "timeshift" || ctrl == null) timeshiftLabel.Text = ri.timeShift;
//				if (ctrl == "afterConvertMode" || ctrl == null) afterConvertModeLabel.Text = ri.afterConvertType;
                if ((ctrl == "samuneUrl" || ctrl == null) && ri.samune != null)
                {
                    samuneBox.Image = ri.samune;
                }
                if (ctrl == "log" || ctrl == null)
                {
                    setLogText(ri.log);
                }
            });
        }
Exemplo n.º 26
0
 public void addList(RecInfo ri)
 {
     Invoke((MethodInvoker) delegate() {
         recListDataSource.Add(ri);
     });
 }
Exemplo n.º 27
0
        public void rec()
        {
            var maxRecordingNum = int.Parse(rlm.cfg.get("rokugaTourokuMaxRecordingNum"));

            while (true)
            {
                try {
                    var isAllEnd = true;

                    var _count = rlm.form.getRecListCount();
                    util.debugWriteLine("rlm.reclistdata.count " + _count + " reclist count " + rlm.form.recList.Rows.Count);
                    for (var i = 0; i < _count; i++)
                    {
                        if (rlm.rdg == null)
                        {
                            return;
                        }

                        util.debugWriteLine("i " + i + " count " + _count);
                        RecInfo ri = (RecInfo)rlm.recListData[i];
                        util.debugWriteLine(i + " " + ri);

                        if (ri == null)
                        {
                            continue;
                        }
                        if (ri.state == "待機中" || ri.state == "録画中")
                        {
                            isAllEnd = false;
                        }
                        if (ri.state != "待機中")
                        {
                            continue;
                        }

                        if (getRecordingNum(_count, rlm.recListData) < maxRecordingNum &&
                            isListTop(i))
                        {
                            ri.state = "録画中";
                            Task.Run(() => { recProcess(ri); });
                        }
                        Thread.Sleep(2000);
                    }
                    util.debugWriteLine(isAllEnd);
                    if (isAllEnd)
                    {
                        break;
                    }

                    if (isChangeList)
                    {
                        rlm.form.saveList();
                    }
                    isChangeList = false;
                } catch (Exception e) {
                    util.debugWriteLine("rdg rec exception " + e.Message + e.Source + e.StackTrace + e.TargetSite);
                }


                Thread.Sleep(1000);
            }
            util.debugWriteLine("rec rdg end");
        }
Exemplo n.º 28
0
        // The last pulse index is stored to display a rec count down in OnGUI.
        void Start()
        {
            // Compute how many samples are needed for one loop at current bpm and sample rate
            int numSamples = ( int )( GATInfo.OutputSampleRate * ( Pulse.Period * Pulse.Steps.Length ) );

            // Setup the Rec objects which will allocate caches
            _recs = new RecInfo[ _numTracks ];

            for( int i = 0; i < _numTracks; i++ )
            {
                _recs[ i ] = new RecInfo( numSamples, 1, i + 1 );
            }

            // Grab track and filter info, and re-route mic data if needed
            UpdateCurrentTrack();
        }
Exemplo n.º 29
0
        private void setInfo(string res, RecInfo ri)
        {
            if (res.StartsWith("info.title:"))
            {
                ri.title = util.getRegGroup(res, ":(.*)");
            }
            if (res.StartsWith("info.host:"))
            {
                ri.host = util.getRegGroup(res, ":(.*)");
            }
            if (res.StartsWith("info.communityName:"))
            {
                ri.communityName = util.getRegGroup(res, ":(.*)");
            }
            if (res.StartsWith("info.url:"))
            {
                ri.url = util.getRegGroup(res, ":(.*)");
            }
            if (res.StartsWith("info.communityUrl:"))
            {
                ri.communityUrl = util.getRegGroup(res, ":(.*)");
            }
            if (res.StartsWith("info.description:"))
            {
                ri.description = util.getRegGroup(res, ":(.*)");
            }
            if (res.StartsWith("info.startTime:"))
            {
                ri.startTime = util.getRegGroup(res, ":(.*)");
            }
            if (res.StartsWith("info.endTime:"))
            {
                ri.endTime = util.getRegGroup(res, ":(.*)");
            }
            if (res.StartsWith("info.programTime:"))
            {
                ri.programTime = util.getRegGroup(res, ":(.*)");
            }
            if (res.StartsWith("info.keikaTime:"))
            {
                ri.keikaTimeStart = DateTime.Parse(util.getRegGroup(res, ":(.*)"));
            }
            else
            {
                isChangeList = true;
            }
            if (res.StartsWith("info.samuneUrl:"))
            {
                ri.samuneUrl = util.getRegGroup(res, ":(.*)");
                ri.samune    = util.getSamune(ri.samuneUrl);
            }
            if (res.StartsWith("info.log:"))
            {
                if (ri.log != "")
                {
                    ri.log += "\r\n";
                }
                ri.log += util.getRegGroup(res, ":(.*)");
            }
            var ctrl = util.getRegGroup(res, "\\.(.+?):");
            var val  = util.getRegGroup(res, ":(.+)");

            var row = rlm.recListData.IndexOf(ri);

            if (row == -1)
            {
                return;
            }
            rlm.form.resetBindingList(row);

            var _count           = rlm.form.getRecListCount();
            var selectedRow0     = rlm.form.getRecListSelectedCount();
            var selectedRowIndex = (selectedRow0 > 0) ? rlm.form.recList.SelectedCells[0].RowIndex : -1;

            util.debugWriteLine("setinfo c " + _count + " selected rowindex " + selectedRow0);
            try {
                if (selectedRow0 > 0 &&
                    rlm.recListData[rlm.form.recList.SelectedCells[0].RowIndex] == ri)
                {
                    rlm.form.displayRiInfo(ri, ctrl, val);
                }
            } catch (ArgumentOutOfRangeException e) {
                util.debugWriteLine(e.Message + e.ParamName + e.StackTrace + e.TargetSite);
                util.debugWriteLine("exception ok インデックスが範囲を超えています。負でない値で、コレクションのサイズよりも小さくなければなりません。");
            } catch (Exception e) {
                util.debugWriteLine(e.Message + e.Source + e.StackTrace + e.TargetSite);
            }
            util.debugWriteLine("setinfo ok");
        }