adding a playpause ability in videos
This commit is contained in:
parent
8b7cd23f8b
commit
9a180f7df0
5 changed files with 73 additions and 6 deletions
|
@ -12,10 +12,12 @@ Slide::Slide(QObject *parent)
|
|||
Slide::Slide(const QString &text, const QString &audio, const QString &imageBackground,
|
||||
const QString &videoBackground, const QString &horizontalTextAlignment,
|
||||
const QString &verticalTextAlignment, const QString &font,
|
||||
const int &fontSize, const QString &type, QObject *parent)
|
||||
const int &fontSize, const bool &isPlaying,
|
||||
const QString &type, QObject *parent)
|
||||
: QObject(parent),m_text(text),m_audio(audio),m_imageBackground(imageBackground),
|
||||
m_videoBackground(videoBackground),m_verticalTextAlignment(verticalTextAlignment),
|
||||
m_horizontalTextAlignment(horizontalTextAlignment),m_font(font),m_fontSize(fontSize),m_type(type)
|
||||
m_horizontalTextAlignment(horizontalTextAlignment),m_font(font),
|
||||
m_fontSize(fontSize),m_isPlaying(isPlaying),m_type(type)
|
||||
{
|
||||
qDebug() << "Initializing slide with defaults";
|
||||
}
|
||||
|
@ -66,6 +68,11 @@ int Slide::fontSize() const
|
|||
return m_fontSize;
|
||||
}
|
||||
|
||||
bool Slide::isPlaying() const
|
||||
{
|
||||
return m_isPlaying;
|
||||
}
|
||||
|
||||
void Slide::setText(QString text)
|
||||
{
|
||||
if (m_text == text)
|
||||
|
@ -231,3 +238,21 @@ bool Slide::previous(QVariantMap prevItem)
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
void Slide::play()
|
||||
{
|
||||
m_isPlaying = true;
|
||||
emit isPlayingChanged(m_isPlaying);
|
||||
}
|
||||
|
||||
void Slide::pause()
|
||||
{
|
||||
m_isPlaying = false;
|
||||
emit isPlayingChanged(m_isPlaying);
|
||||
}
|
||||
|
||||
void Slide::playPause()
|
||||
{
|
||||
m_isPlaying = !m_isPlaying;
|
||||
emit isPlayingChanged(m_isPlaying);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue