Exemplo n.º 1
0
        public TunerMon()
        {
            InitializeComponent();

            try
            {
                EnableDoubleBuffer(serviceView);

                DefineFile def = Program.StateDef;
                this.Left   = def["tunermon.window.left"].ToInt();
                this.Top    = def["tunermon.window.top"].ToInt();
                this.Width  = def["tunermon.window.width"].ToInt();
                this.Height = def["tunermon.window.height"].ToInt();
                this.split1.SplitterDistance = def["tunermon.window.tuner.width"].ToInt();
                this.split2.SplitterDistance = def["tunermon.window.tuner.height"].ToInt();
                this.nameHeader.Width        = def["tunermon.window.service.name.width"].ToInt();
                this.timeHeader.Width        = def["tunermon.window.service.time.width"].ToInt();
                this.eventHeader.Width       = def["tunermon.window.service.event.width"].ToInt();
                this.Visible = def["tunermon.window.visible"] == "1";

                sql = new Sql(true);
                InitTunerView();
                this.ActiveControl = tunerView;
                if (this.tunerView.Nodes.Count > 0)
                {
                    this.tunerView.SelectedNode = this.tunerView.Nodes[0];
                }
            }
            catch (Exception e)
            {
                MessageBox.Show("エラーが発生しました。[詳細] " + e.Message);
            }
        }
Exemplo n.º 2
0
        //チューナ更新
        public static void Update(Sql sql)
        {
            var def = new DefineFile(System.IO.Path.Combine(Util.GetUserPath(), "tuner.def"));

            def.Load();

            sql.Text = "delete from tuner";
            sql.Execute();

            foreach (var name in def.Keys)
            {
                var tuner = new Tuner(name, def[name]);

                tuner.Add(sql);
            }
        }
Exemplo n.º 3
0
        static void LoadDef()
        {
            Util.CopyUserFile();

            UserDef = new DefineFile(Path.Combine(Util.GetUserPath(), "Tvmaid.def"));
            UserDef.Load();
            StateDef = new DefineFile(Path.Combine(Util.GetUserPath(), "Tvmaid.state.def"));
            StateDef.Load();

            if (File.Exists(UserDef["tvtest"]) == false)
            {
                throw new AppException("TVTestのパスが設定されていないか、間違っています。tvtest");
            }
            if (Directory.Exists(UserDef["record.folder"]) == false)
            {
                throw new AppException("録画フォルダのパスが設定されていないか、間違っています。record.folder");
            }
            int ret;

            if (Int32.TryParse(UserDef["record.margin.start"], out ret) == false)
            {
                throw new AppException("録画マージンは数値を指定してください。record.margin.start");
            }
            if (Int32.TryParse(UserDef["record.margin.end"], out ret) == false)
            {
                throw new AppException("録画マージンは数値を指定してください。record.margin.end");
            }
            //mark10als
            string recfile = Program.UserDef["record.file"];

            if (recfile == null)
            {
                throw new AppException("録画ファイル名が設定されていません。record.file");
            }
            if (Int32.TryParse(UserDef["epg.autoupdate.hour"], out ret) == false)
            {
                throw new AppException("番組表取得時刻は数値を指定してください。epg.autoupdate.hour");
            }
        }