|
|
|
08-17-2019, 08:43 AM
|
#1
|
Human being with feelings
Join Date: Oct 2017
Location: Black Forest
Posts: 5,054
|
Issue with SWS and custom script
Posting this here as well:
I'm using Justins SWS build on Windows 10 with Reaper 5.981 dev0814 and there's a problem with "SWS/BR actions that play from mouse cursor position and solo track under mouse for the duration".
Executing it once will work flawlessly, but having done that, the GUI goes nuts (artefacts and Reaper becomes unusable). Executing it a second time creates a time selection and solo does not work anymore. Also, the "play cursor" disappears.
Have a look at the GIF:
https://nextcloud.stephanroemer.net/...2AqSDQcYgwT4Yo
Bug report on GitHub:
https://github.com/reaper-oss/sws/issues/1180
Last edited by _Stevie_; 08-17-2019 at 10:17 AM.
|
|
|
08-17-2019, 09:40 AM
|
#2
|
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 15,721
|
Hmm I can't duplicate this, post your reaper.ini and .rpp file?
|
|
|
08-17-2019, 09:43 AM
|
#3
|
Human being with feelings
Join Date: Oct 2017
Location: Black Forest
Posts: 5,054
|
|
|
|
08-17-2019, 09:51 AM
|
#4
|
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 15,721
|
Hmm still working fine here...
|
|
|
08-17-2019, 09:53 AM
|
#5
|
Human being with feelings
Join Date: Oct 2017
Location: Black Forest
Posts: 5,054
|
Hmm, will investigate and see what else it could be.
|
|
|
08-17-2019, 09:53 AM
|
#6
|
Human being with feelings
Join Date: Jun 2018
Posts: 375
|
Seems to be working fine for me in dev0813, FWIW.
Btw, what theme is that? Looks nice
|
|
|
08-17-2019, 09:55 AM
|
#7
|
Human being with feelings
Join Date: Oct 2017
Location: Black Forest
Posts: 5,054
|
Will check what happens, when I install the regular SWS version.
That's i Logic 3 from Blankfiles.
|
|
|
08-17-2019, 10:11 AM
|
#8
|
Human being with feelings
Join Date: Dec 2009
Location: Oblivion
Posts: 10,255
|
Uhm...what's "justin's sws build?"
|
|
|
08-17-2019, 10:17 AM
|
#9
|
Human being with feelings
Join Date: Oct 2017
Location: Black Forest
Posts: 5,054
|
Okay, found it. It seems to be triggered by one of my scripts.
I'm using a custom script to mimic a different play/pause behavior.
Pause is essentially stop + move editor cursor to play cursor.
So, executing the SWS action, followed by a stop from this script, triggers that behavior.
Code:
function NoUndoPoint() end
playstate = reaper.GetPlayState() -- get play state of the transport
if playstate > 0 then -- when play state is greater 0 (play, pause, record)
reaper.Main_OnCommand(40434, 0) -- View: Move edit cursor to play cursor
reaper.Main_OnCommand(1016, 0) -- Transport: Stop
else
reaper.Main_OnCommand(1007, 0) -- Transport: Play
end
reaper.defer(NoUndoPoint)
|
|
|
08-17-2019, 10:36 AM
|
#10
|
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 15,721
|
Quote:
Originally Posted by _Stevie_
Okay, found it. It seems to be triggered by one of my scripts.
I'm using a custom script to mimic a different play/pause behavior.
Pause is essentially stop + move editor cursor to play cursor.
So, executing the SWS action, followed by a stop from this script, triggers that behavior.
Code:
function NoUndoPoint() end
playstate = reaper.GetPlayState() -- get play state of the transport
if playstate > 0 then -- when play state is greater 0 (play, pause, record)
reaper.Main_OnCommand(40434, 0) -- View: Move edit cursor to play cursor
reaper.Main_OnCommand(1016, 0) -- Transport: Stop
else
reaper.Main_OnCommand(1007, 0) -- Transport: Play
end
reaper.defer(NoUndoPoint)
|
Got it, thanks.
|
|
|
08-17-2019, 10:40 AM
|
#11
|
Human being with feelings
Join Date: Oct 2017
Location: Black Forest
Posts: 5,054
|
Quote:
Originally Posted by Justin
Got it, thanks.
|
Awesome!
@FoxAsteria: the devs did some changes in the latest Reaper (better performance for a huge amount of tracks). But they had to change the way tracks are seen (every track used to have its own hwnd, if I'm not mistaken). SWS Mouse actions were still depending on this earlier method. So Justin fixed some code in SWS to make this work again. Justin's code will be incorporated in the next SWS release.
|
|
|
08-17-2019, 11:04 AM
|
#12
|
Human being with feelings
Join Date: Dec 2009
Location: Oblivion
Posts: 10,255
|
Oh la la. More performance always a good thing. Thx!
|
|
|
08-17-2019, 11:54 AM
|
#13
|
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 15,721
|
This bug actually should affect 5.981/release SWS too.
|
|
|
08-17-2019, 11:55 AM
|
#14
|
Human being with feelings
Join Date: Oct 2017
Location: Black Forest
Posts: 5,054
|
Yes, sorry, forgot to mention, I tested it with the current SWS, as well.
|
|
|
08-17-2019, 12:13 PM
|
#15
|
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 15,721
|
Ahh, OK, so what happens here is:
1) Your ReaScript triggers stop
2) reaper_sws gets notified of playback stopping -- notifies REAPER to stop doing UI updates, and installs a timer to re-enable them later
3) Your ReaScript terminates. REAPER sees the "do not perform UI updates" flag is still set, clears it (assuming the script left it on).
4) reaper_sws's timer runs, decrementing the UI update flag, causing an incorrect state.
This is a bit tricky (the whole notion of this flag is a bit fragile). The cleanest fix would probably be to disable the disabling+timer in sws...
|
|
|
08-17-2019, 12:34 PM
|
#16
|
Human being with feelings
Join Date: Oct 2017
Location: Black Forest
Posts: 5,054
|
Thanks for explaining, Justin!
That's tricky indeed.
|
|
|
08-17-2019, 01:25 PM
|
#17
|
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 15,721
|
Quote:
Originally Posted by _Stevie_
Thanks for explaining, Justin!
That's tricky indeed.
|
As a workaround, maybe you can use a custom action rather than a reascript to
stop? Or something...
|
|
|
08-17-2019, 01:26 PM
|
#18
|
Human being with feelings
Join Date: Oct 2017
Location: Black Forest
Posts: 5,054
|
Could I use a cycle action or what that trigger the same effect?
|
|
|
08-17-2019, 01:29 PM
|
#19
|
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 15,721
|
Quote:
Originally Posted by _Stevie_
Could I use a cycle action or what that trigger the same effect?
|
I forget (afk) is there a play-state meta action? Err looks like not. Pause might have the behavior you want, too. Or maybe you can always do “move edit cursor to play cursor” before calling play/stop
|
|
|
08-17-2019, 01:31 PM
|
#20
|
Human being with feelings
Join Date: Oct 2017
Location: Black Forest
Posts: 5,054
|
Pretty much, yes. You can do a:
If next action is on "Transport: Play"
do "Transport: stop"
I will just try it out.
EDIT: yep, that works!
|
|
|
08-23-2019, 09:02 AM
|
#21
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
@Justin
I also run often into problems with PreventUIRefresh, mostly when I decrement the counter to prevent uirefresh, but another function incremented it to prevent uirefresh, so it's not prevented anymore.
Could it help, if a script would not in/decrement the counter but rather set/unset a token to
register "I want to prevent UI refresh"?
And it gets reset after script is finished, if still set?
That way, there's only a way to do it with more consistency, means, no matter how many functions use UIRefresh, they can only set it once.
So maybe only an internal counter for every script instance, incremented/decremented automatically by the Un/SetToken-function.
But not "globally", as I think it is currently now.
That way, we could only do "PreventUIRefresh2(true/false)" or something, not messing around with the counter directly.
No idea, if that would work for extension-plugins, or if this would cause scripts, though...
If I understood the problem at all
Last edited by Meo-Ada Mespotine; 08-23-2019 at 09:08 AM.
|
|
|
08-23-2019, 10:12 AM
|
#22
|
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 15,721
|
I don't think it's a problem, as long as plugins/scripts use preventuirefresh as designed, which is to say, only prevent UI refresh for as short of a time as possible. E.g. if you're going to do a batch of operations, prevent refresh while doing that batch, but enable it immediately after. In this case there is no issue.
In fact it might make sense to make it not even a counter, but just a flag, so that the consequence of misuse is just slightly reduced performance, which could be spotted and fixed, rather than it getting into an undesirable state...
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 01:50 PM.
|