![]() |
Miam-Player
0.8.0
A nice music player
|
#include <Subtitle.h>
Public Slots | |
void | load () |
start start to process the whole subtitle content in a thread More... | |
void | loadAsync () |
void | setTimestamp (qreal t) |
Signals | |
void | loaded (const QString &path=QString()) |
empty path if load from raw data More... | |
void | canRenderChanged () |
void | codecChanged () |
void | enginesChanged () |
void | fuzzyMatchChanged () |
void | contentChanged () |
contentChanged emitted when text content changed. More... | |
void | rawDataChanged () |
void | fileNameChanged () |
void | dirsChanged () |
void | suffixesChanged () |
void | supportedSuffixesChanged () |
void | engineChanged () |
void | delayChanged () |
void | fontFileChanged () |
void | fontsDirChanged () |
void | fontFileForcedChanged () |
Public Member Functions | |
Subtitle (QObject *parent=0) | |
virtual | ~Subtitle () |
void | setCodec (const QByteArray &value) |
setCodec set subtitle encoding that supported by QTextCodec. More... | |
QByteArray | codec () const |
bool | isLoaded () const |
isValid indicate whether the subtitle can be found and processed More... | |
void | setEngines (const QStringList &value) |
setEngines Set subtitle processor engine names, in priority order. More... | |
QStringList | engines () const |
QString | engine () const |
engine More... | |
void | setFuzzyMatch (bool value) |
bool | fuzzyMatch () const |
void | setRawData (const QByteArray &data) |
QByteArray | rawData () const |
void | setFileName (const QString &name) |
setFileName the given name will be in the 1st place to try to open(if using fuzzy match). More... | |
QString | fileName () const |
void | setDirs (const QStringList &value) |
setDirs Set subtitle search directories. More... | |
QStringList | dirs () const |
QStringList | supportedSuffixes () const |
supportedFormats the suffix names supported by all engines. More... | |
void | setSuffixes (const QStringList &value) |
setSuffixes default is using SubtitleProcessor. More... | |
QStringList | suffixes () const |
qreal | timestamp () const |
qreal | delay () const |
delay unit: second The subtitle from getText() and getImage() is at the time: timestamp() + delay() More... | |
void | setDelay (qreal value) |
bool | canRender () const |
canRender wether current processor supports rendering. More... | |
QString | getText () const |
QImage | getImage (int width, int height, QRect *boundingRect=0) |
getImage Get a subtitle image with given (video) frame size. More... | |
SubImageSet | getSubImages (int width, int height, QRect *boundingRect=0) |
bool | processHeader (const QByteArray &codec, const QByteArray &data) |
processHeader Always called if switch to a new internal subtitle stream. More... | |
bool | processLine (const QByteArray &data, qreal pts=-1, qreal duration=0) |
QString | fontFile () const |
void | setFontFile (const QString &value) |
QString | fontsDir () const |
fontsDir Not tested for dwrite provider. More... | |
void | setFontsDir (const QString &value) |
bool | isFontFileForced () const |
void | setFontFileForced (bool value) |
Properties | |
QByteArray | codec |
QStringList | engines |
QString | engine |
bool | fuzzyMatch |
QByteArray | rawData |
QString | fileName |
QStringList | dirs |
QStringList | suffixes |
QStringList | supportedSuffixes |
qreal | timestamp |
qreal | delay |
QString | text |
bool | loaded |
bool | canRender |
QString | fontFile |
QString | fontsDir |
bool | fontFileForced |
|
explicit |
|
virtual |
bool QtAV::Subtitle::canRender | ( | ) | const |
|
signal |
QByteArray QtAV::Subtitle::codec | ( | ) | const |
|
signal |
|
signal |
contentChanged emitted when text content changed.
qreal QtAV::Subtitle::delay | ( | ) | const |
delay unit: second The subtitle from getText() and getImage() is at the time: timestamp() + delay()
|
signal |
QStringList QtAV::Subtitle::dirs | ( | ) | const |
|
signal |
QString QtAV::Subtitle::engine | ( | ) | const |
engine
|
signal |
QStringList QtAV::Subtitle::engines | ( | ) | const |
|
signal |
QString QtAV::Subtitle::fileName | ( | ) | const |
|
signal |
QString QtAV::Subtitle::fontFile | ( | ) | const |
|
signal |
|
signal |
QString QtAV::Subtitle::fontsDir | ( | ) | const |
fontsDir Not tested for dwrite provider.
FontConfig can work.
|
signal |
bool QtAV::Subtitle::fuzzyMatch | ( | ) | const |
|
signal |
QImage QtAV::Subtitle::getImage | ( | int | width, |
int | height, | ||
QRect * | boundingRect = 0 |
||
) |
getImage Get a subtitle image with given (video) frame size.
The result image size usually smaller than given frame size because subtitle are lines of text. The boundingRect indicates the actual image position and size relative to given size. The result image format is QImage::Format_ARGB32
SubImageSet QtAV::Subtitle::getSubImages | ( | int | width, |
int | height, | ||
QRect * | boundingRect = 0 |
||
) |
QString QtAV::Subtitle::getText | ( | ) | const |
bool QtAV::Subtitle::isFontFileForced | ( | ) | const |
bool QtAV::Subtitle::isLoaded | ( | ) | const |
isValid indicate whether the subtitle can be found and processed
|
slot |
start start to process the whole subtitle content in a thread
|
slot |
|
signal |
empty path if load from raw data
bool QtAV::Subtitle::processHeader | ( | const QByteArray & | codec, |
const QByteArray & | data | ||
) |
processHeader Always called if switch to a new internal subtitle stream.
But header data can be empty Used by libass to set style etc.
bool QtAV::Subtitle::processLine | ( | const QByteArray & | data, |
qreal | pts = -1 , |
||
qreal | duration = 0 |
||
) |
QByteArray QtAV::Subtitle::rawData | ( | ) | const |
|
signal |
void QtAV::Subtitle::setCodec | ( | const QByteArray & | value | ) |
setCodec set subtitle encoding that supported by QTextCodec.
You have to call load() to manually reload the subtitle with given codec
value | codec name. see QTextCodec.availableCodecs(). Empty value means using the default codec in QTextCodec If linked with libchardet(https://github.com/cnangel/libchardet) or can dynamically load it, set value of "AutoDetect" to detect the charset of subtitle |
void QtAV::Subtitle::setDelay | ( | qreal | value | ) |
void QtAV::Subtitle::setDirs | ( | const QStringList & | value | ) |
setDirs Set subtitle search directories.
Video's dir will always be added.
void QtAV::Subtitle::setEngines | ( | const QStringList & | value | ) |
setEngines Set subtitle processor engine names, in priority order.
When loading a subtitle, use the engines one by one until a usable engine is found.
value |
void QtAV::Subtitle::setFileName | ( | const QString & | name | ) |
setFileName the given name will be in the 1st place to try to open(if using fuzzy match).
then files in suffixes() order or in processor's supported suffixes order
name |
void QtAV::Subtitle::setFontFile | ( | const QString & | value | ) |
void QtAV::Subtitle::setFontFileForced | ( | bool | value | ) |
void QtAV::Subtitle::setFontsDir | ( | const QString & | value | ) |
void QtAV::Subtitle::setFuzzyMatch | ( | bool | value | ) |
void QtAV::Subtitle::setRawData | ( | const QByteArray & | data | ) |
void QtAV::Subtitle::setSuffixes | ( | const QStringList & | value | ) |
setSuffixes default is using SubtitleProcessor.
Empty equals default value. But suffixes() will return empty.
|
slot |
QStringList QtAV::Subtitle::suffixes | ( | ) | const |
|
signal |
QStringList QtAV::Subtitle::supportedSuffixes | ( | ) | const |
supportedFormats the suffix names supported by all engines.
for example ["ass", "ssa"]
|
signal |
qreal QtAV::Subtitle::timestamp | ( | ) | const |
|
read |
|
readwrite |
|
readwrite |
|
readwrite |
|
read |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
|
read |
|
readwrite |
|
readwrite |
|
read |
|
read |
|
readwrite |