internal SoundRecorderDialog(ILogger logger, ModuleSchema schema, RolandMidiClient midiClient) : this() { this.logger = logger; this.schema = schema; this.midiClient = midiClient; kitNumber.PreviewTextInput += TextConversions.CheckDigits; userSamples.PreviewTextInput += TextConversions.CheckDigits; cancellationTokenSource = new CancellationTokenSource(); kitNumber.Text = TextConversions.Format(schema.KitRoots.Count); // Capture the input device names, and attempt to guess a reasonable default. var allInputDevices = AudioDevices.GetInputDeviceNames(); var midiName = midiClient.OutputName; var expectedInputDevices = new[] { $"MASTER ({midiName})", $"IN ({midiName})", $"KICK ({midiName})" }; inputDevice.ItemsSource = allInputDevices; inputDevice.SelectedIndex = allInputDevices.FindIndex(inputName => expectedInputDevices.Contains(inputName)); foreach (var group in schema.InstrumentGroups) { instrumentGroupSelector.Items.Add(group.Description); } }
internal SoundRecorderDialog(ILogger logger, ModuleSchema schema, RolandMidiClient midiClient) : this() { this.logger = logger; this.schema = schema; this.midiClient = midiClient; kitNumber.PreviewTextInput += TextConversions.CheckDigits; userSamples.PreviewTextInput += TextConversions.CheckDigits; cancellationTokenSource = new CancellationTokenSource(); inputDevice.ItemsSource = AudioDevices.GetInputDeviceNames(); kitNumber.Text = TextConversions.Format(schema.KitRoots.Count); }