Beispiel #1
0
        private void comboBoxHostApi_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.comboBoxHostApiDevices.Items.Clear();

            PortAudio.PaHostApiInfo hostApiInfo = (PortAudio.PaHostApiInfo) this.comboBoxHostApi.SelectedItem;

            int hostApiIndex = PortAudio.NativeMethods.Pa_HostApiTypeIdToHostApiIndex(hostApiInfo.type);

            for (int hostDevice = 0; hostDevice < hostApiInfo.deviceCount; hostDevice++)
            {
                int device = PortAudio.NativeMethods.Pa_HostApiDeviceIndexToDeviceIndex(hostApiIndex, hostDevice);

                PortAudio.PaDeviceInfo deviceInfo = PortAudio.ManagedWrappers.Pa_GetDeviceInfo(device);

                this.comboBoxHostApiDevices.Items.Add(deviceInfo);
            }

            this.comboBoxHostApiDevices.SelectedIndex = 0;

            SetDeviceNumber();

            this.textBox2.Text = hostApiInfo.Dump();
        }