Toufool / AutoSplit

Easy to use image comparison based auto splitter for speedrunning on console or PC.
GNU General Public License v3.0
267 stars 30 forks source link

Fussy window name matching #237

Open Gikkman opened 1 year ago

Gikkman commented 1 year ago

Is your feature request related to a problem? Please describe. I've noticed that the Window Name matching function only matches exact window names. Unfortunately, OBS has its' version included in the window name, so whenever OBS updates, the window matching fails and we need to re-do it by hand.

Describe the solution you'd like I would like the window matching to be a bit more fuzzy. If it cannot find the exact window name, instead calculate the Levenshtein distance to all other windows and pick the one that is the closest.

Describe alternatives you've considered Alternatively, you could instantly bring up the "match window" function if no window matches. Though, I guess it could create problems if you start AutoSplit before the captured program. Though, the same is true for my suggested solution.

Another idea could be to allow patterns in the window name. So say you match against the string: OBS * (64-bit, windows) - Portable Mode - Profile: Gikkman - Scenes: Scenes

Avasam commented 1 year ago

Sounds reasonable. My only concern is when the window you want to target isn't already open, there should probably be some sort of threshold on the match. Otherwise I'd have to add constant checking (which could be done after #219 ). Maybe I could test with common use-cases like OBS and some emulators.

Gikkman commented 1 year ago

You raise a good point about the window not even being open. For an initial implementation, I would probably set a distance threshold, and if nothing is found within the threshold, just leave the match window blank (like it is today).