View Single Post
Old 10-31-2020, 02:20 PM   #334
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Quote:
Originally Posted by daxliniere View Post
Then it obviously exists somewhere.
Well, Yes and No, they don't exist, at least not yet. The recorded files exist and Reaper keeps some information in its back for later management, but the takes/items-datastructures are only created AFTER you ended the recording, or you could access them via reaper.GetMediaItem().
I had the same idea back then as the UI obviously shows an existing and growing item but in fact, Reaper creates the datastructure for item/takes only after that.
So you can't access them until then.

Technically it would be possible to make something like that working, so the devs could add accessible items of the items in recording as well.
BUT as I said, you would need to limit access to such items. You have plenty functions who allow setting attributes like position or length who shouldn't be alterable during recording to prevent possible playback-problems.
Others, as I said like take markers could be easily changed during recording.

That's the challenge. This must be balanced with the current paradigms of Item/Take-objects as no script is expecting items only halfway alterable and access of the other half restricted. This could make old scripts incompatible who rely on that paradigm.
So the paradigm of getting an item/take-object and working with it has potential backwards-compatibility-problems with items currently in recording. I mean, try to delete an item currently in recording. You don't want this at all nor can't you, not even via Reaper's GUI.

So to make this go real good, you would either need to overhaul the current system, as take-objects and item-objects have a precise way of working who must be compatible with old scripts.

Or, you add takemarker-functions that can be used only for items currently in recording and not for any existing item.

For instance:
Quote:
boolean retval, integer take_marker_idx, string take_marker_guid, integer itemidx, integer takeidx = reaper.AddTakeMarker_WhileRecording(MediaTrack track, string markername, integer colorvalue)
which would add a take-marker to the item/take currently in recording on a certain track and would be added to the item/take after recording automatically by Reaper, which could be accessed after recording with the regular take-marker-functions, as you know the itemnr, takenr and takemarker-number and therefore can "refind" the takemarker.

This would keep the already existing item/take-system intact while allowing to add take-markers for items currently recording, as you don't need to get Item/Take-objects first before adding a stretch-marker.
But it also means, that setting or deleting them during recording wouldn't work. And if the item in recording isn't finished yet, the returned item/take-number is still invalid and therefor you need to wait until the recording is finished, before this item/take is actually accessible.

I personally would love to see GetSetMediaItemInfo_String() for items in recording as well.
And plenty of other item/take-attributes accessible like getting these during recording:
Code:
D_POSITION : double * : item position in seconds
I_LASTY : int * : Y-position of track in pixels (read-only)
I_LASTH : int * : height in track in pixels (read-only)
I_CUSTOMCOLOR : int * : custom color, OS dependent color|0x100000 (i.e. ColorToNative(r,g,b)|0x100000). If you do not |0x100000, then it will not be used, but will store the color.
I_CURTAKE : int * : active take number
IP_ITEMNUMBER : int, item number on this track (read-only, returns the item number directly)
Ooof....I guess, I was overspecific with that one, as I'm too deep into developing properly designed API-functions for my Ultraschall-API and immediately see the nightmarish dependencies coming up.
Sorry for that.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...

Last edited by Meo-Ada Mespotine; 10-31-2020 at 02:27 PM.
Meo-Ada Mespotine is offline   Reply With Quote