예제 #1
0
파일: Auto3DSetup.cs 프로젝트: caomw/Auto3D
 void tabControl3D_Selected(object sender, TabControlEventArgs e)
 {
     if (e.TabPageIndex == 5)
     {
         IAuto3DSetup setup = (IAuto3DSetup)((IAuto3D)comboBoxModel.SelectedItem).GetSetupControl();
         labelMAC.Text = setup.GetDevice().GetMacAddress();
     }
 }
예제 #2
0
파일: Auto3DSetup.cs 프로젝트: caomw/Auto3D
        private void buttonConfig_Click(object sender, EventArgs e)
        {
            IAuto3DSetup setup = (IAuto3DSetup)((IAuto3D)comboBoxModel.SelectedItem).GetSetupControl();

            setup.SaveSettings();
            setup.GetDevice().LoadSettings();

            Auto3DSequenceManager sequenceManager = new Auto3DSequenceManager();

            sequenceManager.SetDevice(setup.GetDevice());
            Auto3DSequenceManager.SequenceManager = sequenceManager;
            sequenceManager.ShowDialog();

            setup.LoadSettings();
        }
예제 #3
0
파일: Auto3DSetup.cs 프로젝트: caomw/Auto3D
        public void SaveSettings()
        {
            using (Settings writer = new MPSettings())
            {
                writer.SetValueAsBool("Auto3DPlugin", "TV", checkBoxTV.Checked);
                writer.SetValueAsBool("Auto3DPlugin", "Video", checkBoxVideo.Checked);
                writer.SetValue("Auto3DPlugin", "ActiveDevice", comboBoxModel.SelectedItem.ToString());

                writer.SetValueAsBool("Auto3DPlugin", "3DMenuAlways", checkBoxSelectionAlways.Checked);
                writer.SetValueAsBool("Auto3DPlugin", "CheckNameSimple", checkBoxName3DSimple.Checked);
                writer.SetValueAsBool("Auto3DPlugin", "CheckNameFull", checkBoxName3DFull.Checked);
                writer.SetValueAsBool("Auto3DPlugin", "CheckNameFormatSBS", radioButtonSBS.Checked);
                writer.SetValueAsBool("Auto3DPlugin", "SideBySide", checkBoxSBS.Checked);
                writer.SetValueAsBool("Auto3DPlugin", "TopAndBottom", checkBoxTopDown.Checked);
                writer.SetValueAsBool("Auto3DPlugin", "AnalyzeNetworkStream", checkBoxAnalyzeNetworkStream.Checked);
                writer.SetValueAsBool("Auto3DPlugin", "3DMenuOnKey", checkBoxSelectionOnKey.Checked);
                writer.SetValue("Auto3DPlugin", "3DMenuKey", textBoxMenuHotkey.Text);

                writer.SetValueAsBool("Auto3DPlugin", "EventGhostEvents", checkBoxEventGhost.Checked);

                writer.SetValueAsBool("Auto3DPlugin", "ShowMessageOnModeChange", checkBoxModeSwitchMessage.Checked);
                writer.SetValueAsBool("Auto3DPlugin", "SupressSwitchBackTo2D", checkBoxSupressSwitchBackTo2D.Checked);
                writer.SetValueAsBool("Auto3DPlugin", "Convert3DTo2D", checkBoxConvert3Dto2D.Checked);

                writer.SetValueAsBool("Auto3DPlugin", "3DSubtitles", checkBox3DSubTitles.Checked);
                writer.SetValue("Auto3DPlugin", "SubtitleDepth", trackBarDepth3D.Value);

                writer.SetValue("Auto3DPlugin", "SwitchSBSLabels", textBoxSBS.Text);
                writer.SetValue("Auto3DPlugin", "SwitchSBSRLabels", textBoxSBSR.Text);
                writer.SetValue("Auto3DPlugin", "SwitchTABLabels", textBoxTAB.Text);
                writer.SetValue("Auto3DPlugin", "SwitchTABRLabels", textBoxTABR.Text);

                writer.SetValueAsBool("Auto3DPlugin", "LogOnlyKnownDevices", checkBoxLogKnown.Checked);
                writer.SetValueAsBool("Auto3DPlugin", "StretchSubtitles", checkBoxPreRendered.Checked);

                if (checkBoxTurnOffDevice.Enabled)
                {
                    writer.SetValueAsBool("Auto3DPlugin", "TurnDeviceOff", checkBoxTurnOffDevice.Checked);

                    if (radioButtonIpOff.Checked)
                    {
                        writer.SetValue("Auto3DPlugin", "TurnDeviceOffVia", 1);
                    }

                    if (radioButtonIrOff.Checked)
                    {
                        writer.SetValue("Auto3DPlugin", "TurnDeviceOffVia", 2);
                    }

                    writer.SetValue("Auto3DPlugin", "TurnDeviceOffWhen", comboBoxTurnOffDevice.SelectedIndex);
                }

                writer.SetValueAsBool("Auto3DPlugin", "TurnDeviceOn", checkBoxTurnOnDevice.Checked);

                if (radioButtonIpOn.Checked)
                {
                    writer.SetValue("Auto3DPlugin", "TurnDeviceOnVia", 1);
                }

                if (radioButtonIrOn.Checked)
                {
                    writer.SetValue("Auto3DPlugin", "TurnDeviceOnVia", 2);
                }

                writer.SetValue("Auto3DPlugin", "TurnDeviceOnWhen", comboBoxTurnOnDevice.SelectedIndex);

                writer.SetValueAsBool("Auto3DPlugin", "ConvertTo3D", checkBoxConvertTo3D.Checked);
                writer.SetValue("Auto3DPlugin", "SkewFactor", trackBarSkewFactor.Value);
            }

            foreach (IAuto3D item in comboBoxModel.Items)
            {
                IAuto3DSetup setup = (IAuto3DSetup)item.GetSetupControl();
                setup.SaveSettings();
            }
        }
예제 #4
0
파일: Auto3DSetup.cs 프로젝트: caomw/Auto3D
        private void comboBoxModel_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (_lastDevice != null)
            {
                _lastDevice.Stop();
            }

            Auto3DUPnP.StopSSDP();

            IAuto3DSetup setup = (IAuto3DSetup)((IAuto3D)comboBoxModel.SelectedItem).GetSetupControl();

            setup.BringToFront();
            setup.GetDevice().Start();

            if (setup.GetDevice() is Auto3DUPnPBaseDevice)
            {
                Auto3DUPnP.StartSSDP();
            }

            buttonConfig.Visible = (setup.GetDevice().GetRemoteControl() != null);

            Auto3DBaseDevice baseDevice = (Auto3DBaseDevice)setup.GetDevice();

            if (baseDevice.GetTurnOffInterfaces() == DeviceInterface.None)
            {
                checkBoxTurnOffDevice.Enabled = false;
                comboBoxTurnOffDevice.Enabled = false;
                buttonTurnOffDevice.Enabled   = false;
                radioButtonIpOff.Enabled      = false;
                radioButtonIrOff.Enabled      = false;
            }
            else
            {
                checkBoxTurnOffDevice.Enabled = true;
                comboBoxTurnOffDevice.Enabled = true;
                buttonTurnOffDevice.Enabled   = true;

                if ((baseDevice.GetTurnOffInterfaces() & DeviceInterface.IR) == DeviceInterface.IR)
                {
                    using (Settings reader = new MPSettings())
                    {
                        radioButtonIrOff.Enabled = true;
                        radioButtonIrOff.Checked = reader.GetValueAsInt("Auto3DPlugin", "TurnDeviceOffVia", 0) == 2;
                    }
                }
                else
                {
                    using (Settings reader = new MPSettings())
                    {
                        radioButtonIrOff.Enabled = false;
                        radioButtonIrOff.Checked = false;
                    }
                }

                if ((baseDevice.GetTurnOffInterfaces() & DeviceInterface.Network) == DeviceInterface.Network)
                {
                    using (Settings reader = new MPSettings())
                    {
                        radioButtonIpOff.Enabled = true;
                        radioButtonIpOff.Checked = reader.GetValueAsInt("Auto3DPlugin", "TurnDeviceOffVia", 0) == 1;
                    }
                }
                else
                {
                    using (Settings reader = new MPSettings())
                    {
                        radioButtonIpOff.Enabled = false;
                        radioButtonIpOff.Checked = false;
                    }
                }
            }

            if (baseDevice.GetTurnOnInterfaces() == DeviceInterface.None)
            {
                checkBoxTurnOnDevice.Enabled = false;
                comboBoxTurnOnDevice.Enabled = false;
                buttonTurnOnDevice.Enabled   = false;
                radioButtonIpOn.Enabled      = false;
                radioButtonIrOn.Enabled      = false;
            }
            else
            {
                checkBoxTurnOnDevice.Enabled = true;
                comboBoxTurnOnDevice.Enabled = true;
                buttonTurnOnDevice.Enabled   = true;

                if ((baseDevice.GetTurnOnInterfaces() & DeviceInterface.IR) == DeviceInterface.IR)
                {
                    using (Settings reader = new MPSettings())
                    {
                        radioButtonIrOn.Enabled = true;
                        radioButtonIrOn.Checked = reader.GetValueAsInt("Auto3DPlugin", "TurnDeviceOnVia", 0) == 2;
                    }
                }
                else
                {
                    using (Settings reader = new MPSettings())
                    {
                        radioButtonIrOn.Enabled = false;
                        radioButtonIrOn.Checked = false;
                    }
                }

                if ((baseDevice.GetTurnOnInterfaces() & DeviceInterface.Network) == DeviceInterface.Network)
                {
                    using (Settings reader = new MPSettings())
                    {
                        radioButtonIpOn.Enabled = true;
                        radioButtonIpOn.Checked = reader.GetValueAsInt("Auto3DPlugin", "TurnDeviceOnVia", 0) == 1;
                    }
                }
                else
                {
                    using (Settings reader = new MPSettings())
                    {
                        radioButtonIpOn.Enabled = false;
                        radioButtonIpOn.Checked = false;
                    }
                }
            }
        }
예제 #5
0
파일: Auto3DSetup.cs 프로젝트: caomw/Auto3D
        public void LoadSettings()
        {
            using (Settings reader = new MPSettings())
            {
                checkBoxTV.Checked    = reader.GetValueAsBool("Auto3DPlugin", "TV", false);
                checkBoxVideo.Checked = reader.GetValueAsBool("Auto3DPlugin", "Video", true);

                String activeDeviceName = reader.GetValueAsString("Auto3DPlugin", "ActiveDevice", "");

                foreach (IAuto3D device in comboBoxModel.Items)
                {
                    if (device.ToString() == activeDeviceName)
                    {
                        comboBoxModel.SelectedItem = device;
                        break;
                    }
                }

                if (comboBoxModel.SelectedIndex == -1)
                {
                    comboBoxModel.SelectedIndex = 0;
                }

                checkBoxSelectionAlways.Checked = reader.GetValueAsBool("Auto3DPlugin", "3DMenuAlways", false);

                checkBoxName3DSimple.Checked = reader.GetValueAsBool("Auto3DPlugin", "CheckNameSimple", true);
                checkBoxName3DFull.Checked   = reader.GetValueAsBool("Auto3DPlugin", "CheckNameFull", true);

                radioButtonSBS.Checked = reader.GetValueAsBool("Auto3DPlugin", "CheckNameFormatSBS", true);
                radioButtonTAB.Checked = !reader.GetValueAsBool("Auto3DPlugin", "CheckNameFormatSBS", true);

                checkBoxSBS.Checked     = reader.GetValueAsBool("Auto3DPlugin", "SideBySide", true);
                checkBoxTopDown.Checked = reader.GetValueAsBool("Auto3DPlugin", "TopAndBottom", false);
                checkBoxAnalyzeNetworkStream.Checked = reader.GetValueAsBool("Auto3DPlugin", "AnalyzeNetworkStream", true);

                checkBoxSelectionOnKey.Checked = reader.GetValueAsBool("Auto3DPlugin", "3DMenuOnKey", false);
                textBoxMenuHotkey.Text         = reader.GetValueAsString("Auto3DPlugin", "3DMenuKey", "CTRL + D");

                if (textBoxMenuHotkey.Text.StartsWith("MCE")) // reject old configs
                {
                    textBoxMenuHotkey.Text = "";
                }

                checkBoxEventGhost.Checked = reader.GetValueAsBool("Auto3DPlugin", "EventGhostEvents", false);

                checkBox3DSubTitles.Checked = reader.GetValueAsBool("Auto3DPlugin", "3DSubtitles", true);
                trackBarDepth3D.Value       = reader.GetValueAsInt("Auto3DPlugin", "SubtitleDepth", 0);

                checkBoxModeSwitchMessage.Checked     = reader.GetValueAsBool("Auto3DPlugin", "ShowMessageOnModeChange", true);
                checkBoxSupressSwitchBackTo2D.Checked = reader.GetValueAsBool("Auto3DPlugin", "SupressSwitchBackTo2D", false);
                checkBoxConvert3Dto2D.Checked         = reader.GetValueAsBool("Auto3DPlugin", "Convert3DTo2D", false);

                textBoxSBS.Text  = reader.GetValueAsString("Auto3DPlugin", "SwitchSBSLabels", "\"3DSBS\", \"3D SBS\"");
                textBoxSBSR.Text = reader.GetValueAsString("Auto3DPlugin", "SwitchSBSRLabels", "\"3DSBSR\", \"3D SBS R\"");
                textBoxTAB.Text  = reader.GetValueAsString("Auto3DPlugin", "SwitchTABLabels", "\"3DTAB\", \"3D TAB\"");
                textBoxTABR.Text = reader.GetValueAsString("Auto3DPlugin", "SwitchTABRLabels", "\"3DTABR\", \"3D TAB R\"");

                checkBoxLogKnown.Checked    = reader.GetValueAsBool("Auto3DPlugin", "LogOnlyKnownDevices", true);
                checkBoxPreRendered.Checked = reader.GetValueAsBool("Auto3DPlugin", "StretchSubtitles", false);

                checkBoxTurnOffDevice.Checked = reader.GetValueAsBool("Auto3DPlugin", "TurnDeviceOff", false);
                radioButtonIpOff.Checked      = reader.GetValueAsInt("Auto3DPlugin", "TurnDeviceOffVia", 0) == 1;
                radioButtonIrOff.Checked      = reader.GetValueAsInt("Auto3DPlugin", "TurnDeviceOffVia", 0) == 2;

                comboBoxTurnOffDevice.SelectedIndex = reader.GetValueAsInt("Auto3DPlugin", "TurnDeviceOffWhen", 0);

                checkBoxTurnOnDevice.Checked = reader.GetValueAsBool("Auto3DPlugin", "TurnDeviceOn", false);
                radioButtonIpOn.Checked      = reader.GetValueAsInt("Auto3DPlugin", "TurnDeviceOnVia", 0) == 1;
                radioButtonIrOn.Checked      = reader.GetValueAsInt("Auto3DPlugin", "TurnDeviceOnVia", 0) == 2;

                comboBoxTurnOnDevice.SelectedIndex = reader.GetValueAsInt("Auto3DPlugin", "TurnDeviceOnWhen", 0);

                checkBoxConvertTo3D.Checked = reader.GetValueAsBool("Auto3DPlugin", "ConvertTo3D", false);
                trackBarSkewFactor.Value    = reader.GetValueAsInt("Auto3DPlugin", "SkewFactor", 10);
            }

            foreach (IAuto3D item in comboBoxModel.Items)
            {
                IAuto3DSetup setup = (IAuto3DSetup)item.GetSetupControl();
                setup.LoadSettings();
            }
        }