usage example for inserting media
I can't seem to find a ReaScript usage example for media source file insertion.
It would seem like RPR_InsertMedia would be the appropriate function, but I can't tell exactly what it returns. I suppose I would really like for it to return a handle to the MediaItem it just created so I can set it's position, offset, length, etc., but I don't think that's what it's returning. One piece of documentation says it's returning an int. Another says it's returning an array. Neither says it is returning a handle to the item it just created.
Part of my problem is probably just not knowing exactly what everything does, but it seems like the only safe way to get the new MediaItem handle, depending on whether using the existing track mode or new track mode is to enumerate all the tracks to see what track just got added. Or if adding an item to an existing track that already contains a bunch of items, to collect and compare all previously existing items to all now existing items to figure out which item just got added.
I feel like I must be missing something because the InsertMedia function seems almost useless without a way to access the item created.
Can anyone toss me a bit of insight?
__________________
Doug Gallob - Composer/Audio Engineer
Aural Hygiene - "Dangerous Music for Dangerous Movies"
|