コード例 #1
0
        private void cB_IPCon_MainPlayerPreset_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (!MainForm.m.finishedLoading)
            {
                return;
            }

            if (cB_IPCon_MainPlayerPreset.SelectedIndex == cB_IPCon_MainPlayerPreset.Items.Count - 1 &&
                RTSPPresets.currentPresetCount == 0)    //if no presets exist and the user clicks Add New...
            {
                RTSPPresets.CreateNew(MainForm.m.mainPlayer.settings);
            }
            else
            {
                MainForm.m.mainPlayer.settings.cB_RTSP.SelectedIndex = cB_IPCon_MainPlayerPreset.SelectedIndex;
            }
        }
コード例 #2
0
        private void cB_RTSP_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (!MainForm.m.finishedLoading || !refreshBox)
            {
                return;
            }

            previousIndex = cB_RTSP.SelectedIndex;

            if (cB_RTSP.Text == "")
            {
                toolTip1.SetToolTip(cB_RTSP, "Select a camera preset");
                return;
            }

            bool visibleBool = false;

            if (cB_RTSP.SelectedIndex == cB_RTSP.Items.Count - 1)
            {
                if (previousIndex != -1 || isMainPlayer)
                {
                    RTSPPresets.CreateNew(this);
                }
            }
            else
            {
                //Use new settings
                if (cB_RTSP.Text != "")
                {
                    visibleBool = true;
                }

                if (isMainPlayer)
                {
                    MainForm.m.setPage.cB_IPCon_MainPlayerPreset.SelectedIndex = cB_RTSP.SelectedIndex;
                }

                if (!check_Manual.Checked)
                {
                    CompleteControlValues();
                }
            }

            UpdateButtonVisibility(visibleBool);

            string rtspText = cB_RTSP.Text;

            if (isMainPlayer)
            {
                ConfigControl.mainPlayerPreset.UpdateValue(rtspText);
                MainForm.m.setPage.b_IPCon_Edit.Visible = visibleBool;
            }
            else if (myLinkedPage != null)
            {
                int pageIndex = MainForm.m.mainPlayer.settings.tC_PlayerSettings.TabPages.IndexOf(myLinkedPage);
                if (pageIndex == 1)
                {
                    ConfigControl.player2Preset.UpdateValue(rtspText);
                }
                else if (pageIndex == 2)
                {
                    ConfigControl.player3Preset.UpdateValue(rtspText);
                }
            }

            string fullAdr = RTSPPresets.GetValue(PresetColumn.FullAdr, cB_RTSP.Text);

            toolTip1.SetToolTip(cB_RTSP, fullAdr);
            myDetached.Play(false, false);
        }