View Single Post
Old 02-09-2022, 01:11 PM   #16
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,721
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
I've done some tests with the extension of metadata-length using some testdata of 500MB.

It works good with GetSetProject_String, setting and getting with currently opened projects, so this works perfect.

However, I noticed, two other issues:

1) when I save a project with the user-metadata, it will only store the first ~8k of it and then truncate it.
It should be possible to store the entire user-metadata, imho.

2) when the user-metadata contains a \n in it, it will be replaced with a space. Would it be possible to retain \n in the project-file as well,
maybe storing it as BASE64, like multiline-strings in projextstates? Or does this have possible problematic implications with certain metadata-schemes?

FWIW, I generated the test-metadata with this code, using "ID3:TXXX:TUCH" for the test-metadata:

Code:
-- create 500MB test-metadata
A=""
B=""
C=""
-- kilobyte
for i=1, 1024 do A=A..string.char(math.random(255)) end

-- megabyte
for i=1, 1024 do B=B..A end

A=""

-- 500 megabyte
for i=1, 500 do C=C..B end

-- write and read metadata
A,B=reaper.GetSetProjectInfo_String(0, "RENDER_METADATA", "ID3:TXXX:TUCH|"..C, true)
X,Y=reaper.GetSetProjectInfo_String(0, "RENDER_METADATA", "ID3:TXXX:TUCH|", false)

-- check if strings are identical
F=C==Y
I've tested it on the 2901-dev-release, but I suppose, it's present in this release as well.
Thanks, fixing the length issues now -- but be aware the metadata APIs are not binary-safe, e.g. a 0 byte in the middle of the string will terminate it (we may fix that at some point)
Justin is offline   Reply With Quote