Commit 974cabed authored by Laurent Montel's avatar Laurent Montel 😁 Committed by Matthieu Gallien
Browse files

Fix compile with QT_NO_NARROWING_CONVERSIONS_IN_CONNECT flags

Summary: Fix compile with QT_NO_NARROWING_CONVERSIONS_IN_CONNECT flags

Reviewers: mgallien

Reviewed By: mgallien

Differential Revision: https://phabricator.kde.org/D15588
parent 3f15d516
......@@ -142,7 +142,7 @@ void AudioWrapper::stop()
d->mPlayer.stop();
}
void AudioWrapper::seek(int position)
void AudioWrapper::seek(qint64 position)
{
d->mPlayer.setPosition(position);
}
......
......@@ -148,7 +148,7 @@ public Q_SLOTS:
void stop();
void seek(int position);
void seek(qint64 position);
void setAudioRole(QAudio::Role audioRole);
......
......@@ -409,7 +409,10 @@ void ElisaApplication::initializePlayer()
QObject::connect(d->mMediaPlayList.get(), &MediaPlayList::playListFinished, d->mAudioControl.get(), &ManageAudioPlayer::playListFinished);
QObject::connect(d->mMediaPlayList.get(), &MediaPlayList::currentTrackChanged, d->mAudioControl.get(), &ManageAudioPlayer::setCurrentTrack);
QObject::connect(d->mAudioWrapper.get(), &AudioWrapper::playbackStateChanged, d->mAudioControl.get(), &ManageAudioPlayer::setPlayerPlaybackState);
QObject::connect(d->mAudioWrapper.get(), &AudioWrapper::playbackStateChanged, d->mAudioControl.get(),
[this](QMediaPlayer::State state) {
d->mAudioControl->setPlayerPlaybackState(static_cast<int>(state));
});
QObject::connect(d->mAudioWrapper.get(), &AudioWrapper::statusChanged, d->mAudioControl.get(), &ManageAudioPlayer::setPlayerStatus);
QObject::connect(d->mAudioWrapper.get(), &AudioWrapper::errorChanged, d->mAudioControl.get(), &ManageAudioPlayer::setPlayerError);
QObject::connect(d->mAudioWrapper.get(), &AudioWrapper::durationChanged, d->mAudioControl.get(), &ManageAudioPlayer::setAudioDuration);
......
......@@ -70,7 +70,7 @@ QMediaPlayer::Error ManageAudioPlayer::playerError() const
return mPlayerError;
}
int ManageAudioPlayer::audioDuration() const
qint64 ManageAudioPlayer::audioDuration() const
{
return mAudioDuration;
}
......@@ -80,12 +80,12 @@ bool ManageAudioPlayer::playerIsSeekable() const
return mPlayerIsSeekable;
}
int ManageAudioPlayer::playerPosition() const
qint64 ManageAudioPlayer::playerPosition() const
{
return mPlayerPosition;
}
int ManageAudioPlayer::playControlPosition() const
qint64 ManageAudioPlayer::playControlPosition() const
{
return mPlayerPosition;
}
......@@ -372,7 +372,7 @@ void ManageAudioPlayer::playPause()
}
}
void ManageAudioPlayer::setAudioDuration(int audioDuration)
void ManageAudioPlayer::setAudioDuration(qint64 audioDuration)
{
if (mAudioDuration == audioDuration) {
return;
......@@ -392,7 +392,7 @@ void ManageAudioPlayer::setPlayerIsSeekable(bool playerIsSeekable)
Q_EMIT playerIsSeekableChanged();
}
void ManageAudioPlayer::setPlayerPosition(int playerPosition)
void ManageAudioPlayer::setPlayerPosition(qint64 playerPosition)
{
if (mPlayerPosition == playerPosition) {
return;
......@@ -568,7 +568,7 @@ void ManageAudioPlayer::restorePreviousState()
auto playerPosition = mPersistentState.find(QStringLiteral("playerPosition"));
if (playerPosition != mPersistentState.end()) {
mPlayerPosition = playerPosition->toInt();
mPlayerPosition = playerPosition->toLongLong();
Q_EMIT seek(mPlayerPosition);
}
......
......@@ -84,7 +84,7 @@ class ELISALIB_EXPORT ManageAudioPlayer : public QObject
WRITE setPlayerError
NOTIFY playerErrorChanged)
Q_PROPERTY(int audioDuration
Q_PROPERTY(qint64 audioDuration
READ audioDuration
WRITE setAudioDuration
NOTIFY audioDurationChanged)
......@@ -94,12 +94,12 @@ class ELISALIB_EXPORT ManageAudioPlayer : public QObject
WRITE setPlayerIsSeekable
NOTIFY playerIsSeekableChanged)
Q_PROPERTY(int playerPosition
Q_PROPERTY(qint64 playerPosition
READ playerPosition
WRITE setPlayerPosition
NOTIFY playerPositionChanged)
Q_PROPERTY(int playControlPosition
Q_PROPERTY(qint64 playControlPosition
READ playControlPosition
WRITE setPlayControlPosition
NOTIFY playControlPositionChanged)
......@@ -137,13 +137,13 @@ public:
QMediaPlayer::Error playerError() const;
int audioDuration() const;
qint64 audioDuration() const;
bool playerIsSeekable() const;
int playerPosition() const;
qint64 playerPosition() const;
int playControlPosition() const;
qint64 playControlPosition() const;
QVariantMap persistentState() const;
......@@ -191,7 +191,7 @@ Q_SIGNALS:
void persistentStateChanged();
void seek(int position);
void seek(qint64 position);
void titleRoleChanged();
......@@ -227,11 +227,11 @@ public Q_SLOTS:
void stop();
void setAudioDuration(int audioDuration);
void setAudioDuration(qint64 audioDuration);
void setPlayerIsSeekable(bool playerIsSeekable);
void setPlayerPosition(int playerPosition);
void setPlayerPosition(qint64 playerPosition);
void setPlayControlPosition(int playerPosition);
......@@ -295,7 +295,7 @@ private:
bool mPlayerIsSeekable = false;
int mPlayerPosition = 0;
qint64 mPlayerPosition = 0;
QVariantMap mPersistentState;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment