Old 08-22-2014, 02:37 PM   #1
Argitoth
Human being with feelings
 
Argitoth's Avatar
 
Join Date: Feb 2008
Location: Mesa, AZ
Posts: 2,057
Default 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.
Argitoth is offline   Reply With Quote
Old 08-22-2014, 06:50 PM   #2
planetnine
Human being with feelings
 
planetnine's Avatar
 
Join Date: Oct 2007
Location: Lincoln, UK
Posts: 7,924
Default

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);
__________________
Nathan, Lincoln, UK. | Item Marker Tool. (happily retired) | Source Time Position Tool. | CD Track Marker Tool. | Timer Recording Tool. | dB marks on MCP faders FR.
planetnine 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 02:30 PM.


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