|
AJA NTV2 SDK
17.0.1.1246
NTV2 SDK 17.0.1.1246
|
Go to the documentation of this file.
24 inline SRTWindow (uint32_t inX1 = 0, uint32_t inY1 = 0,
25 uint32_t inX2 = 0, uint32_t inY2 = 0)
26 {
set(inX1, inY1, inX2, inY2);}
28 inline uint32_t
top (
void)
const {
return mY1;}
29 inline uint32_t
left (
void)
const {
return mX1;}
30 inline uint32_t
bottom (
void)
const {
return mY2;}
31 inline uint32_t
right (
void)
const {
return mX2;}
36 inline bool operator == (
const SRTWindow & inRHS)
const {
return this == &inRHS || (mX1 == inRHS.mX1 && mX2 == inRHS.mX2 && mY1 == inRHS.mY1 && mY2 == inRHS.mY2);}
39 std::ostream &
print (std::ostream & oss)
const;
42 inline void clear (
void) {mX1 = mY1 = mX2 = mY2 = 0;}
49 inline SRTWindow &
set (uint32_t inX1, uint32_t inY1, uint32_t inX2, uint32_t inY2)
52 uint32_t mX1, mX2, mY1, mY2;
64 const SRTDuration inDuration = 0,
const std::string & inRawCaption = std::string(),
65 const size_t inStartLineNum = 0,
const size_t inEndLineNum = 0)
66 {
set(inSeqNum, inStartTime, inDuration, inRawCaption, inStartLineNum, inEndLineNum);}
68 std::string
caption (
void)
const;
69 inline const std::string &
rawCaption (
void)
const {
return mRawCaption;}
76 inline uint16_t
anchor (
void)
const {
return mAnchorPos;}
86 bool getCharWithAttrs (
const size_t inPos, std::string & outChar,
bool & outIsBold,
bool & outIsItalic, std::string & outColor)
const;
91 const SRTDuration inDuration,
const std::string & inRawCaption = std::string(),
92 const size_t inStartLineNum = 0,
const size_t inEndLineNum = 0)
93 { mSequenceNum = inSeqNum; mStartTime = inStartTime;
94 mDuration = inDuration; mRawCaption = inRawCaption;
95 mStartLineNum = inStartLineNum; mEndLineNum = inEndLineNum;
96 mAnchorPos = 0; mWindow.
clear(); mFirstCaption =
false;
103 {mStartLineNum = inStartLineNum; mEndLineNum = inEndLineNum;
return *
this;}
105 std::ostream &
printInfo (std::ostream & oss)
const;
106 std::ostream &
printSRT (std::ostream & oss)
const;
110 std::string mRawCaption;
116 size_t mStartLineNum;
130 static bool getWindow (
const std::string & inStr,
SRTWindow & outWndo, std::ostream & oss);
133 static std::string
anchorStr (
const uint16_t inAnchor,
const bool inIncludeRawValue =
false);
134 static std::string
anchorTag (
const uint16_t inAnchor);
152 bool reloadFrom (
const std::string & inSRTData);
168 inline size_t totalLines (
void)
const {
return mLines.size();}
169 inline std::string
lineAtOffset (
const size_t inOffset)
const {
return inOffset < mLines.size() ? mLines.at(inOffset) :
"";}
180 bool getWarning (
const size_t inIndex0,
size_t & outLineOffset, std::string & outMsg)
const;
181 bool getError (
size_t & outLineOffset, std::string & outMsg)
const;
182 std::ostream &
printErrors (std::ostream & oss,
const bool inIncludeWarnings =
true)
const;
183 std::ostream &
printSRT (std::ostream & oss)
const;
184 std::ostream &
printInfo (std::ostream & oss)
const;
207 #endif // __NTV2_SRT_H_
std::string asString(void) const
uint32_t captionCount(void) const
bool reloadFrom(const StringList &inSRTData)
std::string caption(void) const
SRTWindow & set(uint32_t inX1, uint32_t inY1, uint32_t inX2, uint32_t inY2)
SRTCaptionInfo & setLineNumbers(const size_t inStartLineNum, const size_t inEndLineNum)
std::ostream & printSRT(std::ostream &oss) const
size_t endLineNumber(void) const
SRTWindow & setTop(uint32_t inY1)
size_t linesParsed(void) const
std::map< size_t, std::string > ErrorMap
std::map< SRTTimestamp, SRTWindow > WindowMap
static bool getWindow(const std::string &inStr, SRTWindow &outWndo, std::ostream &oss)
bool durationAtStartTime(const SRTTimestamp inStartTime, SRTDuration &outDuration) const
std::string lineAtOffset(const size_t inOffset) const
SRTTimestamp maxStartTime(void) const
size_t endLineOffset(void) const
bool getWarning(const size_t inIndex0, size_t &outLineOffset, std::string &outMsg) const
size_t startLineOffset(void) const
SRTCaptionInfo & set(const SRTSeqNum inSeqNum, const SRTTimestamp inStartTime, const SRTDuration inDuration, const std::string &inRawCaption=std::string(), const size_t inStartLineNum=0, const size_t inEndLineNum=0)
uint32_t width(void) const
bool hasCaptionAtStartTime(const SRTTimestamp inStartTime) const
bool appendCaption(const SRTCaptionInfo &inCaptionInfo)
size_t totalLines(void) const
SRTWindow(uint32_t inX1=0, uint32_t inY1=0, uint32_t inX2=0, uint32_t inY2=0)
bool hasWindow(void) const
SRTWindow & setBottom(uint32_t inY2)
uint32_t right(void) const
SRTTimestamp startTime(void) const
bool getCharWithAttrs(const size_t inPos, std::string &outChar, bool &outIsBold, bool &outIsItalic, std::string &outColor) const
const ErrorMap & warnings(void) const
std::vector< std::string > StringList
static std::string durationStr(const SRTDuration inDurationMS, const bool inIncludeRawValue=false)
const ErrorMap & errors(void) const
SRTDuration duration(void) const
SRTTimestamp endTime(void) const
static std::string anchorTag(const uint16_t inAnchor)
SRTSeqNum minSeqNum(void) const
SRTWindow & setRight(uint32_t inX2)
bool getError(size_t &outLineOffset, std::string &outMsg) const
static std::string timestampStr(const SRTTimestamp inTS, const bool inIncludeRawValue=false)
std::ostream & print(std::ostream &oss) const
uint16_t anchor(void) const
SRTSeqNum maxSeqNum(void) const
static std::string anchorStr(const uint16_t inAnchor, const bool inIncludeRawValue=false)
uint32_t bottom(void) const
bool operator!=(const SRTWindow &inRHS) const
SRTTimestamp startTimeAtSeqNum(const SRTSeqNum inSeqNum) const
SRTCaptionInfo & reset(void)
SRTWindow & setLeft(uint32_t inX1)
bool hasWarnings(void) const
bool hasAnchor(void) const
std::ostream & printInfo(std::ostream &oss) const
SRTWindow & setTopLeft(uint32_t inX1, uint32_t inY1)
bool hasLineNumbers(void) const
const SRTWindow & window(void) const
std::map< SRTTimestamp, SRTDuration > DurationMap
SRTCaptionInfo & setWindow(const SRTWindow &inWindow)
std::ostream & operator<<(std::ostream &inOutStrm, const SRTWindow &inWindow)
std::ostream & printErrors(std::ostream &oss, const bool inIncludeWarnings=true) const
bool isFirstCaption(void) const
SRTTimestamp minStartTime(void) const
std::map< SRTTimestamp, uint32_t > AnchorMap
bool captionAtStartTime(const SRTTimestamp inStartTime, SRTCaptionInfo &outInfo) const
SRTCaptionInfo(const SRTSeqNum inSeqNum=0, const SRTTimestamp inStartTime=0, const SRTDuration inDuration=0, const std::string &inRawCaption=std::string(), const size_t inStartLineNum=0, const size_t inEndLineNum=0)
uint32_t height(void) const
bool hasErrors(void) const
bool operator==(const SRTWindow &inRHS) const
A collection of timed captions.
uint32_t left(void) const
size_t warningCount(void) const
static SRTDuration defaultMinimumDuration(void)
SRTSeqNum sequenceNum(void) const
std::map< SRTSeqNum, SRTTimestamp > TimestampMap
std::map< SRTTimestamp, SRTSeqNum > SeqNumMap
SRTWindow & setBottomRight(uint32_t inX2, uint32_t inY2)
SRTCaptionInfo & setAnchorPos(const uint16_t inAnchorPos)
std::ostream & printSRT(std::ostream &oss) const
const std::string & rawCaption(void) const
bool nextCaption(SRTTimestamp &inOutStartTime, SRTCaptionInfo &outInfo) const
size_t startLineNumber(void) const
std::map< SRTTimestamp, std::string > CaptionMap
std::ostream & printInfo(std::ostream &oss) const
static bool getTimestamp(const std::string &inStr, SRTTimestamp &outTS, std::ostream &oss=std::cerr)
static void setDefaultMinimumDuration(const SRTDuration inDuration)
bool hasCaptionAtSeqNum(const SRTSeqNum inSeqNum) const
SRTDuration totalDuration(void) const
SRTCaptionInfo & setFirstCaption(const bool inIsFirst=true)
bool hasAnchorTag(void) const
Detailed caption information.
size_t errorCount(void) const
std::map< SRTTimestamp, size_t > SourceMap