Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SDL driver's input and output device configuration via combo box (#7421)
* Enable configuration of input device for SDL Up to now the SDL audio driver attempted to use the default recording device. This might not be what users want or expect, especially since the actually used device is not visible anywhere. So if recording does not work for the users they have no way to find out what's wrong. Extend the settings screen of the SDL driver with a combo box that allows to select the input device to be used. Store the selected device name in a new attribute called "inputdevice" in the "audiosdl" section of the configuration file. Use the information from the configuration when attempting to inialize the input device. Fall back to the default device if that does not work. (cherry picked from commit 33139b9) * Provide a setting for system default input Provide the setting "[System Default]" which instructs the SDL driver to use the default device of the system as the input device. In the configuration file this option is represented as an empty string. This should play well with the current existing configuration of the users. (cherry picked from commit 29c43c2) * Configuration of output device for SDL Let users configure the output device that's used by the SDL driver. Code-wise the implementation is very similar to the input device configuration. Use a `QComboBox` instead of a `QLineEdit` for `m_device` and rename it to `m_playbackDeviceComboBox`. Rename `s_defaultInputDevice` to `s_systemDefaultDevice` because it is used in the context of playback and input devices. (cherry picked from commit 1ab45e4) * Ensure label visibility Make sure that labels are always shown by setting the row wrap policy of the form layout to wrap long rows. (cherry picked from commit a123d0e) * Rename "Device" Rename "Device" to "Playback device" to make clear what the setting refers to. (cherry picked from commit 1f0cda4) * Remove repeated strings Introduce const expressions to get rid of repeated strings with a risk of typos. (cherry picked from commit f9ea970) * Apply some more changes Apply some more changes that have been made to `AudioSdl` in the recording branch. * Conditional ternary operator Also use a conditional ternary operator for the input device setup. * Methods for population of combo boxes Move the population of the input and playback device combo boxes into the methods `populatePlaybackDeviceComboBox` and `populateInputDeviceComboBox`. * Sort devices in combo box Sort the devices names alphabetically in the input and playback combo boxes. The default devices is always shown as the first entry. * Code review fixes Use `AudioDeviceSetupWidget` instead of `QObject` to translate "[System Default]". Fix copy/paste error in comment. * Simplify some constexpr statements
- Loading branch information