mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-19 23:39:42 +01:00
First bit of migrating PlaylistInterface* to playlistinterface_ptr
Compiles, but need to fix up signals and slots
This commit is contained in:
parent
64d220d9c5
commit
3430535774
@ -58,7 +58,7 @@ LatchManager::latchRequest( const source_ptr& source )
|
||||
|
||||
m_state = Latching;
|
||||
m_waitingForLatch = source;
|
||||
AudioEngine::instance()->playItem( source->getPlaylistInterface().data(), source->getPlaylistInterface()->nextItem() );
|
||||
AudioEngine::instance()->playItem( source->getPlaylistInterface(), source->getPlaylistInterface()->nextItem() );
|
||||
}
|
||||
|
||||
void
|
||||
@ -133,7 +133,7 @@ LatchManager::unlatchRequest( const source_ptr& source )
|
||||
{
|
||||
Q_UNUSED( source );
|
||||
AudioEngine::instance()->stop();
|
||||
AudioEngine::instance()->setPlaylist( 0 );
|
||||
AudioEngine::instance()->setPlaylist( Tomahawk::playlistinterface_ptr() );
|
||||
|
||||
ActionCollection::instance()->getAction( "latchOn" )->setText( tr( "&Listen Along" ) );
|
||||
}
|
||||
|
@ -554,7 +554,7 @@ AudioEngine::loadNextTrack()
|
||||
|
||||
|
||||
void
|
||||
AudioEngine::playItem( Tomahawk::PlaylistInterface* playlist, const Tomahawk::result_ptr& result )
|
||||
AudioEngine::playItem( Tomahawk::playlistinterface_ptr playlist, const Tomahawk::result_ptr& result )
|
||||
{
|
||||
tDebug( LOGEXTRA ) << Q_FUNC_INFO << ( result.isNull() ? QString() : result->url() );
|
||||
|
||||
@ -678,7 +678,7 @@ AudioEngine::timerTriggered( qint64 time )
|
||||
|
||||
|
||||
void
|
||||
AudioEngine::setPlaylist( PlaylistInterface* playlist )
|
||||
AudioEngine::setPlaylist( Tomahawk::playlistinterface_ptr playlist )
|
||||
{
|
||||
if ( !m_playlist.isNull() )
|
||||
{
|
||||
@ -687,14 +687,14 @@ AudioEngine::setPlaylist( PlaylistInterface* playlist )
|
||||
m_playlist.data()->reset();
|
||||
}
|
||||
|
||||
if ( !playlist )
|
||||
if ( !playlist.isNull() )
|
||||
{
|
||||
m_playlist.clear();
|
||||
emit playlistChanged( playlist );
|
||||
return;
|
||||
}
|
||||
|
||||
m_playlist = playlist->getSharedPointer();
|
||||
m_playlist = playlist.data()->getSharedPointer();
|
||||
|
||||
if ( m_playlist.data()->object() && m_playlist.data()->retryMode() == PlaylistInterface::Retry )
|
||||
connect( m_playlist.data()->object(), SIGNAL( nextTrackReady() ), SLOT( playlistNextTrackReady() ) );
|
||||
|
@ -19,8 +19,8 @@
|
||||
#ifndef AUDIOENGINE_H
|
||||
#define AUDIOENGINE_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QTimer>
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QTimer>
|
||||
|
||||
#include <phonon/MediaObject>
|
||||
#include <phonon/AudioOutput>
|
||||
@ -30,15 +30,12 @@
|
||||
|
||||
#include "result.h"
|
||||
#include "typedefs.h"
|
||||
#include "playlistinterface.h"
|
||||
|
||||
#include "dllmacro.h"
|
||||
|
||||
#define AUDIO_VOLUME_STEP 5
|
||||
|
||||
namespace Tomahawk
|
||||
{
|
||||
class PlaylistInterface;
|
||||
}
|
||||
|
||||
class DLLEXPORT AudioEngine : public QObject
|
||||
{
|
||||
@ -62,10 +59,10 @@ public:
|
||||
bool isStopped() const { return m_state == Stopped; }
|
||||
|
||||
/* Returns the PlaylistInterface of the currently playing track. Note: This might be different to the current playlist! */
|
||||
Tomahawk::PlaylistInterface* currentTrackPlaylist() const { return m_currentTrackPlaylist.data(); }
|
||||
Tomahawk::playlistinterface_ptr currentTrackPlaylist() const { return m_currentTrackPlaylist; }
|
||||
|
||||
/* Returns the PlaylistInterface of the current playlist. Note: The currently playing track might still be from a different playlist! */
|
||||
Tomahawk::PlaylistInterface* playlist() const { return m_playlist.data(); }
|
||||
Tomahawk::playlistinterface_ptr playlist() const { return m_playlist; }
|
||||
|
||||
Tomahawk::result_ptr currentTrack() const { return m_currentTrack; }
|
||||
|
||||
@ -93,9 +90,9 @@ public slots:
|
||||
void onVolumeChanged( qreal volume ) { emit volumeChanged( volume * 100 ); }
|
||||
void mute();
|
||||
|
||||
void playItem( Tomahawk::PlaylistInterface* playlist, const Tomahawk::result_ptr& result );
|
||||
void setPlaylist( Tomahawk::PlaylistInterface* playlist );
|
||||
void setQueue( Tomahawk::PlaylistInterface* queue ) { m_queue = queue; }
|
||||
void playItem( Tomahawk::playlistinterface_ptr playlist, const Tomahawk::result_ptr& result );
|
||||
void setPlaylist( Tomahawk::playlistinterface_ptr playlist );
|
||||
void setQueue( Tomahawk::playlistinterface_ptr queue ) { m_queue = queue.data()->getSharedPointer(); }
|
||||
|
||||
void playlistNextTrackReady();
|
||||
|
||||
@ -119,7 +116,7 @@ signals:
|
||||
void timerSeconds( unsigned int secondsElapsed );
|
||||
void timerPercentage( unsigned int percentage );
|
||||
|
||||
void playlistChanged( Tomahawk::PlaylistInterface* playlist );
|
||||
void playlistChanged( Tomahawk::playlistinterface_ptr playlist );
|
||||
|
||||
void error( AudioEngine::AudioErrorCode errorCode );
|
||||
|
||||
@ -147,9 +144,9 @@ private:
|
||||
|
||||
Tomahawk::result_ptr m_currentTrack;
|
||||
Tomahawk::result_ptr m_lastTrack;
|
||||
QWeakPointer< Tomahawk::PlaylistInterface > m_playlist;
|
||||
QWeakPointer< Tomahawk::PlaylistInterface > m_currentTrackPlaylist;
|
||||
Tomahawk::PlaylistInterface* m_queue;
|
||||
Tomahawk::playlistinterface_ptr m_playlist;
|
||||
Tomahawk::playlistinterface_ptr m_currentTrackPlaylist;
|
||||
Tomahawk::playlistinterface_ptr m_queue;
|
||||
|
||||
Phonon::MediaObject* m_mediaObject;
|
||||
Phonon::AudioOutput* m_audioOutput;
|
||||
|
@ -1012,7 +1012,7 @@ GlobalActionManager::waitingForResolved( bool /* success */ )
|
||||
// AudioEngine::instance()->playItem( AudioEngine::instance()->playlist(), m_waitingToPlay->results().first() );
|
||||
if ( sender() && sender()->property( "playNow" ).toBool() )
|
||||
{
|
||||
if ( AudioEngine::instance()->playlist() )
|
||||
if ( !AudioEngine::instance()->playlist().isNull() )
|
||||
AudioEngine::instance()->playItem( AudioEngine::instance()->playlist(), m_waitingToPlay->results().first() );
|
||||
else
|
||||
{
|
||||
|
@ -66,8 +66,8 @@ MprisPlugin::MprisPlugin()
|
||||
SLOT( onPlaylistChanged( Tomahawk::PlaylistInterface* ) ) );
|
||||
|
||||
// When a track is added or removed, CanGoNext updated signal is sent
|
||||
PlaylistInterface *playlist = AudioEngine::instance()->playlist();
|
||||
if( playlist )
|
||||
Tomahawk::playlistinterface_ptr playlist = AudioEngine::instance()->playlist();
|
||||
if( !playlist.isNull() )
|
||||
connect( playlist->object(), SIGNAL( trackCountChanged( unsigned int ) ),
|
||||
SLOT( onTrackCountChanged( unsigned int ) ) );
|
||||
|
||||
@ -182,15 +182,15 @@ bool
|
||||
MprisPlugin::canPlay() const
|
||||
{
|
||||
// If there is a currently playing track, or if there is a playlist with at least 1 track, you can hit play
|
||||
PlaylistInterface *p = AudioEngine::instance()->playlist();
|
||||
return AudioEngine::instance()->currentTrack() || ( p && p->trackCount() );
|
||||
Tomahawk::playlistinterface_ptr p = AudioEngine::instance()->playlist();
|
||||
return AudioEngine::instance()->currentTrack() || ( !p.isNull() && p->trackCount() );
|
||||
}
|
||||
|
||||
bool
|
||||
MprisPlugin::canSeek() const
|
||||
{
|
||||
PlaylistInterface *p = AudioEngine::instance()->playlist();
|
||||
if (!p)
|
||||
Tomahawk::playlistinterface_ptr p = AudioEngine::instance()->playlist();
|
||||
if ( p.isNull() )
|
||||
return false;
|
||||
return p->seekRestrictions() != PlaylistInterface::NoSeek;
|
||||
|
||||
@ -199,8 +199,8 @@ MprisPlugin::canSeek() const
|
||||
QString
|
||||
MprisPlugin::loopStatus() const
|
||||
{
|
||||
PlaylistInterface *p = AudioEngine::instance()->playlist();
|
||||
if (!p)
|
||||
Tomahawk::playlistinterface_ptr p = AudioEngine::instance()->playlist();
|
||||
if ( p.isNull() )
|
||||
return "None";
|
||||
PlaylistInterface::RepeatMode mode = p->repeatMode();
|
||||
switch( mode )
|
||||
@ -225,8 +225,8 @@ MprisPlugin::loopStatus() const
|
||||
void
|
||||
MprisPlugin::setLoopStatus( const QString &value )
|
||||
{
|
||||
PlaylistInterface *p = AudioEngine::instance()->playlist();
|
||||
if (!p)
|
||||
Tomahawk::playlistinterface_ptr p = AudioEngine::instance()->playlist();
|
||||
if ( p.isNull() )
|
||||
return;
|
||||
if( value == "Track")
|
||||
p->setRepeatMode( PlaylistInterface::RepeatOne );
|
||||
@ -314,8 +314,8 @@ MprisPlugin::setRate( double value )
|
||||
bool
|
||||
MprisPlugin::shuffle() const
|
||||
{
|
||||
PlaylistInterface *p = AudioEngine::instance()->playlist();
|
||||
if (!p)
|
||||
Tomahawk::playlistinterface_ptr p = AudioEngine::instance()->playlist();
|
||||
if ( p.isNull() )
|
||||
return false;
|
||||
return p->shuffled();
|
||||
}
|
||||
@ -323,8 +323,8 @@ MprisPlugin::shuffle() const
|
||||
void
|
||||
MprisPlugin::setShuffle( bool value )
|
||||
{
|
||||
PlaylistInterface *p = AudioEngine::instance()->playlist();
|
||||
if (!p)
|
||||
Tomahawk::playlistinterface_ptr p = AudioEngine::instance()->playlist();
|
||||
if ( p.isNull() )
|
||||
return;
|
||||
return p->setShuffled( value );
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ public:
|
||||
void setModel( QAbstractItemModel* model );
|
||||
|
||||
virtual QWidget* widget() { return this; }
|
||||
virtual Tomahawk::PlaylistInterface* playlistInterface() const { return proxyModel(); }
|
||||
virtual Tomahawk::playlistinterface_ptr playlistInterface() const { return proxyModel()->getSharedPointer(); }
|
||||
|
||||
virtual QString title() const { return m_model->title(); }
|
||||
virtual QString description() const { return m_model->description(); }
|
||||
|
@ -188,7 +188,7 @@ ArtistView::onItemActivated( const QModelIndex& index )
|
||||
else if ( !item->result().isNull() && item->result()->isOnline() )
|
||||
{
|
||||
m_model->setCurrentItem( item->index );
|
||||
AudioEngine::instance()->playItem( m_proxyModel, item->result() );
|
||||
AudioEngine::instance()->playItem( m_proxyModel->getSharedPointer(), item->result() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,13 +19,15 @@
|
||||
#ifndef ARTISTVIEW_H
|
||||
#define ARTISTVIEW_H
|
||||
|
||||
#include <QSortFilterProxyModel>
|
||||
#include <QTreeView>
|
||||
#include <QTimer>
|
||||
#include <QtGui/QSortFilterProxyModel>
|
||||
#include <QtGui/QTreeView>
|
||||
#include <QtCore/QTimer>
|
||||
|
||||
#include "treeproxymodel.h"
|
||||
#include "viewpage.h"
|
||||
|
||||
#include "playlistinterface.h"
|
||||
|
||||
#include "dllmacro.h"
|
||||
|
||||
namespace Tomahawk
|
||||
@ -60,7 +62,7 @@ public:
|
||||
void setTreeModel( TreeModel* model );
|
||||
|
||||
virtual QWidget* widget() { return this; }
|
||||
virtual Tomahawk::PlaylistInterface* playlistInterface() const { return proxyModel(); }
|
||||
virtual Tomahawk::playlistinterface_ptr playlistInterface() const { return proxyModel()->getSharedPointer(); }
|
||||
|
||||
virtual QString title() const { return m_model->title(); }
|
||||
virtual QString description() const { return m_model->description(); }
|
||||
|
@ -39,7 +39,7 @@ public:
|
||||
virtual void setModel( QAbstractItemModel* model );
|
||||
|
||||
virtual QWidget* widget() { return this; }
|
||||
virtual Tomahawk::PlaylistInterface* playlistInterface() const { return proxyModel(); }
|
||||
virtual Tomahawk::playlistinterface_ptr playlistInterface() const { return proxyModel()->getSharedPointer(); }
|
||||
|
||||
virtual QString title() const { return model()->title(); }
|
||||
virtual QString description() const { return model()->description(); }
|
||||
|
@ -200,10 +200,10 @@ DynamicWidget::onRevisionLoaded( const Tomahawk::DynamicPlaylistRevision& rev )
|
||||
}
|
||||
|
||||
|
||||
PlaylistInterface*
|
||||
Tomahawk::playlistinterface_ptr
|
||||
DynamicWidget::playlistInterface() const
|
||||
{
|
||||
return m_view->proxyModel();
|
||||
return m_view->proxyModel()->getSharedPointer();
|
||||
}
|
||||
|
||||
|
||||
|
@ -62,7 +62,7 @@ public:
|
||||
void loadDynamicPlaylist( const dynplaylist_ptr& playlist );
|
||||
dynplaylist_ptr playlist();
|
||||
|
||||
virtual PlaylistInterface* playlistInterface() const;
|
||||
virtual Tomahawk::playlistinterface_ptr playlistInterface() const;
|
||||
|
||||
virtual QSize sizeHint() const;
|
||||
virtual void resizeEvent( QResizeEvent* );
|
||||
|
@ -38,7 +38,7 @@ public:
|
||||
virtual void setModel( QAbstractItemModel* model );
|
||||
|
||||
virtual QWidget* widget() { return this; }
|
||||
virtual Tomahawk::PlaylistInterface* playlistInterface() const { return proxyModel(); }
|
||||
virtual Tomahawk::playlistinterface_ptr playlistInterface() const { return proxyModel()->getSharedPointer(); }
|
||||
|
||||
virtual bool showFilter() const { return true; }
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
#ifndef TRACKPROXYMODEL_H
|
||||
#define TRACKPROXYMODEL_H
|
||||
|
||||
#include <QSortFilterProxyModel>
|
||||
#include <QtGui/QSortFilterProxyModel>
|
||||
|
||||
#include "playlistinterface.h"
|
||||
#include "playlist/trackmodel.h"
|
||||
|
@ -182,7 +182,7 @@ TrackView::onItemActivated( const QModelIndex& index )
|
||||
{
|
||||
tDebug() << "Result activated:" << item->query()->toString() << item->query()->results().first()->url();
|
||||
m_proxyModel->setCurrentIndex( index );
|
||||
AudioEngine::instance()->playItem( m_proxyModel, item->query()->results().first() );
|
||||
AudioEngine::instance()->playItem( m_proxyModel->getSharedPointer(), item->query()->results().first() );
|
||||
}
|
||||
|
||||
emit itemActivated( index );
|
||||
|
@ -19,8 +19,8 @@
|
||||
#ifndef TRACKVIEW_H
|
||||
#define TRACKVIEW_H
|
||||
|
||||
#include <QTreeView>
|
||||
#include <QSortFilterProxyModel>
|
||||
#include <QtGui/QTreeView>
|
||||
#include <QtGui/QSortFilterProxyModel>
|
||||
|
||||
#include "contextmenu.h"
|
||||
#include "playlistitemdelegate.h"
|
||||
|
@ -69,19 +69,15 @@ public:
|
||||
|
||||
// Some playlist interfaces can wrap other interfaces. When checking for top-level
|
||||
// equality (say, to compare the currently playing interface) this might be needed
|
||||
virtual bool hasChildInterface( PlaylistInterface* ) { return false; }
|
||||
virtual bool hasChildInterface( Tomahawk::playlistinterface_ptr ) { return false; }
|
||||
|
||||
QObject* object() const { return m_object; }
|
||||
|
||||
static void dontDelete( Tomahawk::PlaylistInterface* obj )
|
||||
{
|
||||
tDebug() << Q_FUNC_INFO << obj;
|
||||
}
|
||||
virtual Tomahawk::playlistinterface_ptr getSharedPointer()
|
||||
{
|
||||
if ( m_sharedPtr.isNull() )
|
||||
{
|
||||
m_sharedPtr = Tomahawk::playlistinterface_ptr( this, dontDelete );
|
||||
m_sharedPtr = Tomahawk::playlistinterface_ptr( this );
|
||||
}
|
||||
|
||||
return m_sharedPtr;
|
||||
|
@ -388,7 +388,7 @@ ViewManager::showSuperCollection()
|
||||
|
||||
|
||||
void
|
||||
ViewManager::playlistInterfaceChanged( Tomahawk::PlaylistInterface* interface )
|
||||
ViewManager::playlistInterfaceChanged( Tomahawk::playlistinterface_ptr interface )
|
||||
{
|
||||
playlist_ptr pl = playlistForInterface( interface );
|
||||
if ( !pl.isNull() )
|
||||
@ -813,7 +813,7 @@ ViewManager::pageForPlaylist(const playlist_ptr& pl) const
|
||||
|
||||
|
||||
ViewPage*
|
||||
ViewManager::pageForInterface( Tomahawk::PlaylistInterface* interface ) const
|
||||
ViewManager::pageForInterface( Tomahawk::playlistinterface_ptr interface ) const
|
||||
{
|
||||
for ( int i = 0; i < m_pageHistory.count(); i++ )
|
||||
{
|
||||
@ -827,13 +827,13 @@ ViewManager::pageForInterface( Tomahawk::PlaylistInterface* interface ) const
|
||||
return 0;
|
||||
}
|
||||
|
||||
PlaylistInterface*
|
||||
Tomahawk::playlistinterface_ptr
|
||||
ViewManager::currentPlaylistInterface() const
|
||||
{
|
||||
if ( currentPage() )
|
||||
return currentPage()->playlistInterface();
|
||||
else
|
||||
return 0;
|
||||
return Tomahawk::playlistinterface_ptr();
|
||||
}
|
||||
|
||||
|
||||
@ -844,7 +844,7 @@ ViewManager::currentPage() const
|
||||
}
|
||||
|
||||
Tomahawk::playlist_ptr
|
||||
ViewManager::playlistForInterface( Tomahawk::PlaylistInterface* interface ) const
|
||||
ViewManager::playlistForInterface( Tomahawk::playlistinterface_ptr interface ) const
|
||||
{
|
||||
foreach ( QWeakPointer<PlaylistView> view, m_playlistViews.values() )
|
||||
{
|
||||
@ -859,7 +859,7 @@ ViewManager::playlistForInterface( Tomahawk::PlaylistInterface* interface ) cons
|
||||
|
||||
|
||||
Tomahawk::dynplaylist_ptr
|
||||
ViewManager::dynamicPlaylistForInterface( Tomahawk::PlaylistInterface* interface ) const
|
||||
ViewManager::dynamicPlaylistForInterface( Tomahawk::playlistinterface_ptr interface ) const
|
||||
{
|
||||
foreach ( QWeakPointer<DynamicWidget> view, m_dynamicWidgets.values() )
|
||||
{
|
||||
@ -874,7 +874,7 @@ ViewManager::dynamicPlaylistForInterface( Tomahawk::PlaylistInterface* interface
|
||||
|
||||
|
||||
Tomahawk::collection_ptr
|
||||
ViewManager::collectionForInterface( Tomahawk::PlaylistInterface* interface ) const
|
||||
ViewManager::collectionForInterface( Tomahawk::playlistinterface_ptr interface ) const
|
||||
{
|
||||
foreach ( QWeakPointer<CollectionView> view, m_collectionViews.values() )
|
||||
{
|
||||
|
@ -82,9 +82,9 @@ public:
|
||||
bool isSuperCollectionVisible() const;
|
||||
bool isNewPlaylistPageVisible() const;
|
||||
|
||||
Tomahawk::PlaylistInterface* currentPlaylistInterface() const;
|
||||
Tomahawk::playlistinterface_ptr currentPlaylistInterface() const;
|
||||
Tomahawk::ViewPage* currentPage() const;
|
||||
Tomahawk::ViewPage* pageForInterface( Tomahawk::PlaylistInterface* interface ) const;
|
||||
Tomahawk::ViewPage* pageForInterface( Tomahawk::playlistinterface_ptr interface ) const;
|
||||
|
||||
Tomahawk::ViewPage* show( Tomahawk::ViewPage* page );
|
||||
|
||||
@ -156,7 +156,7 @@ public slots:
|
||||
void setRepeatMode( Tomahawk::PlaylistInterface::RepeatMode mode );
|
||||
void setShuffled( bool enabled );
|
||||
|
||||
void playlistInterfaceChanged( Tomahawk::PlaylistInterface* );
|
||||
void playlistInterfaceChanged( Tomahawk::playlistinterface_ptr );
|
||||
|
||||
// called by the playlist creation dbcmds
|
||||
void createPlaylist( const Tomahawk::source_ptr& src, const QVariant& contents );
|
||||
@ -177,9 +177,9 @@ private:
|
||||
void saveCurrentPlaylistSettings();
|
||||
void loadCurrentPlaylistSettings();
|
||||
|
||||
Tomahawk::playlist_ptr playlistForInterface( Tomahawk::PlaylistInterface* interface ) const;
|
||||
Tomahawk::dynplaylist_ptr dynamicPlaylistForInterface( Tomahawk::PlaylistInterface* interface ) const;
|
||||
Tomahawk::collection_ptr collectionForInterface( Tomahawk::PlaylistInterface* interface ) const;
|
||||
Tomahawk::playlist_ptr playlistForInterface( Tomahawk::playlistinterface_ptr interface ) const;
|
||||
Tomahawk::dynplaylist_ptr dynamicPlaylistForInterface( Tomahawk::playlistinterface_ptr interface ) const;
|
||||
Tomahawk::collection_ptr collectionForInterface( Tomahawk::playlistinterface_ptr interface ) const;
|
||||
|
||||
QWidget* m_widget;
|
||||
InfoBar* m_infobar;
|
||||
|
@ -25,7 +25,7 @@
|
||||
#include "album.h"
|
||||
#include "utils/tomahawkutils.h"
|
||||
|
||||
#include <QPixmap>
|
||||
#include <QtGui/QPixmap>
|
||||
|
||||
namespace Tomahawk
|
||||
{
|
||||
@ -43,7 +43,7 @@ public:
|
||||
virtual ~ViewPage() {}
|
||||
|
||||
virtual QWidget* widget() = 0;
|
||||
virtual Tomahawk::PlaylistInterface* playlistInterface() const = 0;
|
||||
virtual Tomahawk::playlistinterface_ptr playlistInterface() const = 0;
|
||||
|
||||
virtual QString title() const = 0;
|
||||
|
||||
|
@ -115,10 +115,10 @@ SocialPlaylistWidget::fetchFromDB()
|
||||
}
|
||||
|
||||
|
||||
PlaylistInterface*
|
||||
Tomahawk::playlistinterface_ptr
|
||||
SocialPlaylistWidget::playlistInterface() const
|
||||
{
|
||||
return 0;
|
||||
return Tomahawk::playlistinterface_ptr();
|
||||
}
|
||||
|
||||
|
||||
|
@ -55,7 +55,7 @@ public:
|
||||
~SocialPlaylistWidget();
|
||||
|
||||
virtual QWidget* widget() { return this; }
|
||||
virtual Tomahawk::PlaylistInterface* playlistInterface() const;
|
||||
virtual Tomahawk::playlistinterface_ptr playlistInterface() const;
|
||||
|
||||
virtual QString title() const { return m_title; }
|
||||
virtual QString description() const { return m_description; }
|
||||
|
@ -99,10 +99,10 @@ AlbumInfoWidget::~AlbumInfoWidget()
|
||||
}
|
||||
|
||||
|
||||
PlaylistInterface*
|
||||
Tomahawk::playlistinterface_ptr
|
||||
AlbumInfoWidget::playlistInterface() const
|
||||
{
|
||||
return ui->tracksView->playlistInterface();
|
||||
return ui->tracksView->playlistInterface()->getSharedPointer();
|
||||
}
|
||||
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
#ifndef ALBUMINFOWIDGET_H
|
||||
#define ALBUMINFOWIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QtGui/QWidget>
|
||||
|
||||
#include "playlistinterface.h"
|
||||
#include "viewpage.h"
|
||||
@ -55,7 +55,7 @@ public:
|
||||
~AlbumInfoWidget();
|
||||
|
||||
virtual QWidget* widget() { return this; }
|
||||
virtual Tomahawk::PlaylistInterface* playlistInterface() const;
|
||||
virtual Tomahawk::playlistinterface_ptr playlistInterface() const;
|
||||
|
||||
virtual QString title() const { return m_title; }
|
||||
virtual DescriptionType descriptionType();
|
||||
|
@ -102,10 +102,10 @@ ArtistInfoWidget::~ArtistInfoWidget()
|
||||
}
|
||||
|
||||
|
||||
PlaylistInterface*
|
||||
Tomahawk::playlistinterface_ptr
|
||||
ArtistInfoWidget::playlistInterface() const
|
||||
{
|
||||
return m_plInterface;
|
||||
return m_plInterface->getSharedPointer();
|
||||
}
|
||||
|
||||
|
||||
|
@ -68,7 +68,7 @@ public:
|
||||
void load( const Tomahawk::artist_ptr& artist );
|
||||
|
||||
virtual QWidget* widget() { return this; }
|
||||
virtual Tomahawk::PlaylistInterface* playlistInterface() const;
|
||||
virtual Tomahawk::playlistinterface_ptr playlistInterface() const;
|
||||
|
||||
virtual QString title() const { return m_title; }
|
||||
virtual QString description() const { return m_description; }
|
||||
|
@ -44,7 +44,7 @@ public:
|
||||
~SourceInfoWidget();
|
||||
|
||||
virtual QWidget* widget() { return this; }
|
||||
virtual Tomahawk::PlaylistInterface* playlistInterface() const { return 0; }
|
||||
virtual Tomahawk::playlistinterface_ptr playlistInterface() const { return Tomahawk::playlistinterface_ptr(); }
|
||||
|
||||
virtual QString title() const { return m_title; }
|
||||
virtual QString description() const { return m_description; }
|
||||
|
@ -19,8 +19,8 @@
|
||||
#ifndef NEWPLAYLISTWIDGET_H
|
||||
#define NEWPLAYLISTWIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QTimer>
|
||||
#include <QtGui/QWidget>
|
||||
#include <QtCore/QTimer>
|
||||
|
||||
#include "playlistinterface.h"
|
||||
#include "viewpage.h"
|
||||
@ -44,7 +44,7 @@ public:
|
||||
~NewPlaylistWidget();
|
||||
|
||||
virtual QWidget* widget() { return this; }
|
||||
virtual Tomahawk::PlaylistInterface* playlistInterface() const { return 0; }
|
||||
virtual Tomahawk::playlistinterface_ptr playlistInterface() const { return Tomahawk::playlistinterface_ptr(); }
|
||||
|
||||
virtual QString title() const { return tr( "Create a new playlist" ); }
|
||||
virtual QString description() const { return QString(); }
|
||||
|
@ -46,7 +46,7 @@ public:
|
||||
~SearchWidget();
|
||||
|
||||
virtual QWidget* widget() { return this; }
|
||||
virtual Tomahawk::PlaylistInterface* playlistInterface() const { return 0; }
|
||||
virtual Tomahawk::playlistinterface_ptr playlistInterface() const { return Tomahawk::playlistinterface_ptr(); }
|
||||
virtual bool isTemporaryPage() const { return true; }
|
||||
|
||||
virtual QString title() const { return QString( tr( "Search: %1" ) ).arg( m_search ); }
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include "welcomewidget.h"
|
||||
#include "ui_welcomewidget.h"
|
||||
|
||||
#include <QPainter>
|
||||
#include <QtGui/QPainter>
|
||||
|
||||
#include "viewmanager.h"
|
||||
#include "sourcelist.h"
|
||||
@ -98,10 +98,10 @@ WelcomeWidget::~WelcomeWidget()
|
||||
}
|
||||
|
||||
|
||||
PlaylistInterface*
|
||||
Tomahawk::playlistinterface_ptr
|
||||
WelcomeWidget::playlistInterface() const
|
||||
{
|
||||
return ui->tracksView->playlistInterface();
|
||||
return ui->tracksView->playlistInterface()->getSharedPointer();
|
||||
}
|
||||
|
||||
|
||||
|
@ -84,7 +84,7 @@ public:
|
||||
~WelcomeWidget();
|
||||
|
||||
virtual QWidget* widget() { return this; }
|
||||
virtual Tomahawk::PlaylistInterface* playlistInterface() const;
|
||||
virtual Tomahawk::playlistinterface_ptr playlistInterface() const;
|
||||
|
||||
virtual QString title() const { return tr( "Welcome to Tomahawk" ); }
|
||||
virtual QString description() const { return QString(); }
|
||||
|
@ -51,7 +51,6 @@ static QString s_whatsHotIdentifier = QString( "WhatsHotWidget" );
|
||||
WhatsHotWidget::WhatsHotWidget( QWidget* parent )
|
||||
: QWidget( parent )
|
||||
, ui( new Ui::WhatsHotWidget )
|
||||
, m_playlistInterface( 0 )
|
||||
, m_sortedProxy( 0 )
|
||||
{
|
||||
ui->setupUi( this );
|
||||
@ -92,7 +91,7 @@ WhatsHotWidget::WhatsHotWidget( QWidget* parent )
|
||||
ui->artistsViewLeft->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
|
||||
ui->artistsViewLeft->header()->setVisible( false );
|
||||
|
||||
m_playlistInterface = new ChartsPlaylistInterface( this );
|
||||
m_playlistInterface = ( new ChartsPlaylistInterface( this ) )->getSharedPointer();
|
||||
|
||||
connect( Tomahawk::InfoSystem::InfoSystem::instance(),
|
||||
SIGNAL( info( Tomahawk::InfoSystem::InfoRequestData, QVariant ) ),
|
||||
@ -106,12 +105,11 @@ WhatsHotWidget::WhatsHotWidget( QWidget* parent )
|
||||
|
||||
WhatsHotWidget::~WhatsHotWidget()
|
||||
{
|
||||
delete m_playlistInterface;
|
||||
delete ui;
|
||||
}
|
||||
|
||||
|
||||
PlaylistInterface*
|
||||
Tomahawk::playlistinterface_ptr
|
||||
WhatsHotWidget::playlistInterface() const
|
||||
{
|
||||
return m_playlistInterface;
|
||||
|
@ -19,9 +19,9 @@
|
||||
#ifndef WHATSHOTWIDGET_H
|
||||
#define WHATSHOTWIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QListWidgetItem>
|
||||
#include <QStyledItemDelegate>
|
||||
#include <QtGui/QWidget>
|
||||
#include <QtGui/QListWidgetItem>
|
||||
#include <QtGui/QStyledItemDelegate>
|
||||
|
||||
#include "playlistinterface.h"
|
||||
#include "infosystem/infosystem.h"
|
||||
@ -59,7 +59,7 @@ public:
|
||||
~WhatsHotWidget();
|
||||
|
||||
virtual QWidget* widget() { return this; }
|
||||
virtual Tomahawk::PlaylistInterface* playlistInterface() const;
|
||||
virtual Tomahawk::playlistinterface_ptr playlistInterface() const;
|
||||
|
||||
virtual QString title() const { return tr( "Charts" ); }
|
||||
virtual QString description() const { return QString(); }
|
||||
@ -91,7 +91,7 @@ private:
|
||||
|
||||
QStandardItem* parseNode( QStandardItem* parentItem, const QString &label, const QVariant &data );
|
||||
Ui::WhatsHotWidget *ui;
|
||||
ChartsPlaylistInterface* m_playlistInterface;
|
||||
Tomahawk::playlistinterface_ptr m_playlistInterface;
|
||||
|
||||
QStandardItemModel* m_crumbModelLeft;
|
||||
QSortFilterProxyModel* m_sortedProxy;
|
||||
|
@ -224,7 +224,7 @@ TomahawkWindow::setupSideBar()
|
||||
m_queueModel->setStyle( PlaylistModel::Short );
|
||||
m_queueView->queue()->setPlaylistModel( m_queueModel );
|
||||
m_queueView->queue()->playlistModel()->setReadOnly( false );
|
||||
AudioEngine::instance()->setQueue( m_queueView->queue()->proxyModel() );
|
||||
AudioEngine::instance()->setQueue( m_queueView->queue()->proxyModel()->getSharedPointer() );
|
||||
|
||||
m_sidebar->addWidget( m_searchWidget );
|
||||
m_sidebar->addWidget( m_sourcetree );
|
||||
|
Loading…
x
Reference in New Issue
Block a user