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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion ReaScript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ APIdef g_apidefs[] =
{ APIFUNC(CF_SetMediaSourceOnline), "void", "PCM_source*,bool", "src,set", "Set the online/offline status of the given source (closes files when set=false).", },
{ APIFUNC(CF_GetMediaSourceMetadata), "bool", "PCM_source*,const char*,char*,int", "src,name,out,out_sz", "Get the value of the given metadata field (eg. DESC, ORIG, ORIGREF, DATE, TIME, UMI, CODINGHISTORY for BWF).", },
{ APIFUNC(CF_GetMediaSourceRPP), "bool", "PCM_source*,char*,int", "src,fnOut,fnOut_sz", "Get the project associated with this source (BWF, subproject...).", },
{ APIFUNC(CF_EnumMediaSourceCues), "int", "PCM_source*,int,double*,double*,bool*,char*,int", "src,index,timeOut,endTimeOut,isRegionOut,nameOut,nameOut_sz", "Enumerate the source's media cues. Returns the next index or 0 when finished.", },
{ APIFUNC(CF_EnumMediaSourceCues), "int", "PCM_source*,int,double*,double*,bool*,char*,int,bool*", "src,index,timeOut,endTimeOut,isRegionOut,nameOut,nameOut_sz,isChapterOutOptional", "Enumerate the source's media cues. Returns the next index or 0 when finished.", },
{ APIFUNC(CF_ExportMediaSource), "bool", "PCM_source*,const char*", "src,fn", "Export the source to the given file (MIDI only).", },

{ NULL, } // denote end of table
Expand Down
5 changes: 4 additions & 1 deletion cfillion/cfillion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ bool CF_GetMediaSourceRPP(PCM_source *source, char *buf, const int bufSize)
}

int CF_EnumMediaSourceCues(PCM_source *source, const int index, double *time,
double *endTime, bool *isRegion, char *name, const int nameSize)
double *endTime, bool *isRegion, char *name, const int nameSize, bool *isChapter)
{
if(!source)
return 0;
Expand All @@ -368,6 +368,9 @@ int CF_EnumMediaSourceCues(PCM_source *source, const int index, double *time,
if(name && cue.m_name)
snprintf(name, nameSize, "%s", cue.m_name);

if (isChapter)
*isChapter = cue.m_flags & 4;

return add ? index + add : 0;
}

Expand Down
2 changes: 1 addition & 1 deletion cfillion/cfillion.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@ bool CF_GetMediaSourceOnline(PCM_source *);
void CF_SetMediaSourceOnline(PCM_source *, bool set);
bool CF_GetMediaSourceMetadata(PCM_source *, const char *name, char *buf, int bufSize);
bool CF_GetMediaSourceRPP(PCM_source *source, char *buf, const int bufSize);
int CF_EnumMediaSourceCues(PCM_source *source, const int index, double *time, double *endTime, bool *isRegion, char *name, const int nameSize);
int CF_EnumMediaSourceCues(PCM_source *source, const int index, double *time, double *endTime, bool *isRegion, char *name, const int nameSize, bool *isChapter);
bool CF_ExportMediaSource(PCM_source *source, const char *file);