Old 04-14-2014, 11:55 AM   #1
Viente
Human being with feelings
 
Viente's Avatar
 
Join Date: Feb 2012
Posts: 1,972
Default SNM_AddReceive from the pointer list

Dear Pythonheads! Im trying to remember everything what i learnt about Python for the last few years. So far everything not bad, but some things missing in my head.

I want to use SNM_AddReceive to add a Receives to a new track from selected tracks.

So the first i collected all selected tracks pointers to a list

Code:
def GetSelectedTracksID():

	selCount = RPR_CountSelectedTracks(0) # Count selected tracks
	numTracks = 0

	pointerList = [] # create an empty list

	while numTracks < selCount: # Go through all selected tracks

		trackID = RPR_GetSelectedTrack(0, numTracks) # Get pointer of each track in loop

		pointerList.append(trackID) # add this pointer to pointerlist

		numTracks += 1

	return pointerList
Then i called this function and inserted a new track with action
Code:
GetSelectedTracksID()
RPR_Main_OnCommand(40001,0)
And now i want to use this
Code:
bool SNM_AddReceive(MediaTrack* src, MediaTrack* dest, int type)
And i can't remember how to properly use my ID's from a pointerList in this string since its not a one track but a list of tracks...Could anybody help me please?

Thanks!!

Last edited by Viente; 04-14-2014 at 12:25 PM.
Viente is offline   Reply With Quote
Old 04-14-2014, 02:55 PM   #2
gofer
-blänk-
 
gofer's Avatar
 
Join Date: Jun 2008
Posts: 11,359
Default

You could probably do something like:
Code:
NewTrackID = RPR_GetSelectedTrack(0, 0) # Get pointer of inserted track

for i in range selCount:
    SNM_AddReceive(pointerList[i], NewTrackID, -1) # the i in square brackets points to the indexes of your pointer list. -1 is default type
gofer is offline   Reply With Quote
Old 04-14-2014, 05:35 PM   #3
Viente
Human being with feelings
 
Viente's Avatar
 
Join Date: Feb 2012
Posts: 1,972
Default

Thanks bro!

You only forgot brackets for i in range (selCount):
Viente is offline   Reply With Quote
Old 04-19-2014, 07:06 PM   #4
Viente
Human being with feelings
 
Viente's Avatar
 
Join Date: Feb 2012
Posts: 1,972
Default

Quote:
Originally Posted by gofer View Post
You could probably do something like:
Code:
NewTrackID = RPR_GetSelectedTrack(0, 0) # Get pointer of inserted track

for i in range selCount:
    SNM_AddReceive(pointerList[i], NewTrackID, -1) # the i in square brackets points to the indexes of your pointer list. -1 is default type
Do you know how to convert this part of the code to EEL?

Well, let's image we can use SNM in eel I just want to see it in educational purpose
Viente 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 10:28 AM.


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