Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReaScript: CF_EnumMediaSourceCues() - optionally get if a source cue is a chapter marker #1489

Conversation

nofishonfriday
Copy link
Collaborator

@nofishonfriday nofishonfriday commented Dec 24, 2020

v6.19 - December 18 2020

  • API: PCM_SOURCE_EXT_ENUMCUES_EX distinguishes between cues and chapter markers

Lua test code:

reaper.ClearConsole()

function msg(m)
  return reaper.ShowConsoleMsg(tostring(m) .. "\n")
end

item = reaper.GetSelectedMediaItem(0, 0)
take =  reaper.GetActiveTake(item)
src = reaper.GetMediaItemTake_Source(take)

local i = 0
while true do
  -- retval, time, endTime, isRegion, name = reaper.CF_EnumMediaSourceCues( src, i ) -- optional param not provided
  retval, time, endTime, isRegion, name, isChapter = reaper.CF_EnumMediaSourceCues(src, i)
  msg("retval. ".. retval)
  msg("name: " .. name)
  if isChapter ~= nil then 
    msg("isChapter: " .. tostring(isChapter)) 
  end
  msg("\n")
  if retval == 0 then
    break
  end

  i = i + 1
end

Audio files with chapter markers are e.g. here.

edit:
I'm not sure if I get this comment correctly:

&1=DEPRECATED caller must call Extended(PCM_SOURCE_EXT_ENUMCUES, -1, &cue, 0) when finished

edit2:
But I think this is only relevant when setting, so probably no need to call above here?

On a side note:
reaper-sdk (including reaper_plugin.h) moved to GitHub recently, maybe we could add it as a submodule in future?

@nofishonfriday nofishonfriday force-pushed the enummediasourcecues-chapter-optional branch 2 times, most recently from 8027f17 to 88007e2 Compare December 24, 2020 17:46
@AppVeyorBot

This comment has been minimized.

cfillion/cfillion.cpp Outdated Show resolved Hide resolved
@nofishonfriday nofishonfriday force-pushed the enummediasourcecues-chapter-optional branch from 88007e2 to 99a0d45 Compare December 24, 2020 22:45
@AppVeyorBot

This comment has been minimized.

@nofishonfriday nofishonfriday force-pushed the enummediasourcecues-chapter-optional branch from 99a0d45 to c191342 Compare February 9, 2021 12:33
@cfillion cfillion merged commit 6ced592 into reaper-oss:master Dec 20, 2021
@nofishonfriday nofishonfriday deleted the enummediasourcecues-chapter-optional branch December 25, 2021 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants