コード例 #1
0
ファイル: TSPref.cs プロジェクト: NOAME18/AE_Remap_Drei
        //----------------------------------------------------------------------
        public bool SaveToFile(string path)
        {
            if ((tsg == null) || (path == ""))
            {
                return(false);
            }
            string   s = "";
            TSParams p = new TSParams();

            s += p.Tag(TSParams.N.Left) + " = " + Left.ToString() + "\n";
            s += p.Tag(TSParams.N.Top) + " = " + Top.ToString() + "\n";
            s += p.Tag(TSParams.N.Height) + " = " + Height.ToString() + "\n";
            s += p.Tag(TSParams.N.CellCount) + " = " + tsg.tsd.CellCount.ToString() + "\n";
            s += p.Tag(TSParams.N.FrameCount) + " = " + tsg.tsd.FrameCount.ToString() + "\n";
            s += p.Tag(TSParams.N.CellWidth) + " = " + tsg.tsd.CellWidth.ToString() + "\n";
            s += p.Tag(TSParams.N.CellHeight) + " = " + tsg.tsd.CellHeight.ToString() + "\n";
            s += p.Tag(TSParams.N.FrameWidth) + " = " + tsg.tsd.FrameWidth.ToString() + "\n";
            s += p.Tag(TSParams.N.MemoWidth) + " = " + tsg.tsd.MemoWidth.ToString() + "\n";
            s += p.Tag(TSParams.N.CaptionHeight) + " = " + tsg.tsd.CaptionHeight.ToString() + "\n";
            s += p.Tag(TSParams.N.FrameOffset) + " = " + tsg.tsd.FrameOffset.ToString() + "\n";
            s += p.Tag(TSParams.N.ZeroStart) + " = " + tsg.tsd.ZeroStart.ToString() + "\n";
            s += p.Tag(TSParams.N.FrameDisp) + " = " + ((int)tsg.tsd.FrameDisp).ToString() + "\n";
            s += p.Tag(TSParams.N.SrcWidth) + " = " + tsg.tsd.SrcWidth.ToString() + "\n";
            s += p.Tag(TSParams.N.SrcHeight) + " = " + tsg.tsd.SrcHeight.ToString() + "\n";
            s += p.Tag(TSParams.N.PageSec) + " = " + ((int)tsg.tsd.PageSec).ToString() + "\n";
            s += p.Tag(TSParams.N.FrameRate) + " = " + ((int)tsg.tsd.FrameRate).ToString() + "\n";
            s += p.Tag(TSParams.N.SrcAspect) + " = " + tsg.tsd.SrcAspect.ToString() + "\n";
            s += p.Tag(TSParams.N.CmpAspect) + " = " + tsg.tsd.CmpAspect.ToString() + "\n";
            s += p.Tag(TSParams.N.AE_Vaersion) + " = " + tsg.tsd.AE_Vaersion.ToString() + "\n";
            s += p.Tag(TSParams.N.EmptyCell) + " = " + ((int)tsg.tsd.EmptyCell).ToString() + "\n";
            s += p.Tag(TSParams.N.remaping) + " = " + tsg.tsd.remaping.ToString() + "\n";
            s += p.Tag(TSParams.N.AutoInputStart) + " = " + tsg.tsd.AutoInputStart.ToString() + "\n";
            s += p.Tag(TSParams.N.AutoInputLast) + " = " + tsg.tsd.AutoInputLast.ToString() + "\n";
            s += p.Tag(TSParams.N.AutoInputKoma) + " = " + tsg.tsd.AutoInputKoma.ToString() + "\n";
            s += p.Tag(TSParams.N.SecInputMode) + " = " + tsg.tsd.SecInputMode.ToString() + "\n";
            s += p.Tag(TSParams.N.LastFrame) + " = " + tsg.tsd.LastFrame.ToString() + "\n";

            //書き込み先のテキストファイル
            System.Text.Encoding enc = System.Text.Encoding.GetEncoding("utf-8");

            System.IO.File.WriteAllText(path, s, enc);
            return(true);
        }
コード例 #2
0
ファイル: TSData.cs プロジェクト: NOAME18/AE_Remap_Drei
        public bool CompareTag(TSParams.N n)
        {
            TSParams p = new TSParams();

            return(string.Compare(p.Tag(n), this.tag, true) == 0);
        }
コード例 #3
0
ファイル: TSPref.cs プロジェクト: NOAME18/AE_Remap_Drei
        //----------------------------------------------------------------------
        public void ToData(List <ard_prms> lines)
        {
            if (lines.Count <= 0)
            {
                return;
            }
            if (tsg == null)
            {
                return;
            }
            TSParams p = new TSParams();

            for (int i = 0; i < lines.Count; i++)
            {
                if (lines[i].CompareTag(TSParams.N.Left))
                {
                    Left = lines[i].GetValueInt(60);
                }
                else if (lines[i].CompareTag(TSParams.N.Top))
                {
                    Top = lines[i].GetValueInt(60);
                }
                else if (lines[i].CompareTag(TSParams.N.Height))
                {
                    Height = lines[i].GetValueInt(300);
                }
                else if (lines[i].CompareTag(TSParams.N.CellCount))
                {
                    CellCount = lines[i].GetValueInt(TSdef.CellCount);
                }
                else if (lines[i].CompareTag(TSParams.N.FrameCount))
                {
                    FrameCount = lines[i].GetValueInt(TSdef.FrameCount);
                }
                else if (lines[i].CompareTag(TSParams.N.CellWidth))
                {
                    tsg.tsd.CellWidth = lines[i].GetValueInt(TSdef.CellWidth);
                }
                else if (lines[i].CompareTag(TSParams.N.CellHeight))
                {
                    tsg.tsd.CellHeight = lines[i].GetValueInt(TSdef.CellHeight);
                }
                else if (lines[i].CompareTag(TSParams.N.FrameWidth))
                {
                    tsg.tsd.FrameWidth = lines[i].GetValueInt(TSdef.FrameWidth);
                }
                else if (lines[i].CompareTag(TSParams.N.MemoWidth))
                {
                    tsg.tsd.MemoWidth = lines[i].GetValueInt(TSdef.MemoWidth);
                }
                else if (lines[i].CompareTag(TSParams.N.CaptionHeight))
                {
                    tsg.tsd.CaptionHeight = lines[i].GetValueInt(TSdef.CaptionHeight);
                }
                else if (lines[i].CompareTag(TSParams.N.FrameOffset))
                {
                    tsg.tsd.FrameOffset = lines[i].GetValueInt(TSdef.FrameOffset);
                }
                else if (lines[i].CompareTag(TSParams.N.ZeroStart))
                {
                    tsg.tsd.ZeroStart = lines[i].GetValueBool(TSdef.ZeroStart);
                }
                else if (lines[i].CompareTag(TSParams.N.FrameDisp))
                {
                    tsg.tsd.FrameDisp = (TSFrameDisp)lines[i].GetValueInt((int)TSdef.FrameDisp);
                }
                else if (lines[i].CompareTag(TSParams.N.SrcWidth))
                {
                    tsg.tsd.SrcWidth = lines[i].GetValueInt((int)TSdef.SrcWidth);
                }
                else if (lines[i].CompareTag(TSParams.N.SrcHeight))
                {
                    tsg.tsd.SrcHeight = lines[i].GetValueInt((int)TSdef.SrcHeight);
                }
                else if (lines[i].CompareTag(TSParams.N.PageSec))
                {
                    tsg.tsd.PageSec = (TSPageSec)(lines[i].GetValueInt((int)TSdef.PageSec));
                }
                else if (lines[i].CompareTag(TSParams.N.FrameRate))
                {
                    tsg.tsd.FrameRate = (TSFps)(lines[i].GetValueInt((int)TSdef.FrameRate));
                }
                else if (lines[i].CompareTag(TSParams.N.SrcAspect))
                {
                    tsg.tsd.SrcAspect = lines[i].GetValueFloat((int)TSdef.SrcAspect);
                }
                else if (lines[i].CompareTag(TSParams.N.CmpAspect))
                {
                    tsg.tsd.CmpAspect = lines[i].GetValueFloat((int)TSdef.CmpAspect);
                }
                else if (lines[i].CompareTag(TSParams.N.EmptyCell))
                {
                    tsg.tsd.EmptyCell = (EmptyCell)lines[i].GetValueInt((int)TSdef.EmptyCellDef);
                }
                else if (lines[i].CompareTag(TSParams.N.remaping))
                {
                    tsg.tsd.remaping = lines[i].GetValueBool(TSdef.remaping);
                }
                else if (lines[i].CompareTag(TSParams.N.AutoInputStart))
                {
                    tsg.tsd.AutoInputStart = lines[i].GetValueInt(TSdef.AutoInputStart);
                    if (tsg.tsd.AutoInputStart < 0)
                    {
                        tsg.tsd.AutoInputStart = 0;
                    }
                }
                else if (lines[i].CompareTag(TSParams.N.AutoInputLast))
                {
                    tsg.tsd.AutoInputLast = lines[i].GetValueInt(TSdef.AutoInputLast);
                    if (tsg.tsd.AutoInputLast < 0)
                    {
                        tsg.tsd.AutoInputLast = 0;
                    }
                }
                else if (lines[i].CompareTag(TSParams.N.AutoInputKoma))
                {
                    tsg.tsd.AutoInputKoma = lines[i].GetValueInt(TSdef.AutoInputKoma);
                    if (tsg.tsd.AutoInputKoma < 1)
                    {
                        tsg.tsd.AutoInputKoma = 1;
                    }
                }
                else if (lines[i].CompareTag(TSParams.N.SecInputMode))
                {
                    tsg.tsd.SecInputMode = lines[i].GetValueBool(TSdef.SecInputMode);
                }
                else if (lines[i].CompareTag(TSParams.N.LastFrame))
                {
                    tsg.tsd.LastFrame = lines[i].GetValueInt(TSdef.LastFrame);
                }
            }
        }