-
Notifications
You must be signed in to change notification settings - Fork 83
Issue/352 prevent unnecessary reconnects #353
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
base: master
Are you sure you want to change the base?
Conversation
neothesia/src/input_manager/mod.rs
Outdated
| // Skip reconnect if already connected to same port | ||
| if self.current_connection.is_some() | ||
| && self.current_port_name.as_deref() == Some(port_name.as_str()) | ||
| { return; } |
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.
This will probably depend on a platform used, but what will happen if I connect to a keyboard, then physically unplug it, and plug it back again, will it still have the same name and therefore stay unconnected because of the initial unplug?
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.
checked and you are correct, based on previous code, no connection was reformed. I have updated the code to ensure that input connections reform on scene change. I was considering changing the location of the checks outside of the menu_scene/state.rs which would prevent users from having to navigate back to the main menu and then back to the playing menu upon disconnect/reconnect, but didn't want to add polling logic to the main event loop without your consideration, so as for now, it operates as before, from the menu_scene only.
|
Sadly there are way too many LLM hallucinations in this diff, could you try my fix for this and let me know if it works for you: #357 ? Seems to work fine on my Win11 test setup. |
Prevent Unnecessary Reconnects
Description
This PR stems from the issue I reported around input connections. See the issue for steps to recreate the bug. To fix this, I added a port name to the input manager and check that the port names match before deciding whether or not i should try to reconnect. as well, I added logic to explicitly drop previous connections before attempting to reconnect. Doing these things has led to more stable input manager connections.
Key Changes
MIDI input connection lifecycle
Improved MIDI port Identity
Testing