예제 #1
0
        private void checkBoxConnSCC_CheckedChanged(object sender, EventArgs e)
        {
            if (checkBoxConnSCC.Checked)
            {
                switch (Settings.Default.SCC_IF)
                {
                case 0:
                    comPortSCC = VsifManager.TryToConnectVSIF(VsifSoundModuleType.MSX_FTDI,
                                                              (PortId)Settings.Default.SCC_Port, false);
                    if (comPortSCC != null)
                    {
                        enableScc(SCCType.SCC1, SCCSlotNo[comboBoxSccSlot.SelectedIndex]);
                    }
                    break;
                }
                checkBoxConnSCC.Checked = comPortSCC != null;
                comboBoxSCC.Enabled     = comPortSCC == null;
                comboBoxPortSCC.Enabled = comPortSCC == null;
                comboBoxSccSlot.Enabled = comPortSCC == null;
            }
            else
            {
                comboBoxSCC.Enabled     = true;
                comboBoxPortSCC.Enabled = true;
                comboBoxSccSlot.Enabled = true;

                comPortSCC?.Dispose();
            }
        }
예제 #2
0
        private void checkBoxConnOPNA2_CheckedChanged(object sender, EventArgs e)
        {
            if (checkBoxConnOPNA2.Checked)
            {
                switch (Settings.Default.OPNA2_IF)
                {
                case 0:
                    comPortOPNA2 = VsifManager.TryToConnectVSIF(VsifSoundModuleType.Genesis,
                                                                (PortId)Settings.Default.OPNA2_Port, false);
                    break;

                case 1:
                    comPortOPNA2 = VsifManager.TryToConnectVSIF(VsifSoundModuleType.Genesis_FTDI,
                                                                (PortId)Settings.Default.OPNA2_Port, false);
                    break;

                case 2:
                    comPortOPNA2 = VsifManager.TryToConnectVSIF(VsifSoundModuleType.Genesis_Low,
                                                                (PortId)Settings.Default.OPNA2_Port, false);
                    break;
                }
                checkBoxConnOPNA2.Checked  = comPortOPNA2 != null;
                comboBoxOPNA2.Enabled      = comPortOPNA2 == null;
                comboBoxPortYM2612.Enabled = comPortOPNA2 == null;
            }
            else
            {
                comboBoxOPNA2.Enabled      = true;
                comboBoxPortYM2612.Enabled = true;
                comPortOPNA2?.Dispose();
            }
        }
예제 #3
0
        private void checkBoxConnOPLL_CheckedChanged(object sender, EventArgs e)
        {
            if (checkBoxConnOPLL.Checked)
            {
                switch (Settings.Default.OPLL_IF)
                {
                case 0:
                    comPortOPLL = VsifManager.TryToConnectVSIF(VsifSoundModuleType.SMS,
                                                               (PortId)Settings.Default.OPLL_Port, false);
                    break;

                case 1:
                    comPortOPLL = VsifManager.TryToConnectVSIF(VsifSoundModuleType.MSX_FTDI,
                                                               (PortId)Settings.Default.OPLL_Port, false);
                    break;
                }

                checkBoxConnOPLL.Checked   = comPortOPLL != null;
                comboBoxOPLL.Enabled       = comPortOPLL == null;
                comboBoxPortYm2413.Enabled = comPortOPLL == null;
            }
            else
            {
                comboBoxOPLL.Enabled       = true;
                comboBoxPortYm2413.Enabled = true;
                comPortOPLL?.Dispose();
            }
        }
예제 #4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="disposing"></param>
        protected override void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    // マネージド状態を破棄します (マネージド オブジェクト)
                    Stop();
                }

                xgmReader?.Dispose();

                // アンマネージド リソース (アンマネージド オブジェクト) を解放し、ファイナライザーをオーバーライドします
                comPortDCSG?.Dispose();
                comPortDCSG = null;
                comPortOPNA2?.Dispose();
                comPortOPNA2 = null;

                // 大きなフィールドを null に設定します
                disposedValue = true;
            }
        }
예제 #5
0
        private void checkBoxConnDCSG_CheckedChanged(object sender, EventArgs e)
        {
            if (checkBoxConnDCSG.Checked)
            {
                switch (Settings.Default.DCSG_IF)
                {
                case 0:
                    comPortDCSG = VsifManager.TryToConnectVSIF(VsifSoundModuleType.Genesis,
                                                               (PortId)Settings.Default.DCSG_Port, false);
                    break;

                case 1:
                    comPortDCSG = VsifManager.TryToConnectVSIF(VsifSoundModuleType.Genesis_FTDI,
                                                               (PortId)Settings.Default.DCSG_Port, false);
                    break;

                case 2:
                    comPortDCSG = VsifManager.TryToConnectVSIF(VsifSoundModuleType.SMS,
                                                               (PortId)Settings.Default.DCSG_Port, false);
                    break;

                case 3:
                    comPortDCSG = VsifManager.TryToConnectVSIF(VsifSoundModuleType.Genesis_Low,
                                                               (PortId)Settings.Default.DCSG_Port, false);
                    break;
                }

                checkBoxConnDCSG.Checked    = comPortDCSG != null;
                comboBoxDCSG.Enabled        = comPortDCSG == null;
                comboBoxPortSN76489.Enabled = comPortDCSG == null;
            }
            else
            {
                comboBoxDCSG.Enabled        = true;
                comboBoxPortSN76489.Enabled = true;
                comPortDCSG?.Dispose();
            }
        }