예제 #1
0
        public defaultFFplayController(config.config config, Process process, play.Player player)
        {
            this.config  = config;
            this.process = process;
            this.player  = player;
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();

            try {
                StartPosition = FormStartPosition.Manual;
                this.Location = new Point(int.Parse(config.get("defaultControllerX")),
                                          int.Parse(config.get("defaultControllerY")));
//				Left = int.Parse(config.get("X"));
//				Top = int.Parse(config.get("Y"));
            } catch (Exception e) {
                util.debugWriteLine(e.Message + " " + e.StackTrace + " " + e.Source + " " + e.TargetSite);
            }

            volumeBarArea.Width = int.Parse(config.get("volume"));
            volumeTip.Text      = "音量:" + volumeBarArea.Width;

            timeLabel.Paint    += timeBorderPaint;
            volumeTip.Paint    += volumeTipBorderPaint;
            muteTip.Paint      += muteTipBorderPaint;
            reconnectTip.Paint += reconnectTipBorderPaint;
            //
            // TODO: Add constructor code after the InitializeComponent() call.
            //
        }
예제 #2
0
        void OpenAppliMenuClick(object sender, EventArgs e)
        {
            var i    = ((ToolStripMenuItem)sender).Name[9];
            var path = config.get("appli" + i.ToString() + "Path");
            var url  = "https://live2.nicovideo.jp/watch/lv" + util.getRegGroup(ri.lvId, "(\\d+)");
            var args = config.get("appli" + i.ToString() + "Args");

            appliProcess(path, url + " " + args);
        }
예제 #3
0
        public TimeShiftOptionForm(string[] lastFileTime,
                                   string segmentSaveType, config.config config, bool isChase, int prepTime, bool isFmp4)
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();

            this.lastFileTime    = lastFileTime;
            this.segmentSaveType = segmentSaveType;

            setLastFileTime(lastFileTime);
            isRenketuLastFile.Visible = (segmentSaveType == "0");

            /*
             * var isUrlList = bool.Parse(config.get("IsUrlList"));
             * var openListCommand = config.get("openUrlListCommand");
             *
             * isUrlListChkBox.Checked = isUrlList;
             * openListCommandText.Text = openListCommand;
             * openListCommandText.Enabled = isUrlList;
             *
             * if (bool.Parse(config.get("IsM3u8List")))
             *      isM3u8RadioBtn.Checked = true;
             * updateListSecondText.Text = config.get("M3u8UpdateSeconds");
             * isOpenListCommandChkBox.Checked = bool.Parse(config.get("IsOpenUrlList"));
             * updateIsM3u8RadioBtn_CheckedChanged();
             * updateIsOpenListCommandChkBoxCheckedChanged();
             * updateUrlListChkBoxCheckedChanged();
             */
            isSetVposStartTime.Checked            = bool.Parse(config.get("IsVposStartTime"));
            isAfterStartTimeCommentChkBox.Checked = bool.Parse(config.get("IsAfterStartTimeComment"));
            isBeforeEndTimeCommentChkBox.Checked  = bool.Parse(config.get("IsBeforeEndTimeComment"));
            isDeletePosTimeChkBox.Checked         = bool.Parse(config.get("tsIsDeletePosTime"));
            updateTimeShiftStartTimeChkBox();
            updateIsManualEndTimeRadioBtn();
            this.config = config;
            this.isFmp4 = isFmp4;

            if (isChase)
            {
                Text = "追っかけ録画設定";
                isFromLastTimeRadioBtn.Visible = false;
                lastFileInfoLabel.Visible      = false;
                isRenketuLastFile.Visible      = false;
                openLastFileBtn.Visible        = false;
            }
            if (prepTime > 0)
            {
                isOpenTimeBaseStartChkBox.Visible   =
                    isOpenTimeBaseEndChkBox.Visible = true;
                this.prepTime = prepTime;
            }
            util.setFontSize(int.Parse(config.get("fontSize")), this, false);
        }
        private void setFormFromConfig()
        {
            var startMode = config.get("tsStartTimeMode");

            if (startMode == "0")
            {
                isMostStartTimeRadioBtn.Checked = true;
            }
            else if (startMode == "1")
            {
                isStartTimeRadioBtn.Checked = true;
            }
            else
            {
                isFromLastTimeRadioBtn.Checked = true;
            }
            if (config.get("tsEndTimeMode") == "0")
            {
                isEndTimeRadioBtn.Checked = true;
            }
            else
            {
                isManualEndTimeRadioBtn.Checked = true;
            }

            var startSeconds = int.Parse(config.get("tsStartSecond"));

            hText.Text = ((int)(startSeconds / 3600)).ToString();
            mText.Text = ((int)((startSeconds % 3600) / 60)).ToString();
            sText.Text = ((int)((startSeconds % 60) / 1)).ToString();
            var endSeconds = int.Parse(config.get("tsEndSecond"));

            endHText.Text                         = ((int)(endSeconds / 3600)).ToString();
            endMText.Text                         = ((int)((endSeconds % 3600) / 60)).ToString();
            endSText.Text                         = ((int)((endSeconds % 60) / 1)).ToString();
            isRenketuLastFile.Checked             = bool.Parse(config.get("tsIsRenketu"));
            isSetVposStartTime.Checked            = bool.Parse(config.get("IsVposStartTime"));
            isAfterStartTimeCommentChkBox.Checked = bool.Parse(config.get("IsAfterStartTimeComment"));
            isBeforeEndTimeCommentChkBox.Checked  = bool.Parse(config.get("IsBeforeEndTimeComment"));

            if (prepTime > 0)
            {
                isOpenTimeBaseStartChkBox.Checked = bool.Parse(config.get("tsBaseOpenTimeStart"));
                isOpenTimeBaseEndChkBox.Checked   = bool.Parse(config.get("tsBaseOpenTimeStart"));
            }
        }
