mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-09 07:36:48 +02:00
* Adapted existing PlaylistInterfaces to new API.
This commit is contained in:
@@ -53,8 +53,10 @@ AlbumPlaylistInterface::~AlbumPlaylistInterface()
|
|||||||
|
|
||||||
|
|
||||||
Tomahawk::result_ptr
|
Tomahawk::result_ptr
|
||||||
AlbumPlaylistInterface::siblingItem( int itemsAway )
|
AlbumPlaylistInterface::siblingItem( int itemsAway, bool readOnly )
|
||||||
{
|
{
|
||||||
|
Q_UNUSED( readOnly );
|
||||||
|
|
||||||
int p = m_currentTrack;
|
int p = m_currentTrack;
|
||||||
p += itemsAway;
|
p += itemsAway;
|
||||||
|
|
||||||
|
@@ -44,7 +44,10 @@ public:
|
|||||||
|
|
||||||
virtual int trackCount() const { return m_queries.count(); }
|
virtual int trackCount() const { return m_queries.count(); }
|
||||||
|
|
||||||
virtual Tomahawk::result_ptr siblingItem( int itemsAway );
|
virtual Tomahawk::result_ptr siblingItem( int itemsAway, bool readOnly = false );
|
||||||
|
|
||||||
|
virtual Tomahawk::query_ptr itemAt( unsigned int position ) const { Q_UNUSED( position ); Q_ASSERT( false ); return Tomahawk::query_ptr(); }
|
||||||
|
virtual int indexOfResult( const Tomahawk::result_ptr& result ) const { Q_UNUSED( result ); Q_ASSERT( false ); return -1; }
|
||||||
|
|
||||||
virtual bool hasNextItem();
|
virtual bool hasNextItem();
|
||||||
virtual bool hasPreviousItem();
|
virtual bool hasPreviousItem();
|
||||||
|
@@ -52,8 +52,10 @@ ArtistPlaylistInterface::~ArtistPlaylistInterface()
|
|||||||
|
|
||||||
|
|
||||||
Tomahawk::result_ptr
|
Tomahawk::result_ptr
|
||||||
ArtistPlaylistInterface::siblingItem( int itemsAway )
|
ArtistPlaylistInterface::siblingItem( int itemsAway, bool readOnly )
|
||||||
{
|
{
|
||||||
|
Q_UNUSED( readOnly );
|
||||||
|
|
||||||
int p = m_currentTrack;
|
int p = m_currentTrack;
|
||||||
p += itemsAway;
|
p += itemsAway;
|
||||||
|
|
||||||
|
@@ -43,7 +43,10 @@ public:
|
|||||||
|
|
||||||
virtual int trackCount() const { return m_queries.count(); }
|
virtual int trackCount() const { return m_queries.count(); }
|
||||||
|
|
||||||
virtual Tomahawk::result_ptr siblingItem( int itemsAway );
|
virtual Tomahawk::result_ptr siblingItem( int itemsAway, bool readOnly = false );
|
||||||
|
|
||||||
|
virtual Tomahawk::query_ptr itemAt( unsigned int position ) const { Q_UNUSED( position ); Q_ASSERT( false ); return Tomahawk::query_ptr(); }
|
||||||
|
virtual int indexOfResult( const Tomahawk::result_ptr& result ) const { Q_UNUSED( result ); Q_ASSERT( false ); return -1; }
|
||||||
|
|
||||||
virtual bool hasNextItem();
|
virtual bool hasNextItem();
|
||||||
virtual Tomahawk::result_ptr currentItem() const;
|
virtual Tomahawk::result_ptr currentItem() const;
|
||||||
|
@@ -46,10 +46,13 @@ public:
|
|||||||
|
|
||||||
virtual int trackCount() const;
|
virtual int trackCount() const;
|
||||||
|
|
||||||
|
virtual Tomahawk::query_ptr itemAt( unsigned int position ) const { Q_UNUSED( position ); Q_ASSERT( false ); return Tomahawk::query_ptr(); }
|
||||||
|
virtual int indexOfResult( const Tomahawk::result_ptr& result ) const { Q_UNUSED( result ); Q_ASSERT( false ); return -1; }
|
||||||
|
|
||||||
virtual bool hasNextItem() { return false; }
|
virtual bool hasNextItem() { return false; }
|
||||||
virtual Tomahawk::result_ptr currentItem() const { return m_currentItem; }
|
virtual Tomahawk::result_ptr currentItem() const { return m_currentItem; }
|
||||||
|
|
||||||
virtual Tomahawk::result_ptr siblingItem( int /*itemsAway*/ ) { return result_ptr(); }
|
virtual Tomahawk::result_ptr siblingItem( int /*itemsAway*/, bool /*readOnly*/ ) { return result_ptr(); }
|
||||||
|
|
||||||
virtual PlaylistModes::RepeatMode repeatMode() const { return PlaylistModes::NoRepeat; }
|
virtual PlaylistModes::RepeatMode repeatMode() const { return PlaylistModes::NoRepeat; }
|
||||||
virtual bool shuffled() const { return false; }
|
virtual bool shuffled() const { return false; }
|
||||||
|
@@ -51,9 +51,11 @@ SourcePlaylistInterface::~SourcePlaylistInterface()
|
|||||||
|
|
||||||
|
|
||||||
Tomahawk::result_ptr
|
Tomahawk::result_ptr
|
||||||
SourcePlaylistInterface::siblingItem( int itemsAway )
|
SourcePlaylistInterface::siblingItem( int itemsAway, bool readOnly )
|
||||||
{
|
{
|
||||||
Q_UNUSED( itemsAway );
|
Q_UNUSED( itemsAway );
|
||||||
|
Q_UNUSED( readOnly );
|
||||||
|
|
||||||
return nextItem();
|
return nextItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -43,7 +43,10 @@ public:
|
|||||||
|
|
||||||
virtual int trackCount() const { return 1; }
|
virtual int trackCount() const { return 1; }
|
||||||
|
|
||||||
virtual Tomahawk::result_ptr siblingItem( int itemsAway );
|
virtual Tomahawk::query_ptr itemAt( unsigned int position ) const { Q_UNUSED( position ); Q_ASSERT( false ); return Tomahawk::query_ptr(); }
|
||||||
|
virtual int indexOfResult( const Tomahawk::result_ptr& result ) const { Q_UNUSED( result ); Q_ASSERT( false ); return -1; }
|
||||||
|
|
||||||
|
virtual Tomahawk::result_ptr siblingItem( int itemsAway, bool readOnly = false );
|
||||||
virtual bool sourceValid();
|
virtual bool sourceValid();
|
||||||
virtual bool hasNextItem();
|
virtual bool hasNextItem();
|
||||||
virtual Tomahawk::result_ptr nextItem();
|
virtual Tomahawk::result_ptr nextItem();
|
||||||
|
@@ -42,11 +42,17 @@ public:
|
|||||||
void setQuery( const query_ptr& track ) { m_track = track; }
|
void setQuery( const query_ptr& track ) { m_track = track; }
|
||||||
|
|
||||||
virtual result_ptr currentItem() const { return result_ptr(); }
|
virtual result_ptr currentItem() const { return result_ptr(); }
|
||||||
|
|
||||||
|
virtual Tomahawk::query_ptr itemAt( unsigned int position ) const { Q_UNUSED( position ); Q_ASSERT( false ); return Tomahawk::query_ptr(); }
|
||||||
|
virtual int indexOfResult( const Tomahawk::result_ptr& result ) const { Q_UNUSED( result ); Q_ASSERT( false ); return -1; }
|
||||||
|
|
||||||
virtual PlaylistModes::RepeatMode repeatMode() const { return PlaylistModes::NoRepeat; }
|
virtual PlaylistModes::RepeatMode repeatMode() const { return PlaylistModes::NoRepeat; }
|
||||||
virtual void setRepeatMode( PlaylistModes::RepeatMode ) {}
|
virtual void setRepeatMode( PlaylistModes::RepeatMode ) {}
|
||||||
virtual void setShuffled( bool ) {}
|
|
||||||
virtual bool shuffled() const { return false; }
|
virtual bool shuffled() const { return false; }
|
||||||
virtual result_ptr siblingItem( int ) { return result_ptr(); }
|
virtual void setShuffled( bool ) {}
|
||||||
|
|
||||||
|
virtual result_ptr siblingItem( int, bool ) { return result_ptr(); }
|
||||||
virtual int trackCount() const { return 1; }
|
virtual int trackCount() const { return 1; }
|
||||||
virtual QList< query_ptr > tracks() { return QList< query_ptr >(); }
|
virtual QList< query_ptr > tracks() { return QList< query_ptr >(); }
|
||||||
|
|
||||||
|
@@ -73,13 +73,6 @@ TreeProxyModelPlaylistInterface::hasNextItem()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Tomahawk::result_ptr
|
|
||||||
TreeProxyModelPlaylistInterface::siblingItem( int itemsAway )
|
|
||||||
{
|
|
||||||
return siblingItem( itemsAway, false );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Tomahawk::result_ptr
|
Tomahawk::result_ptr
|
||||||
TreeProxyModelPlaylistInterface::siblingItem( int itemsAway, bool readOnly )
|
TreeProxyModelPlaylistInterface::siblingItem( int itemsAway, bool readOnly )
|
||||||
{
|
{
|
||||||
|
@@ -43,9 +43,11 @@ public:
|
|||||||
|
|
||||||
virtual int trackCount() const;
|
virtual int trackCount() const;
|
||||||
|
|
||||||
|
virtual Tomahawk::query_ptr itemAt( unsigned int position ) const { Q_UNUSED( position ); Q_ASSERT( false ); return Tomahawk::query_ptr(); }
|
||||||
|
virtual int indexOfResult( const Tomahawk::result_ptr& result ) const { Q_UNUSED( result ); Q_ASSERT( false ); return -1; }
|
||||||
|
|
||||||
virtual bool hasNextItem();
|
virtual bool hasNextItem();
|
||||||
virtual Tomahawk::result_ptr currentItem() const;
|
virtual Tomahawk::result_ptr currentItem() const;
|
||||||
virtual Tomahawk::result_ptr siblingItem( int direction );
|
|
||||||
virtual Tomahawk::result_ptr siblingItem( int direction, bool readOnly );
|
virtual Tomahawk::result_ptr siblingItem( int direction, bool readOnly );
|
||||||
|
|
||||||
virtual QString filter() const;
|
virtual QString filter() const;
|
||||||
|
@@ -57,8 +57,10 @@ public:
|
|||||||
virtual bool shuffled() const { return m_w->ui->tracksViewLeft->proxyModel()->playlistInterface()->shuffled(); }
|
virtual bool shuffled() const { return m_w->ui->tracksViewLeft->proxyModel()->playlistInterface()->shuffled(); }
|
||||||
|
|
||||||
// Do nothing
|
// Do nothing
|
||||||
|
virtual Tomahawk::query_ptr itemAt( unsigned int position ) const { Q_UNUSED( position ); Q_ASSERT( false ); return Tomahawk::query_ptr(); }
|
||||||
|
virtual int indexOfResult( const Tomahawk::result_ptr& result ) const { Q_UNUSED( result ); Q_ASSERT( false ); return -1; }
|
||||||
virtual Tomahawk::result_ptr currentItem() const { return Tomahawk::result_ptr(); }
|
virtual Tomahawk::result_ptr currentItem() const { return Tomahawk::result_ptr(); }
|
||||||
virtual Tomahawk::result_ptr siblingItem( int ) { return Tomahawk::result_ptr(); }
|
virtual Tomahawk::result_ptr siblingItem( int, bool ) { return Tomahawk::result_ptr(); }
|
||||||
virtual int trackCount() const { return 0; }
|
virtual int trackCount() const { return 0; }
|
||||||
virtual QList< Tomahawk::query_ptr > tracks() { return QList< Tomahawk::query_ptr >(); }
|
virtual QList< Tomahawk::query_ptr > tracks() { return QList< Tomahawk::query_ptr >(); }
|
||||||
|
|
||||||
|
@@ -44,12 +44,13 @@ public:
|
|||||||
}
|
}
|
||||||
virtual ~MetaAlbumInfoInterface() {}
|
virtual ~MetaAlbumInfoInterface() {}
|
||||||
|
|
||||||
|
|
||||||
virtual Tomahawk::PlaylistModes::RepeatMode repeatMode() const { return m_w->ui->tracks->proxyModel()->playlistInterface()->repeatMode(); }
|
virtual Tomahawk::PlaylistModes::RepeatMode repeatMode() const { return m_w->ui->tracks->proxyModel()->playlistInterface()->repeatMode(); }
|
||||||
virtual bool shuffled() const { return m_w->ui->tracks->proxyModel()->playlistInterface()->shuffled(); }
|
virtual bool shuffled() const { return m_w->ui->tracks->proxyModel()->playlistInterface()->shuffled(); }
|
||||||
|
|
||||||
|
virtual Tomahawk::query_ptr itemAt( unsigned int position ) const { Q_UNUSED( position ); Q_ASSERT( false ); return Tomahawk::query_ptr(); }
|
||||||
|
virtual int indexOfResult( const Tomahawk::result_ptr& result ) const { Q_UNUSED( result ); Q_ASSERT( false ); return -1; }
|
||||||
virtual Tomahawk::result_ptr currentItem() const { return m_w->ui->tracks->proxyModel()->playlistInterface()->currentItem(); }
|
virtual Tomahawk::result_ptr currentItem() const { return m_w->ui->tracks->proxyModel()->playlistInterface()->currentItem(); }
|
||||||
virtual Tomahawk::result_ptr siblingItem( int itemsAway ) { return m_w->ui->tracks->proxyModel()->playlistInterface()->siblingItem( itemsAway ); }
|
virtual Tomahawk::result_ptr siblingItem( int itemsAway, bool readOnly ) { return m_w->ui->tracks->proxyModel()->playlistInterface()->siblingItem( itemsAway, readOnly ); }
|
||||||
virtual int trackCount() const { return m_w->ui->tracks->proxyModel()->playlistInterface()->trackCount(); }
|
virtual int trackCount() const { return m_w->ui->tracks->proxyModel()->playlistInterface()->trackCount(); }
|
||||||
virtual QList< Tomahawk::query_ptr > tracks() { return m_w->ui->tracks->proxyModel()->playlistInterface()->tracks(); }
|
virtual QList< Tomahawk::query_ptr > tracks() { return m_w->ui->tracks->proxyModel()->playlistInterface()->tracks(); }
|
||||||
|
|
||||||
|
@@ -53,15 +53,16 @@ public:
|
|||||||
}
|
}
|
||||||
virtual ~MetaArtistInfoInterface() {}
|
virtual ~MetaArtistInfoInterface() {}
|
||||||
|
|
||||||
|
|
||||||
// Any one is fine, we keep them all synched
|
// Any one is fine, we keep them all synched
|
||||||
virtual Tomahawk::PlaylistModes::RepeatMode repeatMode() const { return m_w->ui->albums->proxyModel()->playlistInterface()->repeatMode(); }
|
virtual Tomahawk::PlaylistModes::RepeatMode repeatMode() const { return m_w->ui->albums->proxyModel()->playlistInterface()->repeatMode(); }
|
||||||
|
|
||||||
virtual bool shuffled() const { return m_w->ui->albums->proxyModel()->playlistInterface()->shuffled(); }
|
virtual bool shuffled() const { return m_w->ui->albums->proxyModel()->playlistInterface()->shuffled(); }
|
||||||
|
|
||||||
// Do nothing
|
// Do nothing
|
||||||
|
virtual Tomahawk::query_ptr itemAt( unsigned int position ) const { Q_UNUSED( position ); Q_ASSERT( false ); return Tomahawk::query_ptr(); }
|
||||||
|
virtual int indexOfResult( const Tomahawk::result_ptr& result ) const { Q_UNUSED( result ); Q_ASSERT( false ); return -1; }
|
||||||
virtual Tomahawk::result_ptr currentItem() const { return Tomahawk::result_ptr(); }
|
virtual Tomahawk::result_ptr currentItem() const { return Tomahawk::result_ptr(); }
|
||||||
virtual Tomahawk::result_ptr siblingItem( int ) { return Tomahawk::result_ptr(); }
|
virtual Tomahawk::result_ptr siblingItem( int, bool ) { return Tomahawk::result_ptr(); }
|
||||||
virtual int trackCount() const { return 0; }
|
virtual int trackCount() const { return 0; }
|
||||||
virtual QList< Tomahawk::query_ptr > tracks() { return QList< Tomahawk::query_ptr >(); }
|
virtual QList< Tomahawk::query_ptr > tracks() { return QList< Tomahawk::query_ptr >(); }
|
||||||
virtual int unfilteredTrackCount() const { return 0; }
|
virtual int unfilteredTrackCount() const { return 0; }
|
||||||
|
Reference in New Issue
Block a user