Skip to content
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

feat(display): Configure display device based on user config #3441

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

FrogTheFrog
Copy link
Collaborator

@FrogTheFrog FrogTheFrog commented Dec 11, 2024

Description

This is a part 2 of #2894.

This PR adds support for configuring display via the display device library from the previous commit.
This is completely optional feature, which can be disabled with a single config switch.

This includes:

  • Changing display modes based on what the client requests or hardcoding some values.
  • Toggling HDR state.
  • Activating/deactivating displays.
  • Persistently restoring original settings in case Sunshine crashes or something similar happens.

The changes are best understood from screenshots below.

Screenshot

New advanced settings panel:
image

Device config options:
image

Resolution drop-down 1:
image

Resolution drop-down 2:
image

Refresh rate drop-down 1:
image

Refresh rate drop-down 2:
image

HDR drop-down:
image

The "hard reset" option in case the previous display config can no longer be restored (display no longer available/firmware was updated so the device id has changed/etc.):
image

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update (updates to dependencies)
  • Documentation update (changes to documentation)
  • Repository update (changes to repository files, e.g. .github/...)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the in code docstring/documentation-blocks for new or existing methods/components

Copy link

codecov bot commented Dec 11, 2024

Codecov Report

Attention: Patch coverage is 45.28875% with 180 lines in your changes missing coverage. Please review.

Project coverage is 11.83%. Comparing base (1543f58) to head (8900c15).

Files with missing lines Patch % Lines
src/display_device.cpp 57.02% 76 Missing and 31 partials ⚠️
src/config.cpp 15.00% 24 Missing and 10 partials ⚠️
src/nvhttp.cpp 0.00% 5 Missing and 10 partials ⚠️
src/confighttp.cpp 0.00% 6 Missing and 6 partials ⚠️
src/platform/windows/audio.cpp 0.00% 4 Missing ⚠️
src/platform/linux/audio.cpp 0.00% 3 Missing ⚠️
src/platform/macos/microphone.mm 0.00% 3 Missing ⚠️
src/process.cpp 0.00% 1 Missing ⚠️
src/stream.cpp 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3441      +/-   ##
==========================================
+ Coverage   11.17%   11.83%   +0.66%     
==========================================
  Files         100      100              
  Lines       17310    17621     +311     
  Branches     8069     8220     +151     
==========================================
+ Hits         1934     2086     +152     
+ Misses      12812    12780      -32     
- Partials     2564     2755     +191     
Flag Coverage Δ
Linux 9.16% <39.25%> (+0.73%) ⬆️
Windows 6.20% <39.63%> (+0.81%) ⬆️
macOS-13 14.66% <40.07%> (+0.91%) ⬆️
macOS-14 13.51% <37.30%> (+0.79%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/audio.h 100.00% <100.00%> (ø)
src/config.h 0.00% <ø> (ø)
src/platform/common.h 34.04% <ø> (ø)
src/process.cpp 3.23% <0.00%> (+0.55%) ⬆️
src/stream.cpp 3.89% <0.00%> (+0.10%) ⬆️
src/platform/linux/audio.cpp 11.06% <0.00%> (-0.15%) ⬇️
src/platform/macos/microphone.mm 36.73% <0.00%> (-1.05%) ⬇️
src/platform/windows/audio.cpp 25.90% <0.00%> (-0.20%) ⬇️
src/confighttp.cpp 2.20% <0.00%> (-0.05%) ⬇️
src/nvhttp.cpp 1.37% <0.00%> (-0.02%) ⬇️
... and 2 more

... and 17 files with indirect coverage changes

@FrogTheFrog FrogTheFrog marked this pull request as ready for review December 11, 2024 20:45
Copy link
Member

@ReenigneArcher ReenigneArcher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR!

This is a first pass review for which I only looked at the html/vue, and docs.

src_assets/common/assets/web/public/assets/locale/en.json Outdated Show resolved Hide resolved
src_assets/common/assets/web/public/assets/locale/en.json Outdated Show resolved Hide resolved
src_assets/common/assets/web/public/assets/locale/en.json Outdated Show resolved Hide resolved
docs/configuration.md Outdated Show resolved Hide resolved
docs/configuration.md Outdated Show resolved Hide resolved
docs/configuration.md Outdated Show resolved Hide resolved
docs/configuration.md Outdated Show resolved Hide resolved
docs/configuration.md Outdated Show resolved Hide resolved
<tr>
<td>Example</td>
<td colspan="2">@code{}
dd_wa_hdr_toggle = true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
dd_wa_hdr_toggle = true
dd_wa_hdr_toggle = enabled

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not correct:
image

The saved option is boolean.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like the idea of check boxes, but currently we aren't using those anywhere else. So I think that should come in a separate PR changing them universally from the select menus.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like the idea of check boxes, but currently we aren't using those anywhere else. So I think that should come in a separate PR changing them universally from the select menus.

I have fixed this issue already. The enabled works with them like a charm. I hope that I don't need to change the checkbox to the menu (your remark leaves it open for interpretation)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be quite weird to have one checkbox in the ui, while everywhere else is a select menu.

I know you don't like to open more than one PR at once, but changing them out globally would be better. If a separate PR is created to change that pattern, then it's fine to use it here as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll create a separate PR then

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll prioritize reviewing and merging it whenever it's ready. Thanks!

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
4 New issues
4 New Code Smells (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@ReenigneArcher ReenigneArcher added this to the stable release milestone Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

2 participants