예제 #5
0
        public optionForm(config.config cfg, MainForm form)
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            this.StartPosition = FormStartPosition.CenterParent;
            //util.debugWriteLine(p.X + " " + p.Y);
            InitializeComponent();
            //this.Location = p;
            this.cfg  = cfg;
            this.form = form;

            nicoSessionComboBox1.Selector.PropertyChanged += Selector_PropertyChanged;
            setBackColor(Color.FromArgb(int.Parse(cfg.get("alartBackColor"))));
            setForeColor(Color.FromArgb(int.Parse(cfg.get("alartForeColor"))));

            util.setFontSize(int.Parse(cfg.get("fontSize")), this, false);
        }
예제 #6
0
//		private string

        public optionForm(config.config cfg)
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            this.StartPosition = FormStartPosition.CenterParent;
            //util.debugWriteLine(p.X + " " + p.Y);
            InitializeComponent();
            //this.Location = p;
            this.cfg = cfg;

            nicoSessionComboBox1.Selector.PropertyChanged += Selector_PropertyChanged;
//			nicoSessionComboBox2.Selector.PropertyChanged += Selector2_PropertyChanged;
            setFormFromConfig();

            setBackColor(Color.FromArgb(int.Parse(cfg.get("recBackColor"))));
            setForeColor(Color.FromArgb(int.Parse(cfg.get("recForeColor"))));
        }
예제 #7
0
        public VersionForm(config.config config, MainForm form)
        {
            this.config = config;
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();
            this.form = form;
            //
            // TODO: Add constructor code after the InitializeComponent() call.
            //
            versionLabel.Text = util.versionStr + " (" + util.versionDayStr + ")";
            //communityLinkLabel.Links.Add(0, communityLinkLabel.Text.Length, "https://com.nicovideo.jp/community/co2414037");

            util.setFontSize(int.Parse(config.get("fontSize")), this, false);
            lastVersionLabel.Font = new Font(lastVersionLabel.Font, FontStyle.Italic);
        }
예제 #8
0
        public TimeShiftOptionForm(string[] lastFileTime,
                                   string segmentSaveType, config.config config)
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();

            this.lastFileTime    = lastFileTime;
            this.segmentSaveType = segmentSaveType;

            if (lastFileTime != null)
            {
                lastFileInfoLabel.Text = "(" + lastFileTime[0] +
                                         "時間" + lastFileTime[1] + "分" + lastFileTime[2] + "秒まで録画済み)";
            }
            else
            {
                lastFileInfoLabel.Text         = "(前回の録画ファイルが見つかりませんでした)";
                isRenketuLastFile.Enabled      = false;
                isFromLastTimeRadioBtn.Enabled = false;
            }
            //isRenketuLastFile.Visible = (segmentSaveType == "0");
            updateTimeShiftStartTimeChkBox();

            var isUrlList       = bool.Parse(config.get("IsUrlList"));
            var openListCommand = config.get("openUrlListCommand");

            isUrlListChkBox.Checked     = isUrlList;
            openListCommandText.Text    = openListCommand;
            openListCommandText.Enabled = isUrlList;

            if (bool.Parse(config.get("IsM3u8List")))
            {
                isM3u8RadioBtn.Checked = true;
            }
            updateListSecondText.Text       = config.get("M3u8UpdateSeconds");
            isOpenListCommandChkBox.Checked = bool.Parse(config.get("IsOpenUrlList"));
            isSetVposStartTime.Checked      = bool.Parse(config.get("IsVposStartTime"));

            updateIsM3u8RadioBtn_CheckedChanged();
            updateIsOpenListCommandChkBoxCheckedChanged();
            updateUrlListChkBoxCheckedChanged();
            this.config = config;
        }
