private void UpdateUIStatus() { if (!m_uiInitialized) { return; } int driverNum = asio.DriverNumGet(); if (0 == driverNum) { // ASIOデバイスがないのでファイル出力モードしか選べない m_outputMode = OutputMode.WavFile; radioButtonOutAsio.IsEnabled = false; } else { radioButtonOutAsio.IsEnabled = true; } switch (m_outputMode) { case OutputMode.WavFile: textBoxOutputFilePath.IsEnabled = true; listBoxAsioDevices.IsEnabled = false; listBoxAsioChannels.IsEnabled = false; listBoxAsioClockSource.IsEnabled = false; buttonAsioControlPanel.IsEnabled = false; buttonRef.IsEnabled = true; textBoxSeconds.IsEnabled = true; listBoxSampleFreq.IsEnabled = true; listBoxBits.IsEnabled = true; break; case OutputMode.Asio: textBoxOutputFilePath.IsEnabled = false; listBoxAsioDevices.IsEnabled = true; listBoxAsioChannels.IsEnabled = true; listBoxAsioClockSource.IsEnabled = true; buttonAsioControlPanel.IsEnabled = true; buttonRef.IsEnabled = false; textBoxSeconds.IsEnabled = false; listBoxSampleFreq.IsEnabled = false; listBoxBits.IsEnabled = false; break; default: System.Diagnostics.Debug.Assert(false); break; } }
public Form1() { InitializeComponent(); asio = new AsioCS(); asio.Init(); int nDrivers = asio.DriverNumGet(); Console.WriteLine("driverNum=" + nDrivers); for (int i = 0; i < nDrivers; ++i) { listBoxDrivers.Items.Add(asio.DriverNameGet(i)); } if (0 < nDrivers) { listBoxDrivers.SelectedIndex = 0; buttonLoadDriver.Enabled = true; } if (1 == nDrivers) { buttonLoadDriver_Click(null, null); } }