Old 11-05-2009, 03:42 AM   #1
Jeffos
Mortal
 
Join Date: Dec 2008
Location: France
Posts: 394
Default Tracks in multi-projects + pop-corn!

I'm now deeply in GetSetObjectState(). The question I have, is how I can get a track for a given project ?
For envelopes, I've seen GetSelectedTrackEnvelope() that allows retreiving an envelope in a given project, didn't find any comparable thing for tracks (perhaps it's meaningless, ie limited to current project ?).
__

OT: the dev sub-forum was sooo calm a few weeks ago... and now it's in fire! many, many question since reaScript is born!! I have to say that's I'm having a great time seeing all these threads (I often ask myself the same Q's, but for C++) eating some pop-corn during the show
My api knowledge is growing a bit but it's not enough to help about the recent Q's... but I'll do it if I can!

I want to thank the questionners (especially, MikeLacey but others too) and of course the answerers Xenakios, SWS, .. and of course schwa, who visibly makes a real effort about that. Time to say that all of that is very, Very, VERY much appreciated here, thanks to all !
Jeffos is offline   Reply With Quote
Old 11-05-2009, 04:04 AM   #2
Padre_PC
Mortal
 
Join Date: Sep 2009
Posts: 163
Default

Not sure I understand your question Jeffos: we're not talking GetSelectedTrack() here, right?

Maybe you meant "item" or "take", not "track"?
Padre_PC is offline   Reply With Quote
Old 11-05-2009, 04:19 AM   #3
Jeffos
Mortal
 
Join Date: Dec 2008
Location: France
Posts: 394
Default

..ah! Ok, "Get*SELECTED*TrackEnvelope", I didn't see that. What I mean is how can I get a track -which is perhaps not selected- in a given project, do we really have to select it first? [edit] humm.. but to select it, we have to get it 1st![/edit] The same Q goes for enveloppe, in fact.

Last edited by Jeffos; 11-05-2009 at 04:30 AM.
Jeffos is offline   Reply With Quote
Old 11-05-2009, 07:03 AM   #4
Xenakios
Mortal
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 2,364
Default

Quote:
Originally Posted by Jeffos View Post
..ah! Ok, "Get*SELECTED*TrackEnvelope", I didn't see that. What I mean is how can I get a track -which is perhaps not selected- in a given project, do we really have to select it first? [edit] humm.. but to select it, we have to get it 1st![/edit] The same Q goes for enveloppe, in fact.
For envelopes there is nothing else but : GetSelectedTrackEnvelope(), which then can be used with GetSetObjectState(). So it follows the same limited functionality as in Reaper's GUI : only one envelope can be selected at a time for manipulation.

To get a pointer to an indexed track (in the order they appear in the track control panel) :

MediaTrack* pTrack=CSurf_TrackFromID(index,false);

Where index 0 means the master track and 1 means the topmost normal track in the project. To not ask for tracks that don't exist and get some nasty error, use GetNumTracks() to get the number of tracks currently in the project. (The last track index valid for CSurf_TrackFromID would then be GetNumTracks()+1.)
__________________
For info on Reaper extension plugins (including Xenakios' previous extensions) :

http://www.standingwaterstudios.com/reaper
http://code.google.com/p/sws-extension/

-X
Xenakios is online now   Reply With Quote
Old 11-05-2009, 07:04 AM   #5
sws
Mortal
 
sws's Avatar
 
Join Date: Sep 2007
Location: Madison, WI
Posts: 359
Default

Jeffos, pass the MediaTrack* into GetSetObjectState.

[edit Xen beat me with a better answer ]
sws is offline   Reply With Quote
Old 11-05-2009, 07:09 AM   #6
Jeffos
Mortal
 
Join Date: Dec 2008
Location: France
Posts: 394
Default

thanks to both of you! yes, I'm used to CSurf_TrackFromID(), what I mean is; is there a way to get tracks in another project than the current one ?
Jeffos is offline   Reply With Quote
Old 11-05-2009, 07:13 AM   #7
sws
Mortal
 
sws's Avatar
 
Join Date: Sep 2007
Location: Madison, WI
Posts: 359
Default

Why, MediaTrack* GetTrack(ReaProject* proj, int trackidx) of course!
sws is offline   Reply With Quote
Old 11-05-2009, 07:13 AM   #8
Xenakios
Mortal
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 2,364
Default

Quote:
Originally Posted by Jeffos View Post
thanks to both of you! yes, I'm used to CSurf_TrackFromID(), what I mean is; is there a way to get tracks in another project than the current one ?
Ok, that wasn't entirely clear from your question. I don't unfortunately know, I haven't done much, if any, explicit support for multiple project tabs.

edit : Nevermind, sws got the answer...
__________________
For info on Reaper extension plugins (including Xenakios' previous extensions) :

http://www.standingwaterstudios.com/reaper
http://code.google.com/p/sws-extension/

-X
Xenakios is online now   Reply With Quote
Old 11-05-2009, 07:23 AM   #9
Jeffos
Mortal
 
Join Date: Dec 2008
Location: France
Posts: 394
Default

Quote:
Originally Posted by sws View Post
Why, MediaTrack* GetTrack(ReaProject* proj, int trackidx) of course!
duh! Indeed!
ok, sorry guys: I'll now be sure I've "auto-upgraded" my SDK before asking such questions... GREAT!
Jeffos 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 06:49 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.