예제 #9
0
        public commentForm(config.config config, MainForm form)
        {
            this.config = config;
            this.form   = form;
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();
            try {
                StartPosition = FormStartPosition.Manual;

                Location = new Point(int.Parse(config.get("defaultCommentFormX")),
                                     int.Parse(config.get("defaultCommentFormY")));
                Width  = int.Parse(config.get("defaultCommentFormWidth"));
                Height = int.Parse(config.get("defaultCommentFormHeight"));
            } catch (Exception e) {
                util.debugWriteLine("comment foerm init " + e.Message + " " + e.StackTrace + " " + e.Source + " " + e.TargetSite);
            }

            commentList.DefaultCellStyle.SelectionBackColor = commentList.DefaultCellStyle.BackColor;
            commentList.DefaultCellStyle.SelectionForeColor = Color.FromArgb(114, 114, 114);

            visitLabel.Text   = form.visitLabel.Text;
            commentLabel.Text = form.commentLabel.Text;
            if (form.rec.communityNum != null)
            {
                communityLabel.Text = form.rec.communityNum;
            }

            is184ChkBox.Checked = bool.Parse(config.get("Is184"));

            Task.Run(() => connectMessageServer());
            //
            // TODO: Add constructor code after the InitializeComponent() call.
            //
            util.setFontSize(int.Parse(config.get("fontSize")), this, false);
        }
        public MainForm(string[] args)
        {
            string lv = null;

            foreach (var arg in args)
            {
                lv = util.getRegGroup(arg, "(lv\\d+(,\\d+)*)");
                if (lv != null)
                {
                    break;
                }
            }
            util.setLog(config, lv);

            madeThread = Thread.CurrentThread;

            //read std
            if (Array.IndexOf(args, "-std-read") > -1)
            {
                startStdRead();
            }

            System.Diagnostics.Debug.Listeners.Clear();
            System.Diagnostics.Debug.Listeners.Add(new Logger.TraceListener());

            InitializeComponent();
            Text    = "ニコ生新配信録画ツール(仮 " + util.versionStr;
            defIcon = Icon;

            this.args = args;

            rec    = new rec.RecordingManager(this, config);
            player = new Player(this, config);

            if (Array.IndexOf(args, "-stdIO") > -1)
            {
                util.isStdIO = true;
            }

            util.debugWriteLine("arg len " + args.Length);
            util.debugWriteLine("arg join " + string.Join(" ", args));

            var fontSize = config.get("fontSize");

            if (fontSize != "9")
            {
                util.setFontSize(int.Parse(fontSize), this, true, 400);
            }

            try {
                Width  = int.Parse(config.get("Width"));
                Height = int.Parse(config.get("Height"));
            } catch (Exception e) {
                util.debugWriteLine(e.Message + " " + e.StackTrace + " " + e.Source + " " + e.TargetSite);
            }

            try {
                if (bool.Parse(config.get("IsRestoreLocation")))
                {
                    var x = config.get("X");
                    var y = config.get("Y");
                    if (x != "" && y != "" && int.Parse(x) >= 0 && int.Parse(y) >= 0)
                    {
                        StartPosition = FormStartPosition.Manual;
                        Location      = new Point(int.Parse(x), int.Parse(y));
                    }
                }
            } catch (Exception e) {
                util.debugWriteLine(e.Message + " " + e.StackTrace + " " + e.Source + " " + e.TargetSite);
                StartPosition = FormStartPosition.WindowsDefaultLocation;
            }

            if (bool.Parse(config.get("IsMiniStart")))
            {
                changeSize(true);
            }

            if (config.get("qualityRank").Split(',').Length == 5)
            {
                config.set("qualityRank", config.get("qualityRank") + ",5");
            }

            changeRecBtnClickEvent(bool.Parse(config.get("IsRecBtnOnlyMouse")));
        }
        public MainForm(string[] args)
        {
            madeThread = Thread.CurrentThread;

            //args = "-nowindo -stdIO -IsmessageBox=false -IscloseExit=true lv316762771 -ts-start=1785s -ts-end=0s -ts-list=false -ts-list-m3u8=false -ts-list-update=5 -ts-list-open=false -ts-list-command=\"notepad{i}\" -ts-vpos-starttime=true -afterConvertMode=4 -qualityRank=0,1,2,3,4,5 -IsLogFile=true".Split(' ');
            //read std
            if (Array.IndexOf(args, "-std-read") > -1)
            {
                startStdRead();
            }

            /*
             * if (false && !isFullAccessDirectory()) {
             *      MessageBox.Show("このディレクトリーにはファイルの読み書き権限がありませんでした。別のフォルダに移すかフォルダに権限を付与してください。");
             *      System.Environment.Exit(0);
             * }
             */

            System.Diagnostics.Debug.Listeners.Clear();
            System.Diagnostics.Debug.Listeners.Add(new Logger.TraceListener());

            InitializeComponent();
            Text    = "ニコ生新配信録画ツール(仮 " + util.versionStr;
            defIcon = Icon;

            this.args = args;

            rec    = new rec.RecordingManager(this, config);
            player = new Player(this, config);

            if (Array.IndexOf(args, "-stdIO") > -1)
            {
                util.isStdIO = true;
            }



            util.debugWriteLine("arg len " + args.Length);
            util.debugWriteLine("arg join " + string.Join(" ", args));


            //nicoSessionComboBox1.Selector.PropertyChanged += Selector_PropertyChanged;
//            checkBoxShowAll.Checked = bool.Parse(config.get("isAllBrowserMode"));
            //if (isInitRun) initRec();
            //MessageBox.Show(config.get("Isminimized") + " " + config.get("Width") + " " + config.get("Height") + " " + config.get("X") + " " + config.get("Y"));

            try {
                Width  = int.Parse(config.get("Width"));
                Height = int.Parse(config.get("Height"));
            } catch (Exception e) {
                util.debugWriteLine(e.Message + " " + e.StackTrace + " " + e.Source + " " + e.TargetSite);
            }

            try {
                if (bool.Parse(config.get("IsRestoreLocation")))
                {
                    var x = config.get("X");
                    var y = config.get("Y");
                    if (x != "" && y != "" && int.Parse(x) >= 0 && int.Parse(y) >= 0)
                    {
                        StartPosition = FormStartPosition.Manual;
                        Location      = new Point(int.Parse(x), int.Parse(y));
                    }
                }
            } catch (Exception e) {
                util.debugWriteLine(e.Message + " " + e.StackTrace + " " + e.Source + " " + e.TargetSite);
                StartPosition = FormStartPosition.WindowsDefaultLocation;
            }

            if (bool.Parse(config.get("IsMiniStart")))
            {
                changeSize(true);
            }
            setBackColor(Color.FromArgb(int.Parse(config.get("recBackColor"))));
            setForeColor(Color.FromArgb(int.Parse(config.get("recForeColor"))));
            setLinkColor(Color.FromArgb(int.Parse(config.get("recLinkColor"))));
        }
