1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-07-31 11:20:22 +02:00

* This probably needs fixing some connects() now: Moved PlaylistInterface into Tomahawk namespace.

This commit is contained in:
Christian Muehlhaeuser
2011-06-16 23:05:40 +02:00
parent 53ea9b2589
commit 00252e4e53
29 changed files with 79 additions and 67 deletions

View File

@@ -30,6 +30,8 @@
#include "album.h"
using namespace Tomahawk;
static QString s_acInfoIdentifier = QString( "AUDIOCONTROLS" );

View File

@@ -43,7 +43,7 @@ signals:
void pausePressed();
public slots:
void onRepeatModeChanged( PlaylistInterface::RepeatMode mode );
void onRepeatModeChanged( Tomahawk::PlaylistInterface::RepeatMode mode );
void onShuffleModeChanged( bool enabled );
protected:
@@ -81,7 +81,7 @@ private:
QPixmap m_defaultCover;
Tomahawk::result_ptr m_currentTrack;
PlaylistInterface::RepeatMode m_repeatMode;
Tomahawk::PlaylistInterface::RepeatMode m_repeatMode;
bool m_shuffled;
};

View File

@@ -29,6 +29,8 @@
#include "album.h"
using namespace Tomahawk;
AudioEngine* AudioEngine::s_instance = 0;
static QString s_aeInfoIdentifier = QString( "AUDIOENGINE" );
@@ -319,7 +321,7 @@ AudioEngine::loadNextTrack()
void
AudioEngine::playItem( PlaylistInterface* playlist, const Tomahawk::result_ptr& result )
AudioEngine::playItem( Tomahawk::PlaylistInterface* playlist, const Tomahawk::result_ptr& result )
{
qDebug() << Q_FUNC_INFO;

View File

@@ -31,7 +31,10 @@
#define AUDIO_VOLUME_STEP 5
class PlaylistInterface;
namespace Tomahawk
{
class PlaylistInterface;
}
class DLLEXPORT AudioEngine : public QObject
{
@@ -50,10 +53,10 @@ public:
bool isPaused() const { return m_mediaObject->state() == Phonon::PausedState; }
/* Returns the PlaylistInterface of the currently playing track. Note: This might be different to the current playlist! */
PlaylistInterface* currentTrackPlaylist() const { return m_currentTrackPlaylist; }
Tomahawk::PlaylistInterface* currentTrackPlaylist() const { return m_currentTrackPlaylist; }
/* Returns the PlaylistInterface of the current playlist. Note: The currently playing track might still be from a different playlist! */
PlaylistInterface* playlist() const { return m_playlist; }
Tomahawk::PlaylistInterface* playlist() const { return m_playlist; }
public slots:
void playPause();
@@ -71,9 +74,9 @@ public slots:
void onVolumeChanged( qreal volume ) { emit volumeChanged( volume * 100 ); }
void mute();
void playItem( PlaylistInterface* playlist, const Tomahawk::result_ptr& result );
void setPlaylist( PlaylistInterface* playlist );
void setQueue( PlaylistInterface* queue ) { m_queue = queue; }
void playItem( Tomahawk::PlaylistInterface* playlist, const Tomahawk::result_ptr& result );
void setPlaylist( Tomahawk::PlaylistInterface* playlist );
void setQueue( Tomahawk::PlaylistInterface* queue ) { m_queue = queue; }
void onTrackAboutToFinish();
@@ -91,7 +94,7 @@ signals:
void timerSeconds( unsigned int secondsElapsed );
void timerPercentage( unsigned int percentage );
void playlistChanged( PlaylistInterface* playlist );
void playlistChanged( Tomahawk::PlaylistInterface* playlist );
void error( AudioErrorCode errorCode );
@@ -115,9 +118,9 @@ private:
Tomahawk::result_ptr m_currentTrack;
Tomahawk::result_ptr m_lastTrack;
PlaylistInterface* m_playlist;
PlaylistInterface* m_currentTrackPlaylist;
PlaylistInterface* m_queue;
Tomahawk::PlaylistInterface* m_playlist;
Tomahawk::PlaylistInterface* m_currentTrackPlaylist;
Tomahawk::PlaylistInterface* m_queue;
Phonon::MediaObject* m_mediaObject;
Phonon::AudioOutput* m_audioOutput;

View File

@@ -81,11 +81,11 @@ public:
}
public slots:
virtual void setRepeatMode( PlaylistInterface::RepeatMode /*mode*/ ) {}
virtual void setRepeatMode( Tomahawk::PlaylistInterface::RepeatMode /*mode*/ ) {}
virtual void setShuffled( bool /*shuffled*/ ) {}
signals:
void repeatModeChanged( PlaylistInterface::RepeatMode mode );
void repeatModeChanged( Tomahawk::PlaylistInterface::RepeatMode mode );
void shuffleModeChanged( bool enabled );
void trackCountChanged( unsigned int tracks );

View File

@@ -26,7 +26,7 @@
#include "dllmacro.h"
class DLLEXPORT AlbumProxyModel : public QSortFilterProxyModel, public PlaylistInterface
class DLLEXPORT AlbumProxyModel : public QSortFilterProxyModel, public Tomahawk::PlaylistInterface
{
Q_OBJECT
@@ -50,9 +50,9 @@ public:
virtual void setFilter( const QString& pattern );
virtual PlaylistInterface::RepeatMode repeatMode() const { return m_repeatMode; }
virtual Tomahawk::PlaylistInterface::RepeatMode repeatMode() const { return m_repeatMode; }
virtual bool shuffled() const { return m_shuffled; }
virtual PlaylistInterface::ViewMode viewMode() const { return PlaylistInterface::Album; }
virtual Tomahawk::PlaylistInterface::ViewMode viewMode() const { return Tomahawk::PlaylistInterface::Album; }
signals:
void repeatModeChanged( PlaylistInterface::RepeatMode mode );

View File

@@ -46,7 +46,7 @@ public:
void setModel( QAbstractItemModel* model );
virtual QWidget* widget() { return this; }
virtual PlaylistInterface* playlistInterface() const { return proxyModel(); }
virtual Tomahawk::PlaylistInterface* playlistInterface() const { return proxyModel(); }
virtual QString title() const { return m_model->title(); }
virtual QString description() const { return m_model->description(); }

View File

@@ -48,7 +48,7 @@ public:
void setModel( TreeModel* model );
virtual QWidget* widget() { return this; }
virtual PlaylistInterface* playlistInterface() const { return proxyModel(); }
virtual Tomahawk::PlaylistInterface* playlistInterface() const { return proxyModel(); }
virtual QString title() const { return m_model->title(); }
virtual QString description() const { return m_model->description(); }

View File

@@ -57,7 +57,7 @@ public:
virtual void append( const Tomahawk::query_ptr& /*query*/ ) {}
signals:
void repeatModeChanged( PlaylistInterface::RepeatMode mode );
void repeatModeChanged( Tomahawk::PlaylistInterface::RepeatMode mode );
void shuffleModeChanged( bool enabled );
void loadingStarted();

View File

@@ -40,7 +40,7 @@ public:
virtual void setModel( QAbstractItemModel* model );
virtual QWidget* widget() { return this; }
virtual PlaylistInterface* playlistInterface() const { return proxyModel(); }
virtual Tomahawk::PlaylistInterface* playlistInterface() const { return proxyModel(); }
virtual QString title() const { return model()->title(); }
virtual QString description() const { return model()->description(); }

View File

@@ -36,7 +36,6 @@ class QVBoxLayout;
class QHBoxLayout;
class QPushButton;
class QComboBox;
class PlaylistInterface;
class PlaylistModel;
class PlaylistView;
class AnimatedSplitter;

View File

@@ -69,7 +69,7 @@ public:
bool isTemporary() const;
signals:
void repeatModeChanged( PlaylistInterface::RepeatMode mode );
void repeatModeChanged( Tomahawk::PlaylistInterface::RepeatMode mode );
void shuffleModeChanged( bool enabled );
void itemSizeChanged( const QModelIndex& index );

View File

@@ -43,7 +43,7 @@ public:
virtual void setModel( QAbstractItemModel* model );
virtual QWidget* widget() { return this; }
virtual PlaylistInterface* playlistInterface() const { return proxyModel(); }
virtual Tomahawk::PlaylistInterface* playlistInterface() const { return proxyModel(); }
virtual bool showFilter() const { return true; }

View File

@@ -63,7 +63,7 @@ public slots:
void setFilter( const QString& filter );
private slots:
void onModeChanged( PlaylistInterface::ViewMode mode );
void onModeChanged( Tomahawk::PlaylistInterface::ViewMode mode );
void onFlatMode();
void onArtistMode();
void onAlbumMode();

View File

@@ -74,7 +74,7 @@ public:
virtual QPersistentModelIndex currentItem() { return m_currentIndex; }
virtual PlaylistInterface::RepeatMode repeatMode() const { return PlaylistInterface::NoRepeat; }
virtual Tomahawk::PlaylistInterface::RepeatMode repeatMode() const { return Tomahawk::PlaylistInterface::NoRepeat; }
virtual bool shuffled() const { return false; }
virtual void ensureResolved();
@@ -86,7 +86,7 @@ public:
TrackModelItem* m_rootItem;
signals:
void repeatModeChanged( PlaylistInterface::RepeatMode mode );
void repeatModeChanged( Tomahawk::PlaylistInterface::RepeatMode mode );
void shuffleModeChanged( bool enabled );
void trackCountChanged( unsigned int tracks );
@@ -100,7 +100,7 @@ public slots:
virtual void removeIndex( const QModelIndex& index, bool moreToCome = false );
virtual void removeIndexes( const QList<QModelIndex>& indexes );
virtual void setRepeatMode( PlaylistInterface::RepeatMode /*mode*/ ) {}
virtual void setRepeatMode( Tomahawk::PlaylistInterface::RepeatMode /*mode*/ ) {}
virtual void setShuffled( bool /*shuffled*/ ) {}
protected:

View File

@@ -26,7 +26,7 @@
#include "dllmacro.h"
class DLLEXPORT TrackProxyModel : public QSortFilterProxyModel, public PlaylistInterface
class DLLEXPORT TrackProxyModel : public QSortFilterProxyModel, public Tomahawk::PlaylistInterface
{
Q_OBJECT

View File

@@ -28,7 +28,6 @@
class QAction;
class LoadingSpinner;
class PlaylistInterface;
class TrackHeader;
class TrackModel;
class TrackProxyModel;

View File

@@ -101,11 +101,11 @@ public:
public slots:
virtual void setCurrentItem( const QModelIndex& index );
virtual void setRepeatMode( PlaylistInterface::RepeatMode /*mode*/ ) {}
virtual void setRepeatMode( Tomahawk::PlaylistInterface::RepeatMode /*mode*/ ) {}
virtual void setShuffled( bool /*shuffled*/ ) {}
signals:
void repeatModeChanged( PlaylistInterface::RepeatMode mode );
void repeatModeChanged( Tomahawk::PlaylistInterface::RepeatMode mode );
void shuffleModeChanged( bool enabled );
void trackCountChanged( unsigned int tracks );

View File

@@ -26,7 +26,7 @@
#include "dllmacro.h"
class DLLEXPORT TreeProxyModel : public QSortFilterProxyModel, public PlaylistInterface
class DLLEXPORT TreeProxyModel : public QSortFilterProxyModel, public Tomahawk::PlaylistInterface
{
Q_OBJECT

View File

@@ -27,6 +27,9 @@
#include "dllmacro.h"
#include "result.h"
namespace Tomahawk
{
class DLLEXPORT PlaylistInterface
{
public:
@@ -70,4 +73,6 @@ private:
QString m_filter;
};
};
#endif // PLAYLISTINTERFACE_H

View File

@@ -30,6 +30,8 @@
#define VERSION 3
using namespace Tomahawk;
TomahawkSettings* TomahawkSettings::s_instance = 0;

View File

@@ -76,8 +76,8 @@ public:
bool shuffleState( const QString& playlistid ) const;
void setShuffleState( const QString& playlistid, bool state );
PlaylistInterface::RepeatMode repeatMode( const QString& playlistid );
void setRepeatMode( const QString& playlistid, PlaylistInterface::RepeatMode mode);
Tomahawk::PlaylistInterface::RepeatMode repeatMode( const QString& playlistid );
void setRepeatMode( const QString& playlistid, Tomahawk::PlaylistInterface::RepeatMode mode );
// remove shuffle state and repeat state
void removePlaylistSettings( const QString& playlistid );

View File

@@ -72,9 +72,9 @@ public:
bool isSuperCollectionVisible() const;
bool isNewPlaylistPageVisible() const;
PlaylistInterface* currentPlaylistInterface() const;
Tomahawk::PlaylistInterface* currentPlaylistInterface() const;
Tomahawk::ViewPage* currentPage() const;
Tomahawk::ViewPage* pageForInterface( PlaylistInterface* interface ) const;
Tomahawk::ViewPage* pageForInterface( Tomahawk::PlaylistInterface* interface ) const;
int positionInHistory( Tomahawk::ViewPage* page ) const;
Tomahawk::ViewPage* show( Tomahawk::ViewPage* page );
@@ -97,13 +97,13 @@ signals:
void numArtistsChanged( unsigned int artists );
void numShownChanged( unsigned int shown );
void repeatModeChanged( PlaylistInterface::RepeatMode mode );
void repeatModeChanged( Tomahawk::PlaylistInterface::RepeatMode mode );
void shuffleModeChanged( bool enabled );
void statsAvailable( bool b );
void modesAvailable( bool b );
void filterAvailable( bool b );
void modeChanged( PlaylistInterface::ViewMode mode );
void modeChanged( Tomahawk::PlaylistInterface::ViewMode mode );
void playClicked();
void pauseClicked();
@@ -138,10 +138,10 @@ public slots:
void showQueue();
void hideQueue();
void setRepeatMode( PlaylistInterface::RepeatMode mode );
void setRepeatMode( Tomahawk::PlaylistInterface::RepeatMode mode );
void setShuffled( bool enabled );
void playlistInterfaceChanged( PlaylistInterface* );
void playlistInterfaceChanged( Tomahawk::PlaylistInterface* );
// called by the playlist creation dbcmds
void createPlaylist( const Tomahawk::source_ptr& src, const QVariant& contents );
@@ -165,9 +165,9 @@ private:
void saveCurrentPlaylistSettings();
void loadCurrentPlaylistSettings();
Tomahawk::playlist_ptr playlistForInterface( PlaylistInterface* interface ) const;
Tomahawk::dynplaylist_ptr dynamicPlaylistForInterface( PlaylistInterface* interface ) const;
Tomahawk::collection_ptr collectionForInterface( PlaylistInterface* interface ) const;
Tomahawk::playlist_ptr playlistForInterface( Tomahawk::PlaylistInterface* interface ) const;
Tomahawk::dynplaylist_ptr dynamicPlaylistForInterface( Tomahawk::PlaylistInterface* interface ) const;
Tomahawk::collection_ptr collectionForInterface( Tomahawk::PlaylistInterface* interface ) const;
QWidget* m_widget;
InfoBar* m_infobar;

View File

@@ -38,7 +38,7 @@ public:
virtual ~ViewPage() {}
virtual QWidget* widget() = 0;
virtual PlaylistInterface* playlistInterface() const = 0;
virtual Tomahawk::PlaylistInterface* playlistInterface() const = 0;
virtual QString title() const = 0;
virtual QString description() const = 0;

View File

@@ -46,7 +46,7 @@ public:
~SourceInfoWidget();
virtual QWidget* widget() { return this; }
virtual PlaylistInterface* playlistInterface() const { return 0; }
virtual Tomahawk::PlaylistInterface* playlistInterface() const { return 0; }
virtual QString title() const { return m_title; }
virtual QString description() const { return m_description; }

View File

@@ -46,7 +46,7 @@ public:
~NewPlaylistWidget();
virtual QWidget* widget() { return this; }
virtual PlaylistInterface* playlistInterface() const { return 0; }
virtual Tomahawk::PlaylistInterface* playlistInterface() const { return 0; }
virtual QString title() const { return tr( "Create a new playlist" ); }
virtual QString description() const { return QString(); }

View File

@@ -45,7 +45,7 @@ public:
~SearchWidget();
virtual QWidget* widget() { return this; }
virtual PlaylistInterface* playlistInterface() const { return 0; }
virtual Tomahawk::PlaylistInterface* playlistInterface() const { return 0; }
virtual QString title() const { return tr( "Search" ); }
virtual QString description() const { return tr( "Results for '%1'" ).arg( m_search ); }

View File

@@ -44,7 +44,7 @@ signals:
void emptinessChanged( bool isEmpty );
private slots:
void playlistChanged( PlaylistInterface* );
void playlistChanged( Tomahawk::PlaylistInterface* );
void onSourceAdded( const Tomahawk::source_ptr& source );
void onPlaylistsRemoved( QList<Tomahawk::playlist_ptr> );
void loadFromSettings();

View File

@@ -80,7 +80,7 @@ public:
~WelcomeWidget();
virtual QWidget* widget() { return this; }
virtual PlaylistInterface* playlistInterface() const { return 0; }
virtual Tomahawk::PlaylistInterface* playlistInterface() const { return 0; }
virtual QString title() const { return tr( "Welcome to Tomahawk" ); }
virtual QString description() const { return QString(); }