View Single Post
Old 07-26-2018, 09:53 AM  
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 449
Default

I have found some API-issues/regressions, but I'm not sure, in which release they've appeared.

a) There seems to be a problem with GetMediaSourceFileName(), that wasn't in Reaper5.77
The following code should create the error-message "PCM-source expected", but instead, Lua gets stuck for this script, leading th effect, that the script, in which this code is executed, can's be run again until Reaper gets restarted. It worked in 5.77 perfectly.

Code:
-- This script should end with an error-message "PCM-source expected" when executing GetMediaSourceFileName
-- This script worked in Reaper 5.77 with SWS 2.9.7 sucessfully
-- But in 5.93, it get's stuck when coming to GetMediaSourceFileName. Even worse, this script can't be executed anymore, until Reaper is restarted.
function Type(parameter)

  reaper.MB("This Messagebox will be displayed","",0)

  One,Two=reaper.GetMediaSourceFileName(parameter,"")

  reaper.MB("This Messagebox will NOT be displayed. Lua for this script is stuck 'til restart of Reaper.","",0)

end

Take=reaper.GetMediaItemTake(reaper.GetMediaItem(0,0),0)
RprMidiTake=reaper.FNG_AllocMidiTake(Take)
D=reaper.FNG_GetMidiNote(RprMidiTake, 0)
L=Type(D)

b) API-Docs: ValidatePtr2 has PCM_source* stated as valid ctypename, but it should be "PCM_Source*" with a S in source, not s.
mespotine is offline   Reply With Quote