예제 #12
0
        public PopupForm(RssItem item, config.config config,
                         PopupDisplay pd, int showIndex, AlartInfo ai,
                         bool isTest       = false, string poploc = null, int poptime = 0,
                         bool isClickClose = true,
                         bool isTopMost    = true, bool isColor = true, double opacity = 0.9)
        {
            this.config    = config;
            this.ri        = item;
            this.pd        = pd;
            this.showIndex = showIndex;
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();

            //var dt = DateTime.Now;
            var dtStr = "";

            if (item.pubDate != null && item.pubDate != "")
            {
                var dt = DateTime.Parse(item.pubDate);
                dtStr = dt.ToString("yyyy/MM/dd(ddd) HH:mm") + "開始";
            }
            util.debugWriteLine(dtStr);

            //var t = "【弾幕歓迎】BOOWY関係リク枠!放送のしかた覚えてるかな?覚えてなかったらごめんlt;(_ _)gt;";
            var t = item.title;

            if (isOkStrWidth(t + " - "))
            {
                t += " - ";
            }
            if (isOkStrWidth(t + dtStr))
            {
                t += dtStr;
            }
            titleLabel.Text = util.removeTag(t);
            //titleLabel.Text = (item.isMemberOnly ? "(限定)" : "") + titleLabel.Text;

            hostNameLabel.Text      = util.removeTag(item.hostName);
            communityNameLabel.Text = util.removeTag(item.comName);
            descryptionLabel.Text   = util.removeTag(item.description);
            //var _Text = item.hostName + "/" + item.comName;
            if (ai != null && ai.keyword != null && ai.keyword != "")
            {
                Text = ai.keyword + "-" + Text;
            }
            if (ai != null && bool.Parse(config.get("IsColorPopup")))
            {
                BackColor = ai.backColor;
                ForeColor = ai.textColor;
            }
            //Text = Text;
            if (isTest && isColor)
            {
                BackColor = Color.FromArgb(255, 224, 255);
                ForeColor = Color.Black;
            }
            else if (ai != null && bool.Parse(config.get("IsColorPopup")))
            {
                BackColor = ai.backColor;
                ForeColor = ai.textColor;
            }

            var url = "https://live2.nicovideo.jp/watch/" + item.lvId;

            titleLabel.Links.Add(0, titleLabel.Text.Length, url);
            if (isTest)
            {
                this.isTopMostPara = isTopMost;
            }
            else
            {
                this.isTopMostPara = bool.Parse(config.get("IsTopMostPopup"));
            }

            Opacity = isTest ? (opacity / 100) : double.Parse(config.get("popupOpacity")) / 100;
            //
            // TODO: Add constructor code after the InitializeComponent() call.
            //
            this.isTestClosePopup = isClickClose;
            this.testPopTime      = poptime;
            this.isTest           = isTest;

            ContextMenuStrip = contextMenuStrip1;
            setAppliMenuVisible();

            if (item.isMemberOnly)
            {
                ShowIcon = true;
                var icon = new Icon(util.getJarPath()[0] + "/Icon/lock.ico");
                Icon = icon;
            }
        }
예제 #13
0
        public MainForm(string[] args)
        {
            madeThread = Thread.CurrentThread;

                        #if !DEBUG
            FormBorderStyle = FormBorderStyle.FixedSingle;
//				if (config.get("IsLogFile") == "true")
//					config.set("IsLogFile", "false");
                        #endif

            System.Diagnostics.Debug.Listeners.Clear();
            System.Diagnostics.Debug.Listeners.Add(new Logger.TraceListener());

            InitializeComponent();
            Text = "視聴プラグイン(仮 " + util.versionStr;

            this.args = args;

            rec    = new rec.RecordingManager(this, config);
            player = new Player(this, config);

            if (Array.IndexOf(args, "-stdIO") > -1)
            {
                util.isStdIO = true;
            }

            var lv = (args.Length == 0) ? null : util.getRegGroup(args[0], "(lv\\d+(,\\d+)*)");
            util.setLog(config, lv);



            util.debugWriteLine("arg len " + args.Length);
            util.debugWriteLine("arg join " + string.Join(" ", args));


            //nicoSessionComboBox1.Selector.PropertyChanged += Selector_PropertyChanged;
//            checkBoxShowAll.Checked = bool.Parse(config.get("isAllBrowserMode"));
            //if (isInitRun) initRec();
            try {
                //Width = int.Parse(config.get("Width"));
                //Height = int.Parse(config.get("Height"));
                Width  = 492;
                Height = 201;
            } catch (Exception e) {
                util.debugWriteLine(e.Message + " " + e.StackTrace + " " + e.Source + " " + e.TargetSite);
            }
            try {
                var x = config.get("X");
                var y = config.get("Y");
                if (x != "" && y != "")
                {
                    StartPosition = FormStartPosition.Manual;
                    Location      = new Point(int.Parse(x), int.Parse(y));
                }
            } catch (Exception e) {
                util.debugWriteLine(e.Message + " " + e.StackTrace + " " + e.Source + " " + e.TargetSite);
                StartPosition = FormStartPosition.WindowsDefaultLocation;
            }

            setBackColor(Color.FromArgb(int.Parse(config.get("recBackColor"))));
            setForeColor(Color.FromArgb(int.Parse(config.get("recForeColor"))));

            if (bool.Parse(config.get("Isminimized")))
            {
                WindowState = FormWindowState.Minimized;
                if (bool.Parse(config.get("IsMinimizeNotify")))
                {
                    Visible       = false;
                    ShowInTaskbar = false;
                }
            }

            var qr  = config.get("qualityRank").Split(',').ToList();
            var qrD = config.defaultConfig["qualityRank"].Split(',');
            if (qr.Count != qrD.Length)
            {
                foreach (var q in qrD)
                {
                    if (qr.IndexOf(q) == -1)
                    {
                        qr.Add(q);
                    }
                }
            }
            config.set("qualityRank", string.Join(",", qr.ToArray()));
        }
        public TimeShiftOptionForm(string[] lastFileTime,
                                   string segmentSaveType, config.config config, bool isChase, int prepTime)
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();

            this.lastFileTime    = lastFileTime;
            this.segmentSaveType = segmentSaveType;

            if (lastFileTime != null)
            {
                lastFileInfoLabel.Text = "(" + lastFileTime[0] +
                                         "時間" + lastFileTime[1] + "分" + lastFileTime[2] + "秒まで録画済み)";
            }
            else
            {
                lastFileInfoLabel.Text         = "(前回の録画ファイルが見つかりませんでした)";
                isRenketuLastFile.Enabled      = false;
                isFromLastTimeRadioBtn.Enabled = false;
            }
            isRenketuLastFile.Visible = (segmentSaveType == "0");


            var isUrlList       = bool.Parse(config.get("IsUrlList"));
            var openListCommand = config.get("openUrlListCommand");

            isUrlListChkBox.Checked     = isUrlList;
            openListCommandText.Text    = openListCommand;
            openListCommandText.Enabled = isUrlList;

            if (bool.Parse(config.get("IsM3u8List")))
            {
                isM3u8RadioBtn.Checked = true;
            }
            updateListSecondText.Text             = config.get("M3u8UpdateSeconds");
            isOpenListCommandChkBox.Checked       = bool.Parse(config.get("IsOpenUrlList"));
            isSetVposStartTime.Checked            = bool.Parse(config.get("IsVposStartTime"));
            isAfterStartTimeCommentChkBox.Checked = bool.Parse(config.get("IsAfterStartTimeComment"));
            isBeforeEndTimeCommentChkBox.Checked  = bool.Parse(config.get("IsBeforeEndTimeComment"));
            updateTimeShiftStartTimeChkBox();
            updateIsM3u8RadioBtn_CheckedChanged();
            updateIsOpenListCommandChkBoxCheckedChanged();
            updateUrlListChkBoxCheckedChanged();
            updateIsManualEndTimeRadioBtn();
            this.config = config;

            if (isChase)
            {
                Text = "追っかけ録画設定";
                isFromLastTimeRadioBtn.Visible = false;
                lastFileInfoLabel.Visible      = false;
                isRenketuLastFile.Visible      = false;
            }
            if (prepTime > 0)
            {
                isOpenTimeBaseStartChkBox.Visible   =
                    isOpenTimeBaseEndChkBox.Visible = true;
                this.prepTime = prepTime;
            }
            util.setFontSize(int.Parse(config.get("fontSize")), this, false);
        }
예제 #15
0
        void optionOk_Click(object sender, EventArgs e)
        {
            var formData = getFormData();

            cfg.saveFromForm(formData);

            setStartUpMenu2(!bool.Parse(cfg.get("IsStartUp")));

            //main cookie
            var importer = nicoSessionComboBox1.Selector.SelectedImporter;

            if (importer != null && importer.SourceInfo != null)
            {
                var si = importer.SourceInfo;

                if (isCookieFileSiteiChkBox.Checked)
                {
                    SourceInfoSerialize.save(si.GenerateCopy(si.BrowserName, si.ProfileName, cookieFileText.Text), false);
                }
                else
                {
                    SourceInfoSerialize.save(si, false);
                }
            }



            DialogResult = DialogResult.OK;
            Close();
        }
예제 #16
0
        public SmallPopupForm(RssItem item, config.config config,
                              PopupDisplay pd, int showIndex, AlartInfo ai,
                              bool isTest       = false, string poploc = null, int poptime = 0,
                              bool isClickClose = true,
                              bool isTopMost    = true, Color[] isColor = null, double opacity = 0.9)
        {
            this.config    = config;
            this.ri        = item;
            this.pd        = pd;
            this.showIndex = showIndex;

            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();

            //var dt = DateTime.Now;
            var dtStr = "";

            if (item.pubDate != null && item.pubDate != "")
            {
                var dt = DateTime.Parse(item.pubDate);
                dtStr = dt.ToString("yyyy/MM/dd(ddd) HH:mm") + "開始";
            }
//			util.debugWriteLine(dtStr);

            //var t = "haimasa_qm(歌ってみた)fw";
            var t = item.title;

            if (isOkStrWidth(t + " - "))
            {
                t += " - ";
            }
            if (isOkStrWidth(t + dtStr))
            {
                t += dtStr;
            }
            titleLabel.Text = util.removeTag(t);
            //titleLabel.Text = (item.isMemberOnly ? "(限定)" : "") + titleLabel.Text;

            hostNameLabel.Text      = util.removeTag(item.hostName);
            communityNameLabel.Text = util.removeTag(item.comName);
            descryptionLabel.Text   = util.removeTag(item.description);
            var _Text = util.removeTag(item.hostName + "/" + item.comName);

            if (ai != null && ai.keyword != null && ai.keyword != "")
            {
                _Text = ai.keyword + "-" + _Text;
            }
            Text = _Text;

            if (isTest && isColor != null)
            {
                BackColor            = isColor[0];     //Color.FromArgb(255,224,255);
                ForeColor            = isColor[1];     //Color.Black;
                titleLabel.LinkColor = ForeColor;
            }
            else if (ai != null && bool.Parse(config.get("IsColorPopup")))
            {
                BackColor            = ai.backColor;
                ForeColor            = ai.textColor;
                titleLabel.LinkColor = ForeColor;
            }
            var url = "https://live2.nicovideo.jp/watch/" + item.lvId;

            titleLabel.Links.Add(0, titleLabel.Text.Length, url);
            if (isTest)
            {
                this.isTopMostPara = isTopMost;
            }
            else
            {
                this.isTopMostPara = bool.Parse(config.get("IsTopMostPopup"));
            }

            Opacity = isTest ? (opacity / 100) : double.Parse(config.get("popupOpacity")) / 100;

            this.isTestClosePopup = isClickClose;
            this.testPopTime      = poptime;
            this.isTest           = isTest;
            //
            // TODO: Add constructor code after the InitializeComponent() call.
            //
            ContextMenuStrip = contextMenuStrip1;
            setAppliMenuVisible();

            if (item.isMemberOnly)
            {
                try {
                    ShowIcon = true;
                    var icon = new Icon(util.getJarPath()[0] + "/Icon/lock.ico");
                    Icon = util.changeIconColor(icon, ColorTranslator.FromHtml(config.get("onlyIconColor")));
                } catch (Exception e) {
                    util.debugWriteLine(e.Message + e.Source + e.StackTrace + e.TargetSite);
                }
            }
        }
