예제 #1
0
        private void comboBoxAsioInputDevice_SelectedIndexChanged(object sender, EventArgs e)
        {
            // get the available Asio channels
            this.comboBoxAsioInputChannel.Items.Clear();
            this.comboBoxAsioInputChannel.Text = "";
            int n = this.comboBoxAsioInputDevice.SelectedIndex;

            if (BassAsio.BASS_ASIO_GetDevice() == n || BassAsio.BASS_ASIO_SetDevice(n))
            {
                BASS_ASIO_INFO info = BassAsio.BASS_ASIO_GetInfo();
                if (info != null)
                {
                    // assuming stereo input
                    for (int i = 0; i < info.inputs; i += 2)
                    {
                        BASS_ASIO_CHANNELINFO chanInfo = BassAsio.BASS_ASIO_ChannelGetInfo(true, i);
                        if (chanInfo != null)
                        {
                            this.comboBoxAsioInputChannel.Items.Add(chanInfo);
                        }
                    }
                    if (this.comboBoxAsioInputChannel.Items.Count > 0)
                    {
                        this.comboBoxAsioInputChannel.SelectedIndex = 0;
                    }
                }
                else
                {
                    MessageBox.Show(String.Format("AsioError = {0}", BassAsio.BASS_ASIO_ErrorGetCode()));
                }
            }
            else
            {
                MessageBox.Show(String.Format("AsioError = {0}", BassAsio.BASS_ASIO_ErrorGetCode()));
            }
        }