dj-kata / sdvx_helper

コナステ版SOUND VOLTEX用の簡易OBSスイッチャー
Apache License 2.0
18 stars 2 forks source link

Add third option to screen orientation (Rotating through Windows display settings) #18

Open RDBomber opened 3 months ago

RDBomber commented 3 months ago

Currently, sdvx_helper allows for two orientations. These are 90 and 270 degrees rotated respectively. Or, as the setting is called, top_is_right in managed_settings.py and sdvx_helper.pyw. This setting is used in get_capture_after_rotate in sdvx_helper.pyw.

There are nothing wrong with these options.

However, there are use cases where the player may need to show other types of content on stream, such as pulling up a view of a SDVX chart, videos or clips of SDVX, pull up clear/scoring tierlists, or simply needs to alt-tab (switch out) of the game to check something.

However, since they aren't rotated through the game, but rather through the display settings in Windows, sdvx_helper can't be used because the game is already rotated, and sdvx_helper can't parse it like this.

My suggestion is to add a third option to this setting, where the user indicates they aren't rotating it through the launcher settings for SDVX. (Attached images for reference of settings of the setup mentioned.) image

image

The user may still need to add a game capture source for sdvx_helper to use and work as intended, but for those other types of content, they can still use another scene with a display capture source for their needs, and helper will switch back to said scenes whenever it's triggered.

It would also probably be ideal to name this setting something different if this is changed. Maybe something like display_orientation ?

Thank you for your work on this project, it has been helpful for automatic scene switching and rivals.

dj-kata commented 3 months ago

Sorry for the delay in replying. I see that you want to rotate the screen in not konasute sdvx but Windows settings, and specify the orientation like the attached image in sdvx setting. This may be difficult to do just now, but I will consider it.

RDBomber commented 3 months ago

No problem, thanks for considering it and thanks for the response.

I would've loved to contribute and maybe submit a pull request in regards to this, but I couldn't for some reason get it to build, or find a way to run, test, or debug on my end. If there's any instructions on how to get it set up, (I was using PyCharm if it matters) I would like to give it a try.

I haven't looked into much on what would need to be changed, but this is what I observed and my thoughts on it?

This is the line for reference.

The option handling, only supports two states (true/false, boolean), so if a third option were to be added, this would need to be changed.

I don't think just passing through img to ret would just work. The original options work by rotating and expanding the image. Assuming the expand is for downscaling or upscaling other resolutions beside 1080p or FHD?

I doubt there's anyone playing on 720p/HD, but there is a good amount of people on 1440p/QHD+ displays. Either way, should work for anyone who's using a rotated 16:9 display ideally?

I don't know anything about how the image recognition works, or The PIL (and Pillow) imaging library, but I assume there's a method to just expand or stretch the image to whatever is desired?

mat3osz commented 4 weeks ago

Adding simple boolean "Use rotation" and if yes -> ret = img.rotate(90, expand=True), else "" could fix the issue and do not require changes to logic behind rotation (also boolean value). I couldn't build it also, there are modules that I can't install with pip

dj-kata commented 3 weeks ago

Thanks to mat3osz via twitter, a solution to this problem was revealed. I will release v.1.0.29 which includes the fixes at 4b4eefdcc1c.