-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
SDL driver's input and output device configuration via combo box #7421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SDL driver's input and output device configuration via combo box #7421
Conversation
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 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)
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)
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" to "Playback device" to make clear what the setting refers to. (cherry picked from commit 1f0cda4)
Introduce const expressions to get rid of repeated strings with a risk of typos. (cherry picked from commit f9ea970)
Rossmaxx
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments. Tbh i don't really understand some of the changes, so can't write a better review.
Apply some more changes that have been made to `AudioSdl` in the recording branch.
Also use a conditional ternary operator for the input device setup.
Move the population of the input and playback device combo boxes into the methods `populatePlaybackDeviceComboBox` and `populateInputDeviceComboBox`.
Sort the devices names alphabetically in the input and playback combo boxes. The default devices is always shown as the first entry.
|
@LMMS/developers, I have just noticed that these changes will currently only work for SDL2 builds. Are there any SDL1 builds? According to SDL2's Wikipedia page SDL2 was released in 2013 so I guess most distributions should already have support for SDL2. Or put differently, many distribution will likely not provide SDL1 packages anymore. Removing support for SDL1 would greatly improve the source code for the SDL back end. |
|
I vote for complete removal of SDL 1 too, but my opinion is: Edited: Even better : open new issue "Obsolete and mostly dead SDL1 code" with mark good first issue. |
|
I agree. It should be done in two steps. |
|
I also agree with dropping SDL2 support. |
|
I'm also in favor for complete removal of SDL 1 support. |
I guess you meant SDL1? 😅 |
|
In that case I'd like to ask for a code review so this one can go in. Or just for @Rossmaxx to green-light this if he's okay with the current state. I will then create a separate issue to remove the SDL1 related code and perhaps give it a spin myself. |
Rossmaxx
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine.
|
Tbh i would wait for another cod review. |
|
I have added @zonkmachine as an additional reviewer as he was also active in #5990. If someone else wants to review feel free to do so. |
| AudioDeviceSetupWidget( AudioSdl::name(), _parent ) | ||
| { | ||
| QFormLayout * form = new QFormLayout(this); | ||
| form->setRowWrapPolicy(QFormLayout::WrapLongRows); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reasons for this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because otherwise the labels might get hidden if the content of the combo boxes becomes very long (which is the case for my sound devices). See commit 94b43f5.
Use `AudioDeviceSetupWidget` instead of `QObject` to translate "[System Default]". Fix copy/paste error in comment.
This pull request cherry-picks the changes from pull request #5990 which enable the configuration of the SDL driver's input and output devices via combo boxes. The feature was extracted into this PR because it is questionable if and when #5990 will be merged and the combo box feature is already useful on it's own. It looks as follows:
My comments in #5990 regarding this feature started around here: #5990 (comment)
This feature was also proposed independently here: #6070 (comment)
Similar designs for the other drivers should be done in separate pull requests as they will all have different API on how to retrieve the devices and change them.