|
|
|
08-22-2014, 02:37 PM
|
#1
|
Human being with feelings
Join Date: Feb 2008
Location: Mesa, AZ
Posts: 2,057
|
How do you get name of project marker?
How do you get name of a project marker? This code works except that name remains null.
Code:
from reaper_python import *
boolean = isrgnOut = posOut = rgnendOut = markrgnindexnumberOut = idx = 0
nameOut = ""
markerInfo = RPR_EnumProjectMarkers(idx, isrgnOut, posOut, rgnendOut, nameOut, markrgnindexnumberOut)
RPR_ShowConsoleMsg("boolean = " + str(markerInfo[0]) + "\n")
RPR_ShowConsoleMsg("idx = " + str(markerInfo[1]) + "\n")
RPR_ShowConsoleMsg("isrgnOut = " + str(markerInfo[2]) + "\n")
RPR_ShowConsoleMsg("posOut = " + str(markerInfo[3]) + "\n")
RPR_ShowConsoleMsg("rgnendOut = " + str(markerInfo[4]) + "\n")
RPR_ShowConsoleMsg("nameOut = " + str(markerInfo[5]) + "\n")
Edit: made this function with sws api... I'd rather use built-in API...
Code:
def GetMarkerName(idx):
isrgnOut = markrgnindexnumberOut = 0
fast_str = SNM_CreateFastString("")
markerInfo = RPR_EnumProjectMarkers(idx, isrgnOut, 0, 0, 0, markrgnindexnumberOut)
SNM_GetProjectMarkerName(0, markerInfo[6], markerInfo[2], fast_str)
return SNM_GetFastString(fast_str)
SNM_DeleteFastString(fast_str)
__________________
Soundemote - Home of the chaosfly and pretty oscilloscope.
MyReaperPlugin - Easy-to-use cross-platform C++ REAPER extension template
Last edited by Argitoth; 08-22-2014 at 03:45 PM.
|
|
|
08-22-2014, 06:50 PM
|
#2
|
Human being with feelings
Join Date: Oct 2007
Location: Lincoln, UK
Posts: 7,924
|
I seem to remember having some problem with this in Python some time ago, it was brought up on the board here.
No problems using EEL with EnumProjectMarkers3 though...
Code:
EnumProjectMarkers3(0, msov_i, is_region, mkr_pos, rgn_end, #name, markrgn_num,0);
SetProjectMarkerByIndex2(0, msov_i, is_region, nfd(mkr_pos), nfd2(rgn_end), markrgn_num, #name, 0, 0);
|
|
|
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 02:30 PM.
|