Fix/unipad keyled ownership tracking#9
Open
GauravM512 wants to merge 3 commits into
Open
Conversation
Contributor
Author
|
Here's a preview of final frame fading fix(0d3d9af) Left: current/default behavior. Right: behavior with this fix applied lastframe.fix.mp4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This fixes an issue where multiple parallel KeyLED files could interfere with each other in Unipad conversions.
In Unipad, each pad keeps track of a single active LED "owner". When an animation takes ownership of a pad, any older animation that was previously controlling that pad can no longer turn it off. If it later sends an Off event, that event is ignored. This is what allows overlapping animations to coexist without unexpectedly clearing each other's colors.
Amethyst wasn't following this behavior. Since all
KeyframesChainDevicesignals were being emitted on the same layer, an Off event from one file would remove the shared signal entry and unintentionally clear the output from other files using the same pad.This PR introduces an optional
UnipadOwnershipTrackerthat mirrors Unipad's KeyLED handling. The tracker is enabled only for Unipad conversions throughKeyframesChainDeviceState.useOwnershipTracking, so the change is isolated and doesn't affect other converters.Example:
This matches Unipad's behavior and prevents one animation from accidentally turning off another.
A comparison video is included below. Left: current/default behavior. Right: behavior with this fix applied (matches Unipad).
Using Shape of You Unipack.
References
This implementation mirrors Unipad's LED ownership behavior:
LedRunner.kt(btnLedownership check when processing Off events)LedRunner.kt(Led.equal()comparison used to verify ownership)UniPack.kt(ledGet()/ledPush()ownership storage and updates)Source: [Unipad Android Repository]
unipad.led.ownership.mp4