Indicate the playing track while in release view
This commit is contained in:
@@ -146,6 +146,7 @@ a:hover {
|
|||||||
.Lms-explore-release-entry-name {
|
.Lms-explore-release-entry-name {
|
||||||
margin-top: 4px;
|
margin-top: 4px;
|
||||||
margin-bottom: 4px;
|
margin-bottom: 4px;
|
||||||
|
font-weight: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
.Lms-explore-release-entry:hover {
|
.Lms-explore-release-entry:hover {
|
||||||
@@ -156,6 +157,10 @@ a:hover {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.Lms-explore-release-entry-playing {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
.Lms-explore-artists-entry {
|
.Lms-explore-artists-entry {
|
||||||
min-height: 48px;
|
min-height: 48px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2013 Emeric Poupon
|
* Copyright (C) 2018 Emeric Poupon
|
||||||
*
|
*
|
||||||
* This file is part of LMS.
|
* This file is part of LMS.
|
||||||
*
|
*
|
||||||
@@ -448,11 +448,13 @@ LmsApplication::createHome()
|
|||||||
|
|
||||||
playqueue->loadTrack.connect([=] (Database::IdType trackId, bool play)
|
playqueue->loadTrack.connect([=] (Database::IdType trackId, bool play)
|
||||||
{
|
{
|
||||||
|
_events.lastLoadedTrackId = trackId;
|
||||||
_events.trackLoaded(trackId, play);
|
_events.trackLoaded(trackId, play);
|
||||||
});
|
});
|
||||||
|
|
||||||
playqueue->trackUnload.connect([=]
|
playqueue->trackUnload.connect([=]
|
||||||
{
|
{
|
||||||
|
_events.lastLoadedTrackId.reset();
|
||||||
_events.trackUnloaded();
|
_events.trackUnloaded();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ struct Events
|
|||||||
|
|
||||||
// A track is being loaded
|
// A track is being loaded
|
||||||
Wt::Signal<Database::IdType /* trackId */, bool /* play */> trackLoaded;
|
Wt::Signal<Database::IdType /* trackId */, bool /* play */> trackLoaded;
|
||||||
|
boost::optional<Database::IdType> lastLoadedTrackId;
|
||||||
// Unload current track
|
// Unload current track
|
||||||
Wt::Signal<> trackUnloaded;
|
Wt::Signal<> trackUnloaded;
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,6 @@ Release::refresh()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
clear();
|
clear();
|
||||||
|
|
||||||
auto releaseId = readAs<Database::IdType>(wApp->internalPathNextPart("/release/"));
|
auto releaseId = readAs<Database::IdType>(wApp->internalPathNextPart("/release/"));
|
||||||
if (!releaseId)
|
if (!releaseId)
|
||||||
return;
|
return;
|
||||||
@@ -192,6 +191,14 @@ Release::refresh()
|
|||||||
{
|
{
|
||||||
trackAdd.emit(trackId);
|
trackAdd.emit(trackId);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
LmsApp->getEvents().trackLoaded.connect(entry, [=] (Database::IdType loadedTrackId, bool /*play*/)
|
||||||
|
{
|
||||||
|
entry->toggleStyleClass("Lms-explore-release-entry-playing", loadedTrackId == trackId);
|
||||||
|
});
|
||||||
|
|
||||||
|
if (LmsApp->getEvents().lastLoadedTrackId && *LmsApp->getEvents().lastLoadedTrackId == trackId)
|
||||||
|
entry->addStyleClass("Lms-explore-release-entry-playing");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user