예제 #17
0
        private void setFormFromConfig()
        {
            mailText.Text = cfg.get("accountId");
            passText.Text = cfg.get("accountPass");

            if (cfg.get("browserNum") == "1")
            {
                useAccountLoginRadioBtn.Checked = true;
            }
            else
            {
                useCookieRadioBtn.Checked = true;
            }

            setInitQualityRankList(cfg.get("qualityRank"));

            setEngineType(cfg.get("EngineMode"));
//          isDefaultEngineChkBox_UpdateAction();

//			setPlayerType();

            anotherPlayerPathText.Text = cfg.get("anotherPlayerPath");
//			isUsePlayerChkBox.Checked = bool.Parse(cfg.get("IsUsePlayer"));
//			isUsePlayerChkBox_UpdateAction();
            latencyList.Text = cfg.get("latency");

            isCookieFileSiteiChkBox.Checked = bool.Parse(cfg.get("iscookie"));
            isCookieFileSiteiChkBox_UpdateAction();
            cookieFileText.Text = cfg.get("cookieFile");

            var si = SourceInfoSerialize.load(false);

            nicoSessionComboBox1.Selector.SetInfoAsync(si);

            isMinimizedChkBox.Checked      = bool.Parse(cfg.get("Isminimized"));
            isMinimizeNotifyChkBox.Checked = bool.Parse(cfg.get("IsMinimizeNotify"));
        }