mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 22:26:32 +02:00
* previous- & nextTrackAvailable signal now emit a boolean parameter indicating whether there's another track available.
This commit is contained in:
@@ -184,35 +184,23 @@ PlaylistInterface::onItemsChanged()
|
|||||||
Tomahawk::result_ptr prevResult = siblingResult( -1, m_currentIndex );
|
Tomahawk::result_ptr prevResult = siblingResult( -1, m_currentIndex );
|
||||||
Tomahawk::result_ptr nextResult = siblingResult( 1, m_currentIndex );
|
Tomahawk::result_ptr nextResult = siblingResult( 1, m_currentIndex );
|
||||||
|
|
||||||
if ( prevResult )
|
|
||||||
{
|
{
|
||||||
bool avail = prevResult->toQuery()->playable();
|
bool avail = prevResult && prevResult->toQuery()->playable();
|
||||||
if ( avail != m_prevAvail )
|
if ( avail != m_prevAvail )
|
||||||
{
|
{
|
||||||
m_prevAvail = avail;
|
m_prevAvail = avail;
|
||||||
emit previousTrackAvailable();
|
emit previousTrackAvailable( avail );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( m_prevAvail )
|
|
||||||
{
|
|
||||||
m_prevAvail = false;
|
|
||||||
emit previousTrackAvailable();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( nextResult )
|
|
||||||
{
|
{
|
||||||
bool avail = nextResult->toQuery()->playable();
|
bool avail = nextResult && nextResult->toQuery()->playable();
|
||||||
if ( avail != m_nextAvail )
|
if ( avail != m_nextAvail )
|
||||||
{
|
{
|
||||||
m_nextAvail = avail;
|
m_nextAvail = avail;
|
||||||
emit nextTrackAvailable();
|
emit nextTrackAvailable( avail );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( m_nextAvail )
|
|
||||||
{
|
|
||||||
m_nextAvail = false;
|
|
||||||
emit nextTrackAvailable();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -96,8 +96,8 @@ signals:
|
|||||||
void shuffleModeChanged( bool enabled );
|
void shuffleModeChanged( bool enabled );
|
||||||
void latchModeChanged( Tomahawk::PlaylistModes::LatchMode mode );
|
void latchModeChanged( Tomahawk::PlaylistModes::LatchMode mode );
|
||||||
|
|
||||||
void previousTrackAvailable();
|
void previousTrackAvailable( bool available );
|
||||||
void nextTrackAvailable();
|
void nextTrackAvailable( bool available );
|
||||||
|
|
||||||
void currentIndexChanged();
|
void currentIndexChanged();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user