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

Core/WiimoteReal: Wii remote connection pool and source change cleanup. #8548

Merged
merged 1 commit into from Jan 25, 2020

Conversation

jordan-woyak
Copy link
Member

Replaced wide usages of g_wiimote_sources with get/set functions.
Made the unnamed enum type an enum class, WiimoteSource.

Connected real Wii remotes are now added to a "pool" when no open slot is available.
Wii remotes in the pool have LEDs 1 and 4 lit to make it apparent they are not active.
They are disconnected per normal after 5 seconds.
This allows reassigning sources and reordering remotes without the hassle of Bluetooth re-connections.

This is mainly in preparation for Wii remotes in controller interface.
My plan is an option on the Wii remote dialog, "Connect Wii Remotes for input configuration" (or something with a better name).
Enabling it will first fill any "Real" slots but additional remotes will be sent to controller interface.
Disabling the option will send spurious remotes to the pool.

I think this "pool" will make things less horrible for users that are playing around with options.
Making Wii remote connections can be not-fun, especially on Windows/macOS.
Holding on to a connection for a few seconds when between configurations will give users a better experience

Perhaps someone ambitious might make a UI for the pool.
Remotes could be identified with rumble and sent to a slot or controller interface.

This all of course only affects emulated Bluetooth.

@jordan-woyak jordan-woyak force-pushed the wiimote-source-cleanup branch 2 times, most recently from 628924a to 673d5c9 Compare January 4, 2020 23:39
Copy link
Member

@leoetlino leoetlino left a comment

Choose a reason for hiding this comment

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

(This is really only a very partial review)

Source/Core/Core/HW/Wiimote.cpp Outdated Show resolved Hide resolved
Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp Outdated Show resolved Hide resolved
Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp Outdated Show resolved Hide resolved
Source/Core/Core/NetPlayClient.cpp Show resolved Hide resolved
Source/Core/DolphinQt/MainWindow.cpp Show resolved Hide resolved
…SetWiimoteSource functions. Add connected real Wii Remotes to a pool when a slot is not available.
@iwubcode
Copy link
Contributor

I haven't tested this but code wise, this looks really nice!

@Tilka Tilka merged commit 5dfc919 into dolphin-emu:master Jan 25, 2020
@jordan-woyak jordan-woyak deleted the wiimote-source-cleanup branch December 30, 2020 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants