AJA NTV2 SDK  17.5.0.1242
NTV2 SDK 17.5.0.1242
SRTCaptions Class Reference

A collection of timed captions. More...

#include <ntv2srt.h>

Public Types

typedef std::vector< std::string > StringList
 
typedef std::map< size_t, std::string > ErrorMap
 
typedef std::map< SRTTimestamp, std::string > CaptionMap
 
typedef std::map< SRTTimestamp, SRTDurationDurationMap
 
typedef std::map< SRTSeqNum, SRTTimestampTimestampMap
 
typedef std::map< SRTTimestamp, SRTSeqNumSeqNumMap
 
typedef std::map< SRTTimestamp, SRTWindowWindowMap
 
typedef std::map< SRTTimestamp, uint32_t > AnchorMap
 
typedef std::map< SRTTimestamp, size_t > SourceMap
 

Public Member Functions

bool reloadFrom (const StringList &inSRTData)
 
bool reloadFrom (const std::string &inSRTData)
 
bool appendCaption (const SRTCaptionInfo &inCaptionInfo)
 
void clear (void)
 
bool hasErrors (void) const
 
const ErrorMaperrors (void) const
 
size_t errorCount (void) const
 
bool hasWarnings (void) const
 
const ErrorMapwarnings (void) const
 
size_t warningCount (void) const
 
bool isEmpty (void) const
 
uint32_t captionCount (void) const
 
SRTSeqNum minSeqNum (void) const
 
SRTSeqNum maxSeqNum (void) const
 
size_t linesParsed (void) const
 
size_t totalLines (void) const
 
std::string lineAtOffset (const size_t inOffset) const
 
SRTTimestamp minStartTime (void) const
 
SRTTimestamp maxStartTime (void) const
 
SRTDuration totalDuration (void) const
 
bool hasCaptionAtSeqNum (const SRTSeqNum inSeqNum) const
 
bool hasCaptionAtStartTime (const SRTTimestamp inStartTime) const
 
SRTTimestamp startTimeAtSeqNum (const SRTSeqNum inSeqNum) const
 
bool captionAtStartTime (const SRTTimestamp inStartTime, SRTCaptionInfo &outInfo) const
 
std::string captionAtStartTime (const SRTTimestamp inStartTime) const
 
bool durationAtStartTime (const SRTTimestamp inStartTime, SRTDuration &outDuration) const
 
bool nextCaption (SRTTimestamp &inOutStartTime, SRTCaptionInfo &outInfo) const
 
bool getWarning (const size_t inIndex0, size_t &outLineOffset, std::string &outMsg) const
 
bool getError (size_t &outLineOffset, std::string &outMsg) const
 
std::ostream & printErrors (std::ostream &oss, const bool inIncludeWarnings=true) const
 
std::ostream & printSRT (std::ostream &oss) const
 
std::ostream & printInfo (std::ostream &oss) const
 

Static Public Member Functions

static bool getTimestamp (const std::string &inStr, SRTTimestamp &outTS, std::ostream &oss=std::cerr)
 
static bool getWindow (const std::string &inStr, SRTWindow &outWndo, std::ostream &oss)
 
static std::string timestampStr (const SRTTimestamp inTS, const bool inIncludeRawValue=false)
 
static std::string durationStr (const SRTDuration inDurationMS, const bool inIncludeRawValue=false)
 
static std::string anchorStr (const uint16_t inAnchor, const bool inIncludeRawValue=false)
 
static std::string anchorTag (const uint16_t inAnchor)
 
static SRTDuration defaultMinimumDuration (void)
 
static void setDefaultMinimumDuration (const SRTDuration inDuration)
 

Detailed Description

A collection of timed captions.

Definition at line 126 of file ntv2srt.h.

Member Typedef Documentation

◆ AnchorMap

typedef std::map<SRTTimestamp, uint32_t> SRTCaptions::AnchorMap

Definition at line 146 of file ntv2srt.h.

◆ CaptionMap

typedef std::map<SRTTimestamp, std::string> SRTCaptions::CaptionMap

Definition at line 141 of file ntv2srt.h.

◆ DurationMap

Definition at line 142 of file ntv2srt.h.

◆ ErrorMap

typedef std::map<size_t, std::string> SRTCaptions::ErrorMap

Definition at line 140 of file ntv2srt.h.

◆ SeqNumMap

Definition at line 144 of file ntv2srt.h.

◆ SourceMap

typedef std::map<SRTTimestamp, size_t> SRTCaptions::SourceMap

Definition at line 147 of file ntv2srt.h.

◆ StringList

typedef std::vector<std::string> SRTCaptions::StringList

Definition at line 139 of file ntv2srt.h.

◆ TimestampMap

Definition at line 143 of file ntv2srt.h.

◆ WindowMap

Definition at line 145 of file ntv2srt.h.

Member Function Documentation

◆ anchorStr()

static std::string SRTCaptions::anchorStr ( const uint16_t  inAnchor,
const bool  inIncludeRawValue = false 
)
static

◆ anchorTag()

static std::string SRTCaptions::anchorTag ( const uint16_t  inAnchor)
static

◆ appendCaption()

bool SRTCaptions::appendCaption ( const SRTCaptionInfo inCaptionInfo)

◆ captionAtStartTime() [1/2]

std::string SRTCaptions::captionAtStartTime ( const SRTTimestamp  inStartTime) const

◆ captionAtStartTime() [2/2]

bool SRTCaptions::captionAtStartTime ( const SRTTimestamp  inStartTime,
SRTCaptionInfo outInfo 
) const

◆ captionCount()

uint32_t SRTCaptions::captionCount ( void  ) const

◆ clear()

void SRTCaptions::clear ( void  )

◆ defaultMinimumDuration()

static SRTDuration SRTCaptions::defaultMinimumDuration ( void  )
inlinestatic

Definition at line 136 of file ntv2srt.h.

◆ durationAtStartTime()

bool SRTCaptions::durationAtStartTime ( const SRTTimestamp  inStartTime,
SRTDuration outDuration 
) const

◆ durationStr()

static std::string SRTCaptions::durationStr ( const SRTDuration  inDurationMS,
const bool  inIncludeRawValue = false 
)
static

◆ errorCount()

size_t SRTCaptions::errorCount ( void  ) const
inline

Definition at line 160 of file ntv2srt.h.

◆ errors()

const ErrorMap& SRTCaptions::errors ( void  ) const
inline

Definition at line 159 of file ntv2srt.h.

◆ getError()

bool SRTCaptions::getError ( size_t &  outLineOffset,
std::string &  outMsg 
) const

◆ getTimestamp()

static bool SRTCaptions::getTimestamp ( const std::string &  inStr,
SRTTimestamp outTS,
std::ostream &  oss = std::cerr 
)
static

◆ getWarning()

bool SRTCaptions::getWarning ( const size_t  inIndex0,
size_t &  outLineOffset,
std::string &  outMsg 
) const

◆ getWindow()

static bool SRTCaptions::getWindow ( const std::string &  inStr,
SRTWindow outWndo,
std::ostream &  oss 
)
static

◆ hasCaptionAtSeqNum()

bool SRTCaptions::hasCaptionAtSeqNum ( const SRTSeqNum  inSeqNum) const

◆ hasCaptionAtStartTime()

bool SRTCaptions::hasCaptionAtStartTime ( const SRTTimestamp  inStartTime) const

◆ hasErrors()

bool SRTCaptions::hasErrors ( void  ) const
inline

Definition at line 158 of file ntv2srt.h.

◆ hasWarnings()

bool SRTCaptions::hasWarnings ( void  ) const
inline

Definition at line 161 of file ntv2srt.h.

◆ isEmpty()

bool SRTCaptions::isEmpty ( void  ) const
inline

Definition at line 164 of file ntv2srt.h.

◆ lineAtOffset()

std::string SRTCaptions::lineAtOffset ( const size_t  inOffset) const
inline

Definition at line 170 of file ntv2srt.h.

◆ linesParsed()

size_t SRTCaptions::linesParsed ( void  ) const
inline

Definition at line 168 of file ntv2srt.h.

◆ maxSeqNum()

SRTSeqNum SRTCaptions::maxSeqNum ( void  ) const

◆ maxStartTime()

SRTTimestamp SRTCaptions::maxStartTime ( void  ) const

◆ minSeqNum()

SRTSeqNum SRTCaptions::minSeqNum ( void  ) const

◆ minStartTime()

SRTTimestamp SRTCaptions::minStartTime ( void  ) const

◆ nextCaption()

bool SRTCaptions::nextCaption ( SRTTimestamp inOutStartTime,
SRTCaptionInfo outInfo 
) const

◆ printErrors()

std::ostream& SRTCaptions::printErrors ( std::ostream &  oss,
const bool  inIncludeWarnings = true 
) const

◆ printInfo()

std::ostream& SRTCaptions::printInfo ( std::ostream &  oss) const

◆ printSRT()

std::ostream& SRTCaptions::printSRT ( std::ostream &  oss) const

◆ reloadFrom() [1/2]

bool SRTCaptions::reloadFrom ( const std::string &  inSRTData)

◆ reloadFrom() [2/2]

bool SRTCaptions::reloadFrom ( const StringList inSRTData)

◆ setDefaultMinimumDuration()

static void SRTCaptions::setDefaultMinimumDuration ( const SRTDuration  inDuration)
inlinestatic

Definition at line 137 of file ntv2srt.h.

◆ startTimeAtSeqNum()

SRTTimestamp SRTCaptions::startTimeAtSeqNum ( const SRTSeqNum  inSeqNum) const

◆ timestampStr()

static std::string SRTCaptions::timestampStr ( const SRTTimestamp  inTS,
const bool  inIncludeRawValue = false 
)
static

◆ totalDuration()

SRTDuration SRTCaptions::totalDuration ( void  ) const
inline

Definition at line 173 of file ntv2srt.h.

◆ totalLines()

size_t SRTCaptions::totalLines ( void  ) const
inline

Definition at line 169 of file ntv2srt.h.

◆ warningCount()

size_t SRTCaptions::warningCount ( void  ) const
inline

Definition at line 163 of file ntv2srt.h.

◆ warnings()

const ErrorMap& SRTCaptions::warnings ( void  ) const
inline

Definition at line 162 of file ntv2srt.h.


The documentation for this class was generated from the following file: