MythTV  master
Public Member Functions | Private Attributes | List of all members
TextSubtitles Class Reference

#include <textsubtitleparser.h>

Collaboration diagram for TextSubtitles:
Collaboration graph
[legend]

Public Member Functions

 TextSubtitles ()
 
virtual ~TextSubtitles ()
 
bool HasSubtitleChanged (uint64_t timecode) const
 Returns true in case the subtitle to display has changed since the last GetSubtitles() call. More...
 
QStringList GetSubtitles (uint64_t timecode)
 Returns the subtitles to display at the given timecode. More...
 
bool IsFrameBasedTiming (void) const
 Returns true in case the subtitle timing data is frame-based. More...
 
void SetFrameBasedTiming (bool frameBasedTiming)
 
void SetFilename (const QString &fileName)
 
void AddSubtitle (const text_subtitle_t &newSub)
 
void Clear (void)
 
void SetLastLoaded (void)
 
void SetByteCount (off_t count)
 
off_t GetByteCount (void) const
 
void SetInProgress (bool isInProgress)
 
void SetHasSubtitles (bool hasSubs)
 
int GetSubtitleCount (void) const
 
void Lock (void)
 
void Unlock (void)
 

Private Attributes

TextSubtitleList m_subtitles
 
text_subtitle_t m_lastReturnedSubtitle
 
bool m_frameBasedTiming {false}
 
QString m_fileName
 
QDateTime m_lastLoaded
 
off_t m_byteCount {0}
 
bool m_isInProgress {false}
 
bool m_hasSubtitles {false}
 
QMutex m_lock {QMutex::Recursive}
 

Detailed Description

Definition at line 43 of file textsubtitleparser.h.

Constructor & Destructor Documentation

◆ TextSubtitles()

TextSubtitles::TextSubtitles ( )
inline

Definition at line 46 of file textsubtitleparser.h.

◆ ~TextSubtitles()

TextSubtitles::~TextSubtitles ( )
virtual

Definition at line 151 of file textsubtitleparser.cpp.

Member Function Documentation

◆ HasSubtitleChanged()

bool TextSubtitles::HasSubtitleChanged ( uint64_t  timecode) const

Returns true in case the subtitle to display has changed since the last GetSubtitles() call.

This is used to avoid redisplaying subtitles that are already displaying.

Parameters
timecodeThe timecode (frame number or time stamp) of the current video position.
Returns
True in case new subtitles should be displayed.

Definition at line 166 of file textsubtitleparser.cpp.

Referenced by SubtitleScreen::DisplayTextSubtitles().

◆ GetSubtitles()

QStringList TextSubtitles::GetSubtitles ( uint64_t  timecode)

Returns the subtitles to display at the given timecode.

Parameters
timecodeThe timecode (frame number or time stamp) of the current video position.
Returns
The subtitles as a list of strings.

Definition at line 179 of file textsubtitleparser.cpp.

Referenced by SubtitleScreen::DisplayTextSubtitles().

◆ IsFrameBasedTiming()

TextSubtitles::IsFrameBasedTiming ( void  ) const
inline

Returns true in case the subtitle timing data is frame-based.

If the timing is frame-based, the client should use frame counts as timecodes for the HasSubtitleChanged() and GetSubtitles() methods, otherwise the timecode is milliseconds from the video start.

Definition at line 64 of file textsubtitleparser.h.

Referenced by SubtitleScreen::DisplayTextSubtitles(), GetSubtitles(), and TextSubtitleParser::LoadSubtitles().

◆ SetFrameBasedTiming()

void TextSubtitles::SetFrameBasedTiming ( bool  frameBasedTiming)
inline

Definition at line 67 of file textsubtitleparser.h.

Referenced by TextSubtitleParser::LoadSubtitles().

◆ SetFilename()

void TextSubtitles::SetFilename ( const QString &  fileName)
inline

Definition at line 72 of file textsubtitleparser.h.

Referenced by TextSubtitleParser::LoadSubtitles().

◆ AddSubtitle()

void TextSubtitles::AddSubtitle ( const text_subtitle_t newSub)

Definition at line 246 of file textsubtitleparser.cpp.

Referenced by TextSubtitleParser::LoadSubtitles().

◆ Clear()

void TextSubtitles::Clear ( void  )

◆ SetLastLoaded()

void TextSubtitles::SetLastLoaded ( void  )

Definition at line 258 of file textsubtitleparser.cpp.

Referenced by TextSubtitleParser::LoadSubtitles().

◆ SetByteCount()

void TextSubtitles::SetByteCount ( off_t  count)
inline

Definition at line 80 of file textsubtitleparser.h.

Referenced by TextSubtitleParser::LoadSubtitles().

◆ GetByteCount()

off_t TextSubtitles::GetByteCount ( void  ) const
inline

Definition at line 84 of file textsubtitleparser.h.

Referenced by TextSubtitleParser::LoadSubtitles().

◆ SetInProgress()

void TextSubtitles::SetInProgress ( bool  isInProgress)
inline

Definition at line 85 of file textsubtitleparser.h.

Referenced by SubtitleReader::LoadExternalSubtitles().

◆ SetHasSubtitles()

void TextSubtitles::SetHasSubtitles ( bool  hasSubs)
inline

Definition at line 89 of file textsubtitleparser.h.

Referenced by TextSubtitleParser::LoadSubtitles().

◆ GetSubtitleCount()

int TextSubtitles::GetSubtitleCount ( void  ) const
inline

Definition at line 92 of file textsubtitleparser.h.

Referenced by SubtitleReader::HasTextSubtitles().

◆ Lock()

void TextSubtitles::Lock ( void  )
inline

Definition at line 95 of file textsubtitleparser.h.

Referenced by SubtitleScreen::DisplayTextSubtitles().

◆ Unlock()

void TextSubtitles::Unlock ( void  )
inline

Definition at line 96 of file textsubtitleparser.h.

Referenced by SubtitleScreen::DisplayTextSubtitles().

Member Data Documentation

◆ m_subtitles

TextSubtitleList TextSubtitles::m_subtitles
private

Definition at line 99 of file textsubtitleparser.h.

Referenced by AddSubtitle(), Clear(), and GetSubtitles().

◆ m_lastReturnedSubtitle

text_subtitle_t TextSubtitles::m_lastReturnedSubtitle
mutableprivate

Definition at line 100 of file textsubtitleparser.h.

Referenced by GetSubtitles(), and HasSubtitleChanged().

◆ m_frameBasedTiming

bool TextSubtitles::m_frameBasedTiming {false}
private

Definition at line 101 of file textsubtitleparser.h.

◆ m_fileName

QString TextSubtitles::m_fileName
private

Definition at line 102 of file textsubtitleparser.h.

Referenced by GetSubtitles().

◆ m_lastLoaded

QDateTime TextSubtitles::m_lastLoaded
private

Definition at line 103 of file textsubtitleparser.h.

Referenced by GetSubtitles(), and SetLastLoaded().

◆ m_byteCount

off_t TextSubtitles::m_byteCount {0}
private

Definition at line 104 of file textsubtitleparser.h.

◆ m_isInProgress

bool TextSubtitles::m_isInProgress {false}
private

Definition at line 107 of file textsubtitleparser.h.

Referenced by GetSubtitles().

◆ m_hasSubtitles

bool TextSubtitles::m_hasSubtitles {false}
private

Definition at line 111 of file textsubtitleparser.h.

◆ m_lock

QMutex TextSubtitles::m_lock {QMutex::Recursive}
private

Definition at line 112 of file textsubtitleparser.h.

Referenced by AddSubtitle(), Clear(), and SetLastLoaded().


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