Old 03-03-2014, 04:17 AM   #1
matthewjumpsoffbuildings
Human being with feelings
 
Join Date: Mar 2013
Posts: 463
Default Select Media Item

How do I select a new item via ReaScript? I know I can run a series of actions to move the cursor around and select items underneath it, but I cant find a way to select a new item if I have an item ID variable in a script.

Is there some kind of "RPR_SelectMediaItem(ItemID)" function Im missing?
matthewjumpsoffbuildings is offline   Reply With Quote
Old 03-03-2014, 08:33 AM   #2
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,668
Default

There's RPR_SetMediaItemSelected:

Code:
C: void SetMediaItemSelected(MediaItem* item, bool selected)

EEL: SetMediaItemSelected(MediaItem* item, bool selected)

Python: RPR_SetMediaItemSelected(MediaItem* item, Boolean selected)
(May need UI refreshing after RPR_SetMediaItemSelected)
Code:
RPR_UpdateArrange()
spk77 is offline   Reply With Quote
Old 03-03-2014, 08:46 AM   #3
matthewjumpsoffbuildings
Human being with feelings
 
Join Date: Mar 2013
Posts: 463
Default

Thanks, I worked out I could use the B_UISEL media item info value, but this is much neater.

There doesnt appear to be a difference between the two methods, is there?
matthewjumpsoffbuildings is offline   Reply With Quote
Old 03-03-2014, 08:53 AM   #4
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,668
Default

Quote:
Originally Posted by matthewjumpsoffbuildings View Post
Thanks, I worked out I could use the B_UISEL media item info value, but this is much neater.

There doesnt appear to be a difference between the two methods, is there?
No difference (I think SetMediaItemSelected is a newer function).
spk77 is offline   Reply With Quote
Old 03-03-2014, 08:55 AM   #5
matthewjumpsoffbuildings
Human being with feelings
 
Join Date: Mar 2013
Posts: 463
Default

Ah cool. Thanks for the tips.

Btw the wiki pages on the ReaScript API seem pretty undercooked in places, is there a better, more up to date resource?
matthewjumpsoffbuildings is offline   Reply With Quote
Old 03-03-2014, 09:08 AM   #6
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,668
Default

Quote:
Originally Posted by matthewjumpsoffbuildings View Post
Ah cool. Thanks for the tips.

Btw the wiki pages on the ReaScript API seem pretty undercooked in places, is there a better, more up to date resource?
Go to REAPER help menu -> ReaScript documentation (REAPER will auto-generate a ReaScript help/doc page)
spk77 is offline   Reply With Quote
Old 03-03-2014, 09:12 AM   #7
matthewjumpsoffbuildings
Human being with feelings
 
Join Date: Mar 2013
Posts: 463
Default

Cheers, why didnt I notice that
matthewjumpsoffbuildings 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 05:53 AM.


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