Skip to content

Commit

Permalink
QmlPlayerProxy: Add additional player state signals
Browse files Browse the repository at this point in the history
  • Loading branch information
Holzhaus committed May 27, 2021
1 parent 5453a02 commit c4b33fa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/skin/qml/qmlplayerproxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ QmlPlayerProxy::QmlPlayerProxy(BaseTrackPlayer* pTrackPlayer, QObject* parent =
&BaseTrackPlayer::newTrackLoaded,
this,
&QmlPlayerProxy::slotTrackLoaded);
connect(m_pTrackPlayer,
&BaseTrackPlayer::playerEmpty,
this,
&QmlPlayerProxy::trackUnloaded);
connect(this, &QmlPlayerProxy::trackChanged, this, &QmlPlayerProxy::slotTrackChanged);
}

Expand All @@ -53,6 +57,7 @@ void QmlPlayerProxy::slotTrackLoaded(TrackPointer pTrack) {
&QmlPlayerProxy::colorChanged);
}
emit trackChanged();
emit trackLoaded();
}

void QmlPlayerProxy::slotLoadingTrack(TrackPointer pNewTrack, TrackPointer pOldTrack) {
Expand All @@ -64,6 +69,7 @@ void QmlPlayerProxy::slotLoadingTrack(TrackPointer pNewTrack, TrackPointer pOldT
}
m_pCurrentTrack.reset();
emit trackChanged();
emit trackLoading();
}

void QmlPlayerProxy::slotTrackChanged() {
Expand Down
3 changes: 3 additions & 0 deletions src/skin/qml/qmlplayerproxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ class QmlPlayerProxy : public QObject {
void setColor(const QColor& color);

signals:
void trackLoading();
void trackLoaded();
void trackUnloaded();
void trackChanged();

void albumChanged();
Expand Down

0 comments on commit c4b33fa

Please sign in to comment.