Old 09-12-2014, 05:05 PM   #1
sdog
Human being with feelings
 
sdog's Avatar
 
Join Date: Aug 2010
Location: Crawford, CO
Posts: 43
Default 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"
sdog is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 07:15 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.