Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
CSubtitlesAdapter Class Reference

#include <SubtitlesAdapter.h>

Inheritance diagram for CSubtitlesAdapter:
CDVDOverlayCodecCCText CDVDOverlayCodecTX3G CDVDOverlayCodecText CDVDSubtitleParserMPL2 CDVDSubtitleParserMicroDVD CDVDSubtitleParserSami CDVDSubtitleParserSubrip CDVDSubtitleParserVplayer COverlayCodecWebVTT CSubtitleParserWebVTT

Public Member Functions

 CSubtitlesAdapter ()
 
virtual ~CSubtitlesAdapter ()
 
bool Initialize ()
 Initialize the subtitles adapter.
 
int AddSubtitle (std::string &text, double startTime, double stopTime)
 Add a subtitle.
 
int AddSubtitle (std::string &text, double startTime, double stopTime, KODI::SUBTITLES::STYLE::subtitleOpts *opts)
 Add a subtitle with supplementary options.
 
void AppendToSubtitle (int subtitleId, const char *text)
 Append text to the specified subtitle ID.
 
int DeleteSubtitles (int nSubtitles, int threshold)
 Delete old subtitles only if the total number of subtitles added reaches the threshold.
 
void ChangeSubtitleStopTime (int subtitleId, double stopTime)
 Change the stop time of a subtitle ID with the specified time.
 
void FlushSubtitles ()
 
std::shared_ptr< CDVDOverlayCreateOverlay ()
 

Protected Member Functions

virtual void PostProcess (std::string &text)
 Post processing of subtitle, will be called before processing AddSubtitle method.
 

Constructor & Destructor Documentation

◆ CSubtitlesAdapter()

CSubtitlesAdapter::CSubtitlesAdapter ( )

◆ ~CSubtitlesAdapter()

CSubtitlesAdapter::~CSubtitlesAdapter ( )
virtual

Member Function Documentation

◆ AddSubtitle() [1/2]

int CSubtitlesAdapter::AddSubtitle ( std::string & text,
double startTime,
double stopTime )

Add a subtitle.

Parameters
textThe subtitle text
startTimeThe PTS start time of the subtitle
stopTimeThe PTS stop time of the subtitle
Returns
Return the subtitle ID, otherwise NO_SUBTITLE_ID if fails

◆ AddSubtitle() [2/2]

int CSubtitlesAdapter::AddSubtitle ( std::string & text,
double startTime,
double stopTime,
KODI::SUBTITLES::STYLE::subtitleOpts * opts )

Add a subtitle with supplementary options.

Parameters
textThe subtitle text
startTimeThe PTS start time of the subtitle
stopTimeThe PTS stop time of the subtitle
optsSubtitle options
Returns
Return the subtitle ID, otherwise NO_SUBTITLE_ID if fails

◆ AppendToSubtitle()

void CSubtitlesAdapter::AppendToSubtitle ( int subtitleId,
const char * text )

Append text to the specified subtitle ID.

Parameters
subtitleIdThe subtitle ID
textThe text to append

◆ ChangeSubtitleStopTime()

void CSubtitlesAdapter::ChangeSubtitleStopTime ( int subtitleId,
double stopTime )

Change the stop time of a subtitle ID with the specified time.

Parameters
subtitleIdThe subtitle ID
stopTimeThe PTS stop time

◆ CreateOverlay()

std::shared_ptr< CDVDOverlay > CSubtitlesAdapter::CreateOverlay ( )

◆ DeleteSubtitles()

int CSubtitlesAdapter::DeleteSubtitles ( int nSubtitles,
int threshold )

Delete old subtitles only if the total number of subtitles added reaches the threshold.

Parameters
nSubtitlesThe number of subtitles to delete
thresholdStart deleting only when the number of subtitles is reached
Returns
The updated ID of the last subtitle, otherwise NO_SUBTITLE_ID if error or no subtitles

◆ FlushSubtitles()

void CSubtitlesAdapter::FlushSubtitles ( )

◆ Initialize()

bool CSubtitlesAdapter::Initialize ( )

Initialize the subtitles adapter.

Returns
True if success, false if error

◆ PostProcess()

virtual void CSubtitlesAdapter::PostProcess ( std::string & text)
inlineprotectedvirtual

Post processing of subtitle, will be called before processing AddSubtitle method.

Parameters
textThe subtitle text

Reimplemented in CDVDOverlayCodecCCText, CDVDOverlayCodecText, and CDVDOverlayCodecTX3G.


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