问题详情
我希望编辑光标只会在没有对象的标记点上移动,写了一天也不行,求教
做过的尝试
local cursorPos = reaper.GetCursorPosition()
local rightMarkerPos = math.huge
for i = 0, reaper.CountProjectMarkers(0) - 1 do
local marker, isrgn, pos = reaper.EnumProjectMarkers3(0, i)
if not isrgn and pos > cursorPos and pos < rightMarkerPos then
rightMarkerPos = pos
end
end
if rightMarkerPos ~= math.huge then
reaper.Main_OnCommand(40296, 0) -- 对象: 全选轨道
reaper.Main_OnCommand(reaper.NamedCommandLookup('_XENAKIOS_SELITEMSUNDEDCURSELTX'), 0)-- 在选定轨上选择编辑光标下的对象
reaper.Main_OnCommand(40297, 0) -- 取消选择全部轨道
coritem = reaper.CountSelectedMediaItems(0)-- 获取当前选中的媒体项数目
if coritem > 0 then
local marker_need = false
else
local marker_need = ture
end
while marker_need do
reaper.SetEditCurPos(rightMarkerPos, true, true)
end
end