View Single Post
Old 06-13-2018, 10:56 AM   #1
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 521
Default Markers: A unique identifier/guid for markers/regions/time-signature-markers

I would love to have unique-identifiers/guids for markers/regions and time-sig-markers.

I'm currently working on a set of functions for ReaScript-Lua-Coders, that helps storing additional metadata for objects with guids, like tracks, items, etc to have something more flexible than ProjectNotes/ItemNotes, etc.
I'm doing it using ProjectExtStates, where extname is the guid of the object, the key the additional "metadata"-tag and the value it's value.
That way, an object can have one or more additional "tags" stored that way.


Now here is my problem: I can't do that for markers/regions/time-sig-markers, as there is no unique identifier for markers/regions/timesig-markers.
When I use the idx of the first marker(of three in my project), it will become obsolete as unique identifier, when I move the first marker past the last one.
When I use the shown number, it will become obsolete, as soon as the user changes the number.
Using the text is impossible, as this text could change every minute.
And checking the markers for changes using a defer-script is also only helpful, when only one marker is changed; as soon as several markers are changed at the same time(using some script or so), it would be a mess to code a defer-checker-script, if possible at all.

So when I want to associate to a marker/region/timesig-marker a ProjExtState, I have no identifier to use as extname, that will stay the same no matter what the user inputs or does to markers.

That's why I would love to have a guid to use for the marker, that can be used in the background by scripts, without having to force the user to not do certain things(like changing several markers at a time).



One usecase for my set of functions would be storing additional metadata-tags to be used as ID3-tags to regions/markers themselves, not inside the marker-text, but rather in the ProjExtStates associated with the region/marker using the guid as extname.
After rendering, I could read out this additional tag-information from a specific region and add them to the rendered file using the SWS-function SNM_TagMediaFile().


PS: the following functions would probably be useful to add to the api,
Code:
GetGuidFromMarker(integer idx)
GetGuidFromRegion(integer idx)
GetGuidFromTimeSigMarker(integer idx)
When storing it into RPP-files without loosing backwards-compatibility, I would suggest something like adding additional entries after the MARKER-entries
Code:
MARKER_GUID idx guid
where idx is the position of the marker in the MARKER-list and guid the guid itself.


PPS: Hope, I didn't write this overspecific

Last edited by mespotine; 08-24-2018 at 05:21 AM.
mespotine is offline   Reply With Quote