 |
|
|
11-05-2009, 03:42 AM
|
#1
|
|
Mortal
Join Date: Dec 2008
Location: France
Posts: 394
|
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 !
|
|
|
11-05-2009, 04:04 AM
|
#2
|
|
Mortal
Join Date: Sep 2009
Posts: 163
|
Not sure I understand your question Jeffos: we're not talking GetSelectedTrack() here, right?
Maybe you meant "item" or "take", not "track"?
|
|
|
11-05-2009, 04:19 AM
|
#3
|
|
Mortal
Join Date: Dec 2008
Location: France
Posts: 394
|
..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.
|
|
|
11-05-2009, 07:03 AM
|
#4
|
|
Mortal
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 2,364
|
Quote:
Originally Posted by Jeffos
..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.)
|
|
|
11-05-2009, 07:04 AM
|
#5
|
|
Mortal
Join Date: Sep 2007
Location: Madison, WI
Posts: 359
|
Jeffos, pass the MediaTrack* into GetSetObjectState.
[edit Xen beat me with a better answer  ]
|
|
|
11-05-2009, 07:09 AM
|
#6
|
|
Mortal
Join Date: Dec 2008
Location: France
Posts: 394
|
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 ?
|
|
|
11-05-2009, 07:13 AM
|
#7
|
|
Mortal
Join Date: Sep 2007
Location: Madison, WI
Posts: 359
|
Why, MediaTrack* GetTrack(ReaProject* proj, int trackidx) of course!
|
|
|
11-05-2009, 07:13 AM
|
#8
|
|
Mortal
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 2,364
|
Quote:
Originally Posted by Jeffos
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...
|
|
|
11-05-2009, 07:23 AM
|
#9
|
|
Mortal
Join Date: Dec 2008
Location: France
Posts: 394
|
Quote:
Originally Posted by sws
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!
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 06:44 AM.
|