-
Notifications
You must be signed in to change notification settings - Fork 414
Fixes to seeking and auto restore #4347
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
Conversation
4db1ca5
to
35e17b2
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Does that even make sense though? Maybe seeking while unpaused and in recording mode actually should pause once seeking finishes? I generally do not really see a situation in which you would want to seek somewhere while unpaused and in recording mode, that sounds like a recipe to lose inputs. |
If we don't know what workflow would do that, then I think the best thing to do is provide consistent behavior. Making an exception for a special case we don't understand seems like a bad idea. As for losing inputs, the undo feature exists so I don't see this as being an issue. (It's currently totally broken in recording mode, but that's another issue and a bug I intend to fix.) |
628fdaa
to
765fc7f
Compare
Most recent commit (fix for Lua) changes the behavior of the Lua API. Previously, Although the old behavior is very bad, some Lua scripts could potentially no longer work without modifications. Is there significant value in making the old behavior available? |
Sounds kinda weird. Callbacks being ignore while it's seeking may or may not be desirable (I never used lua to control tastudio/taseditor behavior in real tasing), but "set playback" implies a concrete event which is defined in that function's description:
The goal is getting to that frame before we do something. After it finishes, it is expected that it's now safe to do whatever we wanted to do on that frame (or marker). Especially if there has to be a lot of seeking due to lack of states on those frames: if we say "Hey tastudio, please put playback on frame 9000!" we won't be satisfied if it puts it on frame 1000 and says "Done!!!".
Why? |
This is at least trivial to fix in Lua:
|
It's not something that needs fixing because it's not a bug but an explicit function. We told it to get there, it got there, we're done.
Didn't know about that. Does it depend on any option or is the freeze forced no matter what?
This sounds like you have turbo seeking enabled and scripts during turbo disabled. If that's not the case, then I agree that it's also a problem. However it doesn't mean that when we tell it to frame 1000 it should start seeking from frame 10 and immediately say "done!" There needs to be some proper solution to it doing this deep freeze. |
The freeze is forced no matter what.
It freezes without turbo seek. I rarely have turbo seek enabled, and never turn off scripts during turbo. I don't know what we could do to allow the script to run during the seek, without returning from |
Maybe I'm seeing it now. So what actually happens when I do What about |
Also, if the UI did not freeze then the user would be able to pause emulation and interrupt the seek. This will be much easier to handle if |
There are two possibilities here. In either situation, seekframe will freeze the UI and seek, the same as old setplayback behavior (for when the movie did have 9000 frames) and just as it would in the current master branch since I haven't modified that code |
Yeah okay. As long as it keeps seeking (until you disable it) returning right away is better. |
086337d
to
3df4889
Compare
My list of things to change in this branch is now empty. Please review. |
src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Navigation.cs
Outdated
Show resolved
Hide resolved
Fixed issues brought up in @YoshiRulz review along with one or two other cleanups. Also fixed regression and accidental behavior change: Lua's GreenzoneInvalidatedCallback was getting called at a different point and sometimes not at all. |
src/BizHawk.Client.EmuHawk/tools/Lua/Libraries/TAStudioLuaLibrary.cs
Outdated
Show resolved
Hide resolved
|
||
if (needsRefresh) | ||
{ | ||
if (TasView.IsPartiallyVisible(frame) || frame < TasView.FirstVisibleRow) |
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.
if (TasView.IsPartiallyVisible(frame) || frame < TasView.FirstVisibleRow) | |
if (frame <= TasView.LastVisibleRow || TasView.IsPartiallyVisible(frame)) |
May be faster?
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.
Probably, but there are more significant performance optimizations in the implementation of ListView if you want to go there. In this particular case it's insignificant since (1) this isn't performance-sensitive logic and (2) the vast majority of edits will be in visible rows anyway.
This comment was marked as resolved.
This comment was marked as resolved.
…al case. So just use the code of StartAtNearestFrameAndEmulate instead. Fixes multiple bugs when seeking to frames past the end of the movie.
…even if this right click made no edits)
…le recording mode, regardless of whether an edit was made. Fix: Clicking on an axis value while in axis editing mode would trigger auto-restore, even if no edit was made (seek to last edit frame).
…tore for right-click edits.
…the issue it was supposed to fix, and the later commit that actually fixes it was all that was needed all along.
… refreshing in FrameEdited. Fixes more bugs.
… invalidated, instead of manually calling at each edit point. This fixes auto-restore for undo/redo actions.
…en if no change was made.
…he seek has completed, making the Lua script unable to see the frames during the seek.
Also, fix: Middle-click restore would not update seek begin frame, potentially causing seek progress indicator to be wrong.
…ress. This might be what StartSeeking's fromMiddleClick parameter (removed in last commit) was attempting to do.
…hen making multiple edits with auto-restore off if the edit caused a seek of >1 frame.
…ayback, freezing the UI. Since seekframe cannot go backwards, updating it to return immediately results in it doing absolutely nothing. Note that it never was doing a "seek" as defined by MainForm, so we aren't removing that feature. And turbo-seek isn't relevant both because it wasn't a seek and because currently the only way to have a turbo-seek is to use the Play Movie dialog. If true seeking is desired a new lua method should be made. Also also, it did not actually touch InvisibleEmulation.
…know how long it's going to take! Also if the user ends up pausing there should be a visual indication of seeking.
…d permanently suppress Lua. Fix: Using tastudio.setplayback with a Lua number that happens to not currently be represented as an integer would throw.
Is bug fix 2) in OP the same as #2329? |
Probably not, since he doesn't mention recording mode. It's more likely he was experiencing bug 3, but none of his posts indicate the steps taken to reproduce the bug so I can't tell. EDIT: No, not 3, since he said he was clicking on the left column not doing edits. |
The current implementation of TAStudio is a gigantic mess and has various pesky bugs. This is an attempt to resolve some of these issues.
Changes that are not bug fixes:
R
.tastudio.setplayback
to return as soon as the seek begins. This is basically a side-effect of fixing bugs. See comments below for reasoning. (Fixes to seeking and auto restore #4347 (comment))client.seekframe
. It would freeze the user interface for the duration of the seek, same as setplayback.List of bugs fixed (also in commit message):
EDIT: I'm not listing them all here anymore, see commit comments for more details. But, somewhere along the line I accidentally fixed these:
I've done my best to avoid changing any behavior that isn't a bug. If you see any, please let me know.
Check if completed: