1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-05 21:57:41 +02:00

Warning and memleak fixes

This commit is contained in:
Leo Franchi
2012-05-19 09:40:02 -04:00
parent 77a901a71f
commit 4b28c15850
157 changed files with 557 additions and 427 deletions

View File

@@ -30,6 +30,7 @@
#include "utils/Logger.h"
#include "utils/AnimatedSpinner.h"
#include "utils/Closure.h"
#include "Source.h"
#define CHILD_ACCOUNT_HEIGHT 24

View File

@@ -24,6 +24,7 @@
#include "AccountFactoryWrapperDelegate.h"
#include "DelegateConfigWrapper.h"
#include "ui_AccountFactoryWrapper.h"
#include "Source.h"
using namespace Tomahawk::Accounts;
AccountFactoryWrapper::AccountFactoryWrapper( AccountFactory* factory, QWidget* parent )

View File

@@ -20,6 +20,7 @@
#include "accounts/Account.h"
#include "AccountFactoryWrapper.h"
#include "utils/TomahawkUtils.h"
#include "Source.h"
#include <QApplication>
#include <QPainter>

View File

@@ -42,7 +42,7 @@ using namespace Tomahawk;
AudioControls::AudioControls( QWidget* parent )
: QWidget( parent )
, ui( new Ui::AudioControls )
, m_repeatMode( PlaylistInterface::NoRepeat )
, m_repeatMode( PlaylistModes::NoRepeat )
, m_shuffled( false )
, m_lastSliderCheck( 0 )
, m_parent( parent )
@@ -430,13 +430,13 @@ AudioControls::onPlaybackTimer( qint64 msElapsed )
void
AudioControls::onRepeatModeChanged( PlaylistInterface::RepeatMode mode )
AudioControls::onRepeatModeChanged( PlaylistModes::RepeatMode mode )
{
m_repeatMode = mode;
switch ( m_repeatMode )
{
case PlaylistInterface::NoRepeat:
case PlaylistModes::NoRepeat:
{
// switch to RepeatOne
ui->repeatButton->setPixmap( RESPATH "images/repeat-off-rest.png" );
@@ -444,7 +444,7 @@ AudioControls::onRepeatModeChanged( PlaylistInterface::RepeatMode mode )
}
break;
case PlaylistInterface::RepeatOne:
case PlaylistModes::RepeatOne:
{
// switch to RepeatAll
ui->repeatButton->setPixmap( RESPATH "images/repeat-1-on-rest.png" );
@@ -452,7 +452,7 @@ AudioControls::onRepeatModeChanged( PlaylistInterface::RepeatMode mode )
}
break;
case PlaylistInterface::RepeatAll:
case PlaylistModes::RepeatAll:
{
// switch to NoRepeat
ui->repeatButton->setPixmap( RESPATH "images/repeat-all-on-rest.png" );
@@ -471,24 +471,24 @@ AudioControls::onRepeatClicked()
{
switch ( m_repeatMode )
{
case PlaylistInterface::NoRepeat:
case PlaylistModes::NoRepeat:
{
// switch to RepeatOne
ViewManager::instance()->setRepeatMode( PlaylistInterface::RepeatOne );
ViewManager::instance()->setRepeatMode( PlaylistModes::RepeatOne );
}
break;
case PlaylistInterface::RepeatOne:
case PlaylistModes::RepeatOne:
{
// switch to RepeatAll
ViewManager::instance()->setRepeatMode( PlaylistInterface::RepeatAll );
ViewManager::instance()->setRepeatMode( PlaylistModes::RepeatAll );
}
break;
case PlaylistInterface::RepeatAll:
case PlaylistModes::RepeatAll:
{
// switch to NoRepeat
ViewManager::instance()->setRepeatMode( PlaylistInterface::NoRepeat );
ViewManager::instance()->setRepeatMode( PlaylistModes::NoRepeat );
}
break;

View File

@@ -50,7 +50,7 @@ signals:
void pausePressed();
public slots:
void onRepeatModeChanged( Tomahawk::PlaylistInterface::RepeatMode mode );
void onRepeatModeChanged( Tomahawk::PlaylistModes::RepeatMode mode );
void onShuffleModeChanged( bool enabled );
protected:
@@ -93,7 +93,7 @@ private:
Ui::AudioControls* ui;
Tomahawk::result_ptr m_currentTrack;
Tomahawk::PlaylistInterface::RepeatMode m_repeatMode;
Tomahawk::PlaylistModes::RepeatMode m_repeatMode;
bool m_shuffled;
QTimer m_phononTickCheckTimer;

View File

@@ -29,7 +29,6 @@
#define TOMAHAWK_APPLICATION QApplication
#include <QApplication>
#include "TomahawkWindow.h"
#endif

View File

@@ -18,6 +18,7 @@
#include "LoadXSPFDialog.h"
#include "TomahawkSettings.h"
#include "Source.h"
#include "ui_LoadXSPFDialog.h"
#include <QFileDialog>

View File

@@ -29,6 +29,7 @@
#include "audio/AudioEngine.h"
#include "TomahawkSettings.h"
#include "infosystem/InfoSystem.h"
#include "Source.h"
#include "utils/Logger.h"

View File

@@ -25,6 +25,7 @@
#include "GlobalActionManager.h"
#include "utils/Logger.h"
#include "Source.h"
#define CORNER_ROUNDNESS 8.0
#define FADING_DURATION 500

View File

@@ -471,7 +471,8 @@ TomahawkApp::registerMetaTypes()
qRegisterMetaTypeStreamOperators< QList< Tomahawk::InfoSystem::InfoStringHash > >("QList< Tomahawk::InfoSystem::InfoStringHash > ");
qRegisterMetaType< QPersistentModelIndex >( "QPersistentModelIndex" );
qRegisterMetaType< Tomahawk::PlaylistInterface::LatchMode >( "Tomahawk::PlaylistInterface::LatchMode" );
qRegisterMetaType< Tomahawk::PlaylistModes::LatchMode >( "Tomahawk::PlaylistModes::LatchMode" );
qRegisterMetaType< Tomahawk::PlaylistModes::RepeatMode >( "Tomahawk::PlaylistModes::RepeatMode" );
qRegisterMetaType< TomahawkUtils::CacheData >( "TomahawkUtils::CacheData" );
qRegisterMetaTypeStreamOperators< TomahawkUtils::CacheData >( "TomahawkUtils::CacheData" );

View File

@@ -47,6 +47,7 @@ class Servent;
class SipHandler;
class TomahawkSettings;
class XMPPBot;
class AudioControls;
namespace Tomahawk
{

View File

@@ -27,6 +27,8 @@
#include "TomahawkApp.h"
#include "TomahawkWindow.h"
#include "Query.h"
#include "Source.h"
#include "Collection.h"
#include "utils/Logger.h"
#include "utils/TomahawkUtilsGui.h"

View File

@@ -318,8 +318,8 @@ void
TomahawkWindow::setupSignals()
{
// <From PlaylistManager>
connect( ViewManager::instance(), SIGNAL( repeatModeChanged( Tomahawk::PlaylistInterface::RepeatMode ) ),
m_audioControls, SLOT( onRepeatModeChanged( Tomahawk::PlaylistInterface::RepeatMode ) ) );
connect( ViewManager::instance(), SIGNAL( repeatModeChanged( Tomahawk::PlaylistModes::RepeatMode ) ),
m_audioControls, SLOT( onRepeatModeChanged( Tomahawk::PlaylistModes::RepeatMode ) ) );
connect( ViewManager::instance(), SIGNAL( shuffleModeChanged( bool ) ),
m_audioControls, SLOT( onShuffleModeChanged( bool ) ) );

View File

@@ -26,6 +26,7 @@
#include "AtticaManager.h"
#include "Pipeline.h"
#include "accounts/AccountManager.h"
#include "Source.h"
using namespace Tomahawk;
using namespace InfoSystem;

View File

@@ -30,6 +30,8 @@
#include "utils/TomahawkUtils.h"
#include "utils/Logger.h"
#include "accounts/lastfm/LastFmAccount.h"
#include "Source.h"
#include "TomahawkSettings.h"
#include <lastfm/ws.h>
#include <lastfm/XmlQuery>

View File

@@ -24,6 +24,7 @@
#include "TomahawkSettings.h"
#include "utils/TomahawkUtils.h"
#include "database/Database.h"
#include "Source.h"
#include "TomahawkOAuthTwitter.h"
#include <QTweetLib/qtweetaccountverifycredentials.h>

View File

@@ -27,6 +27,7 @@
#include "GlobalActionManager.h"
#include "utils/Logger.h"
#include "Source.h"
namespace Tomahawk
{

View File

@@ -37,6 +37,7 @@
#include <TomahawkSettings.h>
#include <database/Database.h>
#include <network/Servent.h>
#include "Source.h"
#include "utils/Logger.h"
#include "accounts/twitter/TomahawkOAuthTwitter.h"

View File

@@ -23,6 +23,7 @@
#include "GlobalActionManager.h"
#include "sip/XmppSip.h"
#include "utils/Logger.h"
#include "TomahawkSettings.h"
// remove now playing status after PAUSE_TIMEOUT seconds

View File

@@ -48,6 +48,7 @@
#include <utils/TomahawkUtils.h>
#include <utils/Logger.h>
#include <accounts/AccountManager.h>
#include <TomahawkSettings.h>
#ifndef ENABLE_HEADLESS
#include <QtGui/QInputDialog>

View File

@@ -26,6 +26,7 @@
#include "TomahawkSettings.h"
#include "utils/Logger.h"
#include "ZeroconfAccount.h"
#include "Source.h"
using namespace Tomahawk;
using namespace Accounts;

View File

@@ -20,6 +20,7 @@
#include "sip/SipPlugin.h"
#include "Zeroconf.h"
#include "Source.h"
#include <QtCore/QtPlugin>

View File

@@ -35,6 +35,7 @@
#include "utils/TomahawkUtils.h"
#include "utils/Logger.h"
#include "utils/TomahawkCache.h"
#include "Source.h"
#define CHART_URL "http://charts.tomahawk-player.org/"
//#define CHART_URL "http://localhost:8080/"

View File

@@ -31,6 +31,7 @@
#include "TomahawkSettings.h"
#include "utils/TomahawkUtils.h"
#include "utils/Logger.h"
#include "Source.h"
#define HYPEM_URL "http://hypem.com/playlist/"
#define HYPEM_END_URL "json/1/data.js"

View File

@@ -14,6 +14,7 @@
#include "utils/TomahawkUtils.h"
#include "utils/Logger.h"
#include "utils/TomahawkCache.h"
#include "Source.h"
#include <qjson/parser.h>
#include <qjson/serializer.h>

View File

@@ -33,6 +33,7 @@
#include "utils/TomahawkUtils.h"
#include "utils/Logger.h"
#include "CountryUtils.h"
#include "Source.h"
#define SPOTIFY_API_URL "http://spotikea.tomahawk-player.org/"
#include <qjson/parser.h>

View File

@@ -31,6 +31,8 @@
#include "GlobalActionManager.h"
#include "utils/Logger.h"
#include "utils/TomahawkUtils.h"
#include "audio/AudioEngine.h"
#include "Source.h"
#include "MprisPlugin.h"
#include "MprisPluginRootAdaptor.h"
@@ -198,7 +200,7 @@ MprisPlugin::canSeek() const
Tomahawk::playlistinterface_ptr p = AudioEngine::instance()->playlist();
if ( p.isNull() )
return false;
return p->seekRestrictions() != PlaylistInterface::NoSeek;
return p->seekRestrictions() != PlaylistModes::NoSeek;
}
@@ -209,16 +211,16 @@ MprisPlugin::loopStatus() const
Tomahawk::playlistinterface_ptr p = AudioEngine::instance()->playlist();
if ( p.isNull() )
return "None";
PlaylistInterface::RepeatMode mode = p->repeatMode();
PlaylistModes::RepeatMode mode = p->repeatMode();
switch( mode )
{
case PlaylistInterface::RepeatOne:
case PlaylistModes::RepeatOne:
return "Track";
break;
case PlaylistInterface::RepeatAll:
case PlaylistModes::RepeatAll:
return "Playlist";
break;
case PlaylistInterface::NoRepeat:
case PlaylistModes::NoRepeat:
return "None";
break;
default:
@@ -237,11 +239,11 @@ MprisPlugin::setLoopStatus( const QString& value )
if ( p.isNull() )
return;
if ( value == "Track" )
p->setRepeatMode( PlaylistInterface::RepeatOne );
p->setRepeatMode( PlaylistModes::RepeatOne );
else if ( value == "Playlist" )
p->setRepeatMode( PlaylistInterface::RepeatAll );
p->setRepeatMode( PlaylistModes::RepeatAll );
else if ( value == "None" )
p->setRepeatMode( PlaylistInterface::NoRepeat );
p->setRepeatMode( PlaylistModes::NoRepeat );
}

View File

@@ -24,6 +24,7 @@
#include "TomahawkSettings.h"
#include "TomahawkApp.h"
#include "Source.h"
#include "utils/Logger.h"
#include "jobview/AclJobItem.h"

View File

@@ -26,6 +26,9 @@
#include <QTimer>
#include <QMutex>
#include <QVariant>
#include <QQueue>
#include <QStringList>
#include <QUuid>
#include "HeadlessCheck.h"
#include "DllMacro.h"

View File

@@ -22,6 +22,8 @@
#include "TomahawkSettings.h"
#include "audio/AudioEngine.h"
#include "utils/TomahawkUtils.h"
#include "utils/Logger.h"
#include "Source.h"
ActionCollection* ActionCollection::s_instance = 0;
ActionCollection* ActionCollection::instance()
@@ -77,11 +79,11 @@ ActionCollection::initActions()
m_actionCollection[ "quit" ] = new QAction( tr( "&Quit" ), this );
// connect actions to AudioEngine
AudioEngine *ae = AudioEngine::instance();
connect( m_actionCollection[ "playPause" ], SIGNAL( triggered() ), ae, SLOT( playPause() ), Qt::UniqueConnection );
connect( m_actionCollection[ "stop" ], SIGNAL( triggered() ), ae, SLOT( stop() ), Qt::UniqueConnection );
connect( m_actionCollection[ "previousTrack" ], SIGNAL( triggered() ), ae, SLOT( previous() ), Qt::UniqueConnection );
connect( m_actionCollection[ "nextTrack" ], SIGNAL( triggered() ), ae, SLOT( next() ), Qt::UniqueConnection );
// AudioEngine *ae = AudioEngine::instance();
// connect( m_actionCollection[ "playPause" ], SIGNAL( triggered() ), ae, SLOT( playPause() ), Qt::UniqueConnection );
// connect( m_actionCollection[ "stop" ], SIGNAL( triggered() ), ae, SLOT( stop() ), Qt::UniqueConnection );
// connect( m_actionCollection[ "previousTrack" ], SIGNAL( triggered() ), ae, SLOT( previous() ), Qt::UniqueConnection );
// connect( m_actionCollection[ "nextTrack" ], SIGNAL( triggered() ), ae, SLOT( next() ), Qt::UniqueConnection );
}

View File

@@ -24,6 +24,7 @@
#include "database/Database.h"
#include "database/DatabaseImpl.h"
#include "Query.h"
#include "Source.h"
#include "utils/Logger.h"

View File

@@ -50,16 +50,16 @@ public:
virtual bool hasNextItem();
virtual Tomahawk::result_ptr currentItem() const;
virtual PlaylistInterface::RepeatMode repeatMode() const { return PlaylistInterface::NoRepeat; }
virtual PlaylistModes::RepeatMode repeatMode() const { return PlaylistModes::NoRepeat; }
virtual bool shuffled() const { return false; }
virtual void setRepeatMode( PlaylistInterface::RepeatMode ) {}
virtual void setRepeatMode( PlaylistModes::RepeatMode ) {}
virtual void setShuffled( bool ) {}
virtual void setFilter( const QString& /*pattern*/ ) {}
signals:
void repeatModeChanged( Tomahawk::PlaylistInterface::RepeatMode mode );
void repeatModeChanged( Tomahawk::PlaylistModes::RepeatMode mode );
void shuffleModeChanged( bool enabled );
void trackCountChanged( unsigned int tracks );

View File

@@ -25,6 +25,7 @@
#include "database/DatabaseImpl.h"
#include "database/DatabaseCommand_AllAlbums.h"
#include "database/DatabaseCommand_TrackStats.h"
#include "Source.h"
#include "utils/Logger.h"

View File

@@ -30,7 +30,6 @@
#include "Typedefs.h"
#include "DllMacro.h"
#include "Query.h"
#include "infosystem/InfoSystem.h"
namespace Tomahawk
{

View File

@@ -24,6 +24,7 @@
#include "Query.h"
#include "database/Database.h"
#include "database/DatabaseCommand_AllTracks.h"
#include "Source.h"
#include "utils/Logger.h"

View File

@@ -49,10 +49,10 @@ public:
virtual bool hasNextItem();
virtual Tomahawk::result_ptr currentItem() const;
virtual PlaylistInterface::RepeatMode repeatMode() const { return PlaylistInterface::NoRepeat; }
virtual PlaylistModes::RepeatMode repeatMode() const { return PlaylistModes::NoRepeat; }
virtual bool shuffled() const { return false; }
virtual void setRepeatMode( PlaylistInterface::RepeatMode ) {}
virtual void setRepeatMode( PlaylistModes::RepeatMode ) {}
virtual void setShuffled( bool ) {}
virtual void setFilter( const QString& /*pattern*/ ) {}

View File

@@ -21,6 +21,7 @@
#include "utils/TomahawkUtils.h"
#include "TomahawkSettingsGui.h"
#include "Pipeline.h"
#include "Source.h"
#include <attica/downloaditem.h>

View File

@@ -27,6 +27,7 @@
#include "Artist.h"
#include "Album.h"
#include "utils/Logger.h"
#include "audio/AudioEngine.h"
using namespace Tomahawk;

View File

@@ -19,6 +19,7 @@
#include "ExternalResolver.h"
#include "utils/Logger.h"
#include "Source.h"
Tomahawk::ExternalResolver::ErrorState
Tomahawk::ExternalResolver::error() const

View File

@@ -28,6 +28,8 @@
#include <QUiLoader>
#include "utils/Logger.h"
#include "Source.h"
Tomahawk::ExternalResolverGui::ExternalResolverGui(const QString& filePath)
: Tomahawk::ExternalResolver(filePath)
{

View File

@@ -152,7 +152,7 @@ LatchManager::latchModeChangeRequest( const Tomahawk::source_ptr& source, bool r
if ( !isLatched( source ) )
return;
source->playlistInterface()->setLatchMode( realtime ? Tomahawk::PlaylistInterface::RealTime : Tomahawk::PlaylistInterface::StayOnSong );
source->playlistInterface()->setLatchMode( realtime ? Tomahawk::PlaylistModes::RealTime : Tomahawk::PlaylistModes::StayOnSong );
if ( realtime )
catchUpRequest();
}

View File

@@ -25,6 +25,7 @@
#include "ExternalResolver.h"
#include "resolvers/ScriptResolver.h"
#include "resolvers/QtScriptResolver.h"
#include "Source.h"
#include "utils/Logger.h"

View File

@@ -25,10 +25,9 @@ using namespace Tomahawk;
PlaylistInterface::PlaylistInterface ()
: QObject()
, m_latchMode( StayOnSong )
, m_latchMode( PlaylistModes::StayOnSong )
{
m_id = uuid();
qRegisterMetaType<Tomahawk::PlaylistInterface::RepeatMode>( "Tomahawk::PlaylistInterface::RepeatMode" );
}
PlaylistInterface::~PlaylistInterface()

View File

@@ -34,14 +34,6 @@ class DLLEXPORT PlaylistInterface : public QObject
Q_OBJECT
public:
enum RepeatMode { NoRepeat, RepeatOne, RepeatAll };
Q_ENUMS( RepeatMode )
enum ViewMode { Unknown, Tree, Flat, Album };
enum SeekRestrictions { NoSeekRestrictions, NoSeek };
enum SkipRestrictions { NoSkipRestrictions, NoSkipForwards, NoSkipBackwards, NoSkip };
enum RetryMode { NoRetry, Retry };
enum LatchMode { StayOnSong, RealTime };
explicit PlaylistInterface();
virtual ~PlaylistInterface();
@@ -58,20 +50,20 @@ public:
virtual Tomahawk::result_ptr nextItem();
virtual Tomahawk::result_ptr siblingItem( int itemsAway ) = 0;
virtual PlaylistInterface::RepeatMode repeatMode() const = 0;
virtual PlaylistModes::RepeatMode repeatMode() const = 0;
virtual bool shuffled() const = 0;
virtual PlaylistInterface::ViewMode viewMode() const { return Unknown; }
virtual PlaylistModes::ViewMode viewMode() const { return PlaylistModes::Unknown; }
virtual PlaylistInterface::SeekRestrictions seekRestrictions() const { return NoSeekRestrictions; }
virtual PlaylistInterface::SkipRestrictions skipRestrictions() const { return NoSkipRestrictions; }
virtual PlaylistModes::SeekRestrictions seekRestrictions() const { return PlaylistModes::NoSeekRestrictions; }
virtual PlaylistModes::SkipRestrictions skipRestrictions() const { return PlaylistModes::NoSkipRestrictions; }
virtual PlaylistInterface::RetryMode retryMode() const { return NoRetry; }
virtual PlaylistModes::RetryMode retryMode() const { return PlaylistModes::NoRetry; }
virtual quint32 retryInterval() const { return 30000; }
virtual PlaylistInterface::LatchMode latchMode() const { return m_latchMode; }
virtual void setLatchMode( PlaylistInterface::LatchMode latchMode ) { m_latchMode = latchMode; }
virtual PlaylistModes::LatchMode latchMode() const { return m_latchMode; }
virtual void setLatchMode( PlaylistModes::LatchMode latchMode ) { m_latchMode = latchMode; }
virtual QString filter() const { return m_filter; }
virtual void setFilter( const QString& pattern ) { m_filter = pattern; }
@@ -84,23 +76,21 @@ public:
virtual bool hasChildInterface( Tomahawk::playlistinterface_ptr ) { return false; }
public slots:
virtual void setRepeatMode( RepeatMode mode ) = 0;
virtual void setRepeatMode( PlaylistModes::RepeatMode mode ) = 0;
virtual void setShuffled( bool enabled ) = 0;
signals:
void repeatModeChanged( Tomahawk::PlaylistInterface::RepeatMode mode );
void repeatModeChanged( Tomahawk::PlaylistModes::RepeatMode mode );
void shuffleModeChanged( bool enabled );
void trackCountChanged( unsigned int tracks );
void sourceTrackCountChanged( unsigned int tracks );
void latchModeChanged( Tomahawk::PlaylistInterface::LatchMode mode );
void latchModeChanged( Tomahawk::PlaylistModes::LatchMode mode );
void nextTrackReady();
protected:
LatchMode m_latchMode;
PlaylistModes::LatchMode m_latchMode;
private:
Q_DISABLE_COPY( PlaylistInterface )
QString m_id;
QString m_filter;
};

View File

@@ -52,13 +52,13 @@ public:
virtual Tomahawk::result_ptr siblingItem( int /*itemsAway*/ ) { return result_ptr(); }
virtual PlaylistInterface::RepeatMode repeatMode() const { return PlaylistInterface::NoRepeat; }
virtual PlaylistModes::RepeatMode repeatMode() const { return PlaylistModes::NoRepeat; }
virtual bool shuffled() const { return false; }
virtual void setFilter( const QString& /*pattern*/ ) {}
public slots:
virtual void setRepeatMode( PlaylistInterface::RepeatMode ) {}
virtual void setRepeatMode( PlaylistModes::RepeatMode ) {}
virtual void setShuffled( bool ) {}
private:

View File

@@ -17,3 +17,5 @@
*/
#include "Resolver.h"
#include "Source.h"

View File

@@ -28,7 +28,7 @@
using namespace Tomahawk;
SourcePlaylistInterface::SourcePlaylistInterface( Tomahawk::Source *source, Tomahawk::PlaylistInterface::LatchMode latchMode )
SourcePlaylistInterface::SourcePlaylistInterface( Tomahawk::Source *source, Tomahawk::PlaylistModes::LatchMode latchMode )
: PlaylistInterface()
, m_source( source )
, m_currentItem( 0 )

View File

@@ -36,7 +36,7 @@ class DLLEXPORT SourcePlaylistInterface : public Tomahawk::PlaylistInterface
Q_OBJECT
public:
SourcePlaylistInterface( Tomahawk::Source *source, Tomahawk::PlaylistInterface::LatchMode latchMode = PlaylistInterface::StayOnSong );
SourcePlaylistInterface( Tomahawk::Source *source, Tomahawk::PlaylistModes::LatchMode latchMode = PlaylistModes::StayOnSong );
virtual ~SourcePlaylistInterface();
QList<Tomahawk::query_ptr> tracks();
@@ -50,13 +50,13 @@ public:
virtual Tomahawk::result_ptr nextItem();
virtual Tomahawk::result_ptr currentItem() const;
virtual PlaylistInterface::RepeatMode repeatMode() const { return PlaylistInterface::NoRepeat; }
virtual PlaylistInterface::SeekRestrictions seekRestrictions() const { return PlaylistInterface::NoSeek; }
virtual PlaylistInterface::SkipRestrictions skipRestrictions() const { return PlaylistInterface::NoSkipBackwards; }
virtual PlaylistInterface::RetryMode retryMode() const { return Retry; }
virtual PlaylistModes::RepeatMode repeatMode() const { return PlaylistModes::NoRepeat; }
virtual PlaylistModes::SeekRestrictions seekRestrictions() const { return PlaylistModes::NoSeek; }
virtual PlaylistModes::SkipRestrictions skipRestrictions() const { return PlaylistModes::NoSkipBackwards; }
virtual PlaylistModes::RetryMode retryMode() const { return PlaylistModes::Retry; }
virtual quint32 retryInterval() const { return 5000; }
virtual void setLatchMode( PlaylistInterface::LatchMode latchMode ) { m_latchMode = latchMode; emit latchModeChanged( latchMode ); }
virtual void setLatchMode( PlaylistModes::LatchMode latchMode ) { m_latchMode = latchMode; emit latchModeChanged( latchMode ); }
virtual bool shuffled() const { return false; }
virtual void setFilter( const QString& /*pattern*/ ) {}
@@ -66,9 +66,9 @@ public:
virtual void reset();
public slots:
virtual void setRepeatMode( PlaylistInterface::RepeatMode ) {}
virtual void setRepeatMode( PlaylistModes::RepeatMode ) {}
virtual void setShuffled( bool ) {}
virtual void audioPaused() { setLatchMode( PlaylistInterface::StayOnSong ); }
virtual void audioPaused() { setLatchMode( PlaylistModes::StayOnSong ); }
private slots:
void onSourcePlaybackStarted( const Tomahawk::query_ptr& query );

View File

@@ -22,6 +22,7 @@
#include <QDir>
#include "Source.h"
#include "sip/SipHandler.h"
#include "PlaylistInterface.h"
@@ -557,7 +558,7 @@ TomahawkSettings::doUpgrade( int oldVersion, int newVersion )
endGroup();
setPlaylistUpdaters( updaters );
// setPlaylistUpdaters( updaters );
remove( "playlistupdaters" );
}
@@ -948,33 +949,16 @@ TomahawkSettings::removePlaylistSettings( const QString& playlistid )
void
TomahawkSettings::setRepeatMode( const QString& playlistid, Tomahawk::PlaylistInterface::RepeatMode mode )
TomahawkSettings::setRepeatMode( const QString& playlistid, Tomahawk::PlaylistModes::RepeatMode mode )
{
setValue( QString( "ui/playlist/%1/repeatMode" ).arg( playlistid ), (int)mode );
}
Tomahawk::PlaylistInterface::RepeatMode
Tomahawk::PlaylistModes::RepeatMode
TomahawkSettings::repeatMode( const QString& playlistid )
{
return (PlaylistInterface::RepeatMode)value( QString( "ui/playlist/%1/repeatMode" ).arg( playlistid )).toInt();
}
QList<Tomahawk::playlist_ptr>
TomahawkSettings::recentlyPlayedPlaylists() const
{
QStringList playlist_guids = value( "playlists/recentlyPlayed" ).toStringList();
QList<playlist_ptr> playlists;
foreach( const QString& guid, playlist_guids )
{
playlist_ptr pl = Playlist::load( guid );
if ( !pl.isNull() )
playlists << pl;
}
return playlists;
return (PlaylistModes::RepeatMode)value( QString( "ui/playlist/%1/repeatMode" ).arg( playlistid )).toInt();
}
@@ -991,16 +975,16 @@ TomahawkSettings::recentlyPlayedPlaylistGuids( unsigned int amount ) const
void
TomahawkSettings::appendRecentlyPlayedPlaylist( const Tomahawk::playlist_ptr& playlist )
TomahawkSettings::appendRecentlyPlayedPlaylist( const QString& playlistguid, int sourceId )
{
QStringList playlist_guids = value( "playlists/recentlyPlayed" ).toStringList();
playlist_guids.removeAll( playlist->guid() );
playlist_guids.append( playlist->guid() );
playlist_guids.removeAll( playlistguid );
playlist_guids.append( playlistguid );
setValue( "playlists/recentlyPlayed", playlist_guids );
emit recentlyPlayedPlaylistAdded( playlist );
emit recentlyPlayedPlaylistAdded( playlistguid, sourceId );
}

View File

@@ -1,7 +1,7 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
* Copyright 2010-2011 Leo Franchi <lfranchi@kde.org>
* Copyright 2010-2012 Leo Franchi <lfranchi@kde.org>
* Copyright 2010-2012, Jeff Mitchell <jeff@tomahawk-player.org>
*
* Tomahawk is free software: you can redistribute it and/or modify
@@ -21,14 +21,12 @@
#ifndef TOMAHAWK_SETTINGS_H
#define TOMAHAWK_SETTINGS_H
#include "Playlist.h"
#include "playlist/PlaylistUpdaterInterface.h"
#include "DllMacro.h"
#include "Typedefs.h"
#include <QSettings>
#include <QtNetwork/QNetworkProxy>
#include "DllMacro.h"
#include <QStringList>
#define TOMAHAWK_SETTINGS_VERSION 12
@@ -87,14 +85,13 @@ public:
QByteArray playlistColumnSizes( const QString& playlistid ) const;
void setPlaylistColumnSizes( const QString& playlistid, const QByteArray& state );
QList<Tomahawk::playlist_ptr> recentlyPlayedPlaylists() const;
QStringList recentlyPlayedPlaylistGuids( unsigned int amount = 0 ) const;
void appendRecentlyPlayedPlaylist( const Tomahawk::playlist_ptr& playlist );
void appendRecentlyPlayedPlaylist( const QString& playlistGuid, int sourceId );
bool shuffleState( const QString& playlistid ) const;
void setShuffleState( const QString& playlistid, bool state );
Tomahawk::PlaylistInterface::RepeatMode repeatMode( const QString& playlistid );
void setRepeatMode( const QString& playlistid, Tomahawk::PlaylistInterface::RepeatMode mode );
Tomahawk::PlaylistModes::RepeatMode repeatMode( const QString& playlistid );
void setRepeatMode( const QString& playlistid, Tomahawk::PlaylistModes::RepeatMode mode );
// remove shuffle state and repeat state
void removePlaylistSettings( const QString& playlistid );
@@ -207,7 +204,7 @@ public:
signals:
void changed();
void recentlyPlayedPlaylistAdded( const Tomahawk::playlist_ptr& playlist );
void recentlyPlayedPlaylistAdded( const QString& playlistId, int sourceId );
private slots:
void updateIndex();

View File

@@ -77,6 +77,128 @@ namespace Tomahawk
class ExternalResolver;
typedef boost::function<Tomahawk::ExternalResolver*(QString)> ResolverFactoryFunc;
namespace PlaylistModes {
enum RepeatMode { NoRepeat, RepeatOne, RepeatAll };
enum ViewMode { Unknown, Tree, Flat, Album };
enum SeekRestrictions { NoSeekRestrictions, NoSeek };
enum SkipRestrictions { NoSkipRestrictions, NoSkipForwards, NoSkipBackwards, NoSkip };
enum RetryMode { NoRetry, Retry };
enum LatchMode { StayOnSong, RealTime };
}
struct SerializedUpdater {
QString type;
QVariantHash customData;
SerializedUpdater( const QString& t, const QVariantHash cd = QVariantHash() ) : type( t ), customData( cd ) {}
SerializedUpdater() {}
};
typedef QMultiHash< QString, SerializedUpdater > SerializedUpdaters;
typedef QList< SerializedUpdater > SerializedUpdaterList;
namespace InfoSystem {
enum InfoType { // as items are saved in cache, mark them here to not change them
InfoNoInfo = 0, //WARNING: *ALWAYS* keep this first!
InfoTrackID = 1,
InfoTrackArtist = 2,
InfoTrackAlbum = 3,
InfoTrackGenre = 4,
InfoTrackComposer = 5,
InfoTrackDate = 6,
InfoTrackNumber = 7,
InfoTrackDiscNumber = 8,
InfoTrackBitRate = 9,
InfoTrackLength = 10,
InfoTrackSampleRate = 11,
InfoTrackFileSize = 12,
InfoTrackBPM = 13,
InfoTrackReplayGain = 14,
InfoTrackReplayPeakGain = 15,
InfoTrackLyrics = 16,
InfoTrackLocation = 17,
InfoTrackProfile = 18,
InfoTrackEnergy = 19,
InfoTrackDanceability = 20,
InfoTrackTempo = 21,
InfoTrackLoudness = 22,
InfoTrackSimilars = 23, // cached -- do not change
InfoArtistID = 25,
InfoArtistName = 26,
InfoArtistBiography = 27,
InfoArtistImages = 28, //cached -- do not change
InfoArtistBlog = 29,
InfoArtistFamiliarity = 30,
InfoArtistHotttness = 31,
InfoArtistSongs = 32, //cached -- do not change
InfoArtistSimilars = 33, //cached -- do not change
InfoArtistNews = 34,
InfoArtistProfile = 35,
InfoArtistReviews = 36,
InfoArtistTerms = 37,
InfoArtistLinks = 38,
InfoArtistVideos = 39,
InfoArtistReleases = 40,
InfoAlbumID = 42,
InfoAlbumCoverArt = 43, //cached -- do not change
InfoAlbumName = 44,
InfoAlbumArtist = 45,
InfoAlbumDate = 46,
InfoAlbumGenre = 47,
InfoAlbumComposer = 48,
InfoAlbumSongs = 49,
/** \var Tomahawk::InfoSystem::InfoType Tomahawk::InfoSystem::InfoType::InfoChartCapabilities
* Documentation for InfoChartCapabilities
*
* Clients of this InfoType expect a QVariant
*
*/
InfoChartCapabilities = 50,
/**
* Documentation for InfoChartArtists
*/
InfoChart = 51,
InfoNewReleaseCapabilities = 52,
InfoNewRelease = 53,
InfoMiscTopHotttness = 60,
InfoMiscTopTerms = 61,
InfoSubmitNowPlaying = 70,
InfoSubmitScrobble = 71,
InfoNowPlaying = 80,
InfoNowPaused = 81,
InfoNowResumed = 82,
InfoNowStopped = 83,
InfoTrackUnresolved = 84,
InfoLove = 90,
InfoUnLove = 91,
InfoShareTrack = 92,
InfoNotifyUser = 100,
InfoLastInfo = 101 //WARNING: *ALWAYS* keep this last!
};
class InfoPlugin;
typedef QMap< InfoType, QVariant > InfoTypeMap;
typedef QMap< InfoType, uint > InfoTimeoutMap;
typedef QHash< QString, QString > InfoStringHash;
typedef QPair< QVariantMap, QVariant > PushInfoPair;
typedef QWeakPointer< InfoPlugin > InfoPluginPtr;
}
}; // ns
typedef int AudioErrorCode;

View File

@@ -79,7 +79,7 @@ ViewManager::ViewManager( QObject* parent )
, m_newReleasesWidget( new NewReleasesWidget() )
, m_topLovedWidget( 0 )
, m_recentPlaysWidget( 0 )
, m_currentMode( PlaylistInterface::Tree )
, m_currentMode( PlaylistModes::Tree )
, m_loaded( false )
{
s_instance = this;
@@ -282,7 +282,7 @@ ViewManager::show( const Tomahawk::collection_ptr& collection )
qDebug() << Q_FUNC_INFO << m_currentMode;
m_currentCollection = collection;
ViewPage* shown = 0;
if ( m_currentMode == PlaylistInterface::Flat )
if ( m_currentMode == PlaylistModes::Flat )
{
CollectionView* view;
if ( !m_collectionViews.contains( collection ) || m_collectionViews.value( collection ).isNull() )
@@ -306,7 +306,7 @@ ViewManager::show( const Tomahawk::collection_ptr& collection )
setPage( view );
}
if ( m_currentMode == PlaylistInterface::Tree )
if ( m_currentMode == PlaylistModes::Tree )
{
ArtistView* view;
if ( !m_treeViews.contains( collection ) || m_treeViews.value( collection ).isNull() )
@@ -330,7 +330,7 @@ ViewManager::show( const Tomahawk::collection_ptr& collection )
setPage( view );
}
if ( m_currentMode == PlaylistInterface::Album )
if ( m_currentMode == PlaylistModes::Album )
{
AlbumView* aview;
if ( !m_collectionAlbumViews.contains( collection ) || m_collectionAlbumViews.value( collection ).isNull() )
@@ -407,17 +407,17 @@ ViewManager::showSuperCollection()
m_superAlbumModel->setTitle( tr( "All available albums" ) );
ViewPage* shown = 0;
if ( m_currentMode == PlaylistInterface::Tree )
if ( m_currentMode == PlaylistModes::Tree )
{
shown = m_superCollectionView;
setPage( m_superCollectionView );
}
else if ( m_currentMode == PlaylistInterface::Flat )
else if ( m_currentMode == PlaylistModes::Flat )
{
shown = m_superCollectionView;
setPage( m_superCollectionView );
}
else if ( m_currentMode == PlaylistInterface::Album )
else if ( m_currentMode == PlaylistModes::Album )
{
shown = m_superAlbumView;
setPage( m_superAlbumView );
@@ -435,13 +435,13 @@ ViewManager::playlistInterfaceChanged( Tomahawk::playlistinterface_ptr interface
playlist_ptr pl = playlistForInterface( interface );
if ( !pl.isNull() )
{
TomahawkSettings::instance()->appendRecentlyPlayedPlaylist( pl );
TomahawkSettings::instance()->appendRecentlyPlayedPlaylist( pl->guid(), pl->author()->id() );
}
else
{
pl = dynamicPlaylistForInterface( interface );
if ( !pl.isNull() )
TomahawkSettings::instance()->appendRecentlyPlayedPlaylist( pl );
TomahawkSettings::instance()->appendRecentlyPlayedPlaylist( pl->guid(), pl->author()->id() );
}
}
@@ -516,7 +516,7 @@ ViewManager::setTableMode()
{
qDebug() << Q_FUNC_INFO;
m_currentMode = PlaylistInterface::Flat;
m_currentMode = PlaylistModes::Flat;
if ( isSuperCollectionVisible() )
showSuperCollection();
@@ -530,7 +530,7 @@ ViewManager::setTreeMode()
{
qDebug() << Q_FUNC_INFO;
m_currentMode = PlaylistInterface::Tree;
m_currentMode = PlaylistModes::Tree;
if ( isSuperCollectionVisible() )
showSuperCollection();
@@ -544,7 +544,7 @@ ViewManager::setAlbumMode()
{
qDebug() << Q_FUNC_INFO;
m_currentMode = PlaylistInterface::Album;
m_currentMode = PlaylistModes::Album;
if ( isSuperCollectionVisible() )
showSuperCollection();
@@ -695,8 +695,8 @@ ViewManager::unlinkPlaylist()
disconnect( currentPlaylistInterface().data(), SIGNAL( trackCountChanged( unsigned int ) ),
this, SIGNAL( numShownChanged( unsigned int ) ) );
disconnect( currentPlaylistInterface().data(), SIGNAL( repeatModeChanged( Tomahawk::PlaylistInterface::RepeatMode ) ),
this, SIGNAL( repeatModeChanged( Tomahawk::PlaylistInterface::RepeatMode ) ) );
disconnect( currentPlaylistInterface().data(), SIGNAL( repeatModeChanged( Tomahawk::PlaylistModes::RepeatMode ) ),
this, SIGNAL( repeatModeChanged( Tomahawk::PlaylistModes::RepeatMode ) ) );
disconnect( currentPlaylistInterface().data(), SIGNAL( shuffleModeChanged( bool ) ),
this, SIGNAL( shuffleModeChanged( bool ) ) );
@@ -734,8 +734,8 @@ ViewManager::updateView()
connect( currentPlaylistInterface().data(), SIGNAL( trackCountChanged( unsigned int ) ),
SIGNAL( numShownChanged( unsigned int ) ) );
connect( currentPlaylistInterface().data(), SIGNAL( repeatModeChanged( Tomahawk::PlaylistInterface::RepeatMode ) ),
SIGNAL( repeatModeChanged( Tomahawk::PlaylistInterface::RepeatMode ) ) );
connect( currentPlaylistInterface().data(), SIGNAL( repeatModeChanged( Tomahawk::PlaylistModes::RepeatMode ) ),
SIGNAL( repeatModeChanged( Tomahawk::PlaylistModes::RepeatMode ) ) );
connect( currentPlaylistInterface().data(), SIGNAL( shuffleModeChanged( bool ) ),
SIGNAL( shuffleModeChanged( bool ) ) );
@@ -857,7 +857,7 @@ ViewManager::onWidgetDestroyed( QWidget* widget )
void
ViewManager::setRepeatMode( Tomahawk::PlaylistInterface::RepeatMode mode )
ViewManager::setRepeatMode( Tomahawk::PlaylistModes::RepeatMode mode )
{
if ( currentPlaylistInterface() )
currentPlaylistInterface()->setRepeatMode( mode );
@@ -1027,15 +1027,15 @@ ViewManager::showCurrentTrack()
// reset the correct mode, if the user has changed it since
if ( dynamic_cast< CollectionView* >( page ) )
m_currentMode = PlaylistInterface::Flat;
m_currentMode = PlaylistModes::Flat;
else if ( dynamic_cast< AlbumView* >( page ) )
m_currentMode = PlaylistInterface::Album;
m_currentMode = PlaylistModes::Album;
else if ( dynamic_cast< ArtistView* >( page ) )
m_currentMode = PlaylistInterface::Tree;
m_currentMode = PlaylistModes::Tree;
else
return;
emit modeChanged( (PlaylistInterface::ViewMode)m_currentMode );
emit modeChanged( (PlaylistModes::ViewMode)m_currentMode );
}
}

View File

@@ -119,13 +119,13 @@ signals:
void numArtistsChanged( unsigned int artists );
void numShownChanged( unsigned int shown );
void repeatModeChanged( Tomahawk::PlaylistInterface::RepeatMode mode );
void repeatModeChanged( Tomahawk::PlaylistModes::RepeatMode mode );
void shuffleModeChanged( bool enabled );
void statsAvailable( bool b );
void modesAvailable( bool b );
void filterAvailable( bool b );
void modeChanged( Tomahawk::PlaylistInterface::ViewMode mode );
void modeChanged( Tomahawk::PlaylistModes::ViewMode mode );
void playClicked();
void pauseClicked();
@@ -169,7 +169,7 @@ public slots:
void setTableMode();
void setAlbumMode();
void setRepeatMode( Tomahawk::PlaylistInterface::RepeatMode mode );
void setRepeatMode( Tomahawk::PlaylistModes::RepeatMode mode );
void setShuffled( bool enabled );
void playlistInterfaceChanged( Tomahawk::playlistinterface_ptr );

View File

@@ -19,6 +19,7 @@
#include "ViewPage.h"
#include "utils/Logger.h"
#include "Source.h"
using namespace Tomahawk;

View File

@@ -19,6 +19,8 @@
#include "Account.h"
#include "TomahawkSettings.h"
namespace Tomahawk
{

View File

@@ -26,12 +26,12 @@
#include <QtGui/QIcon>
#include <QtCore/QString>
#include <QtCore/QUuid>
#include <QMutex>
#include "Typedefs.h"
#include "DllMacro.h"
#include "TomahawkSettings.h"
#include "libtomahawk/infosystem/InfoSystem.h"
// #include "libtomahawk/infosystem/InfoSystem.h"
class SipPlugin;

View File

@@ -20,6 +20,7 @@
#include "AccountManager.h"
#include "config.h"
#include "SourceList.h"
#include "TomahawkSettings.h"
#include "ResolverAccount.h"
#include <QtCore/QLibrary>

View File

@@ -23,6 +23,7 @@
#include "AccountManager.h"
#include "AtticaManager.h"
#include "ResolverAccount.h"
#include "TomahawkSettings.h"
#ifndef ENABLE_HEADLESS
#include <QMessageBox>

View File

@@ -24,6 +24,7 @@
#include "Account.h"
#include <QAbstractListModel>
#include <QSet>
namespace Tomahawk {

View File

@@ -21,6 +21,9 @@
#include "ExternalResolver.h"
#include "ExternalResolverGui.h"
#include "AccountManager.h"
#include "TomahawkSettings.h"
#include "Source.h"
#include <Pipeline.h>
#include <QFile>
#include <QFileInfo>

View File

@@ -180,6 +180,7 @@ AudioEngine::stop()
sendWaitingNotification();
Tomahawk::InfoSystem::InfoPushData pushData( s_aeInfoIdentifier, Tomahawk::InfoSystem::InfoNowStopped, QVariant(), Tomahawk::InfoSystem::PushNoFlag );
Tomahawk::InfoSystem::InfoSystem::instance()->pushInfo( pushData );
}
@@ -215,8 +216,8 @@ AudioEngine::canGoNext()
if ( m_playlist.isNull() )
return false;
if ( m_playlist.data()->skipRestrictions() == PlaylistInterface::NoSkip ||
m_playlist.data()->skipRestrictions() == PlaylistInterface::NoSkipForwards )
if ( m_playlist.data()->skipRestrictions() == PlaylistModes::NoSkip ||
m_playlist.data()->skipRestrictions() == PlaylistModes::NoSkipForwards )
return false;
if ( !m_currentTrack.isNull() && !m_playlist->hasNextItem() &&
@@ -238,8 +239,8 @@ AudioEngine::canGoPrevious()
if ( m_playlist.isNull() )
return false;
if ( m_playlist.data()->skipRestrictions() == PlaylistInterface::NoSkip ||
m_playlist.data()->skipRestrictions() == PlaylistInterface::NoSkipBackwards )
if ( m_playlist.data()->skipRestrictions() == PlaylistModes::NoSkip ||
m_playlist.data()->skipRestrictions() == PlaylistModes::NoSkipBackwards )
return false;
return true;
@@ -254,11 +255,10 @@ AudioEngine::canSeek()
if ( m_mediaObject && m_mediaObject->isValid() )
phononCanSeek = m_mediaObject->isSeekable();
*/
if ( m_playlist.isNull() )
return phononCanSeek;
return !m_playlist.isNull() && ( m_playlist.data()->seekRestrictions() != PlaylistInterface::NoSeek ) && phononCanSeek;
return !m_playlist.isNull() && ( m_playlist.data()->seekRestrictions() != PlaylistModes::NoSeek ) && phononCanSeek;
}
@@ -545,7 +545,7 @@ AudioEngine::loadNextTrack()
}
else
{
if ( !m_playlist.isNull() && m_playlist.data()->retryMode() == Tomahawk::PlaylistInterface::Retry )
if ( !m_playlist.isNull() && m_playlist.data()->retryMode() == Tomahawk::PlaylistModes::Retry )
m_waitingOnNewTrack = true;
stop();
@@ -568,7 +568,7 @@ AudioEngine::playItem( Tomahawk::playlistinterface_ptr playlist, const Tomahawk:
{
loadTrack( result );
}
else if ( !m_playlist.isNull() && m_playlist.data()->retryMode() == PlaylistInterface::Retry )
else if ( !m_playlist.isNull() && m_playlist.data()->retryMode() == PlaylistModes::Retry )
{
m_waitingOnNewTrack = true;
if ( isStopped() )
@@ -631,7 +631,7 @@ void
AudioEngine::onPlaylistNextTrackReady()
{
// If in real-time and you have a few seconds left, you're probably lagging -- finish it up
if ( m_playlist && m_playlist->latchMode() == PlaylistInterface::RealTime && ( m_waitingOnNewTrack || m_currentTrack.isNull() || m_currentTrack->id() == 0 || ( currentTrackTotalTime() - currentTime() > 6000 ) ) )
if ( m_playlist && m_playlist->latchMode() == PlaylistModes::RealTime && ( m_waitingOnNewTrack || m_currentTrack.isNull() || m_currentTrack->id() == 0 || ( currentTrackTotalTime() - currentTime() > 6000 ) ) )
{
m_waitingOnNewTrack = false;
loadNextTrack();
@@ -701,7 +701,7 @@ AudioEngine::onStateChanged( Phonon::State newState, Phonon::State oldState )
loadNextTrack();
else
{
if ( !m_playlist.isNull() && m_playlist.data()->retryMode() == Tomahawk::PlaylistInterface::Retry )
if ( !m_playlist.isNull() && m_playlist.data()->retryMode() == Tomahawk::PlaylistModes::Retry )
m_waitingOnNewTrack = true;
stop();
}
@@ -743,7 +743,7 @@ AudioEngine::setPlaylist( Tomahawk::playlistinterface_ptr playlist )
if ( !m_playlist.isNull() )
{
if ( m_playlist.data() && m_playlist.data()->retryMode() == PlaylistInterface::Retry )
if ( m_playlist.data() && m_playlist.data()->retryMode() == PlaylistModes::Retry )
disconnect( m_playlist.data(), SIGNAL( nextTrackReady() ) );
m_playlist.data()->reset();
}
@@ -758,7 +758,7 @@ AudioEngine::setPlaylist( Tomahawk::playlistinterface_ptr playlist )
m_playlist = playlist;
m_stopAfterTrack.clear();
if ( !m_playlist.isNull() && m_playlist.data() && m_playlist.data()->retryMode() == PlaylistInterface::Retry )
if ( !m_playlist.isNull() && m_playlist.data() && m_playlist.data()->retryMode() == PlaylistModes::Retry )
connect( m_playlist.data(), SIGNAL( nextTrackReady() ), SLOT( onPlaylistNextTrackReady() ) );
emit playlistChanged( playlist );

View File

@@ -31,6 +31,7 @@
#include "playlist/ArtistView.h"
#include "playlist/TreeModel.h"
#include "Source.h"
#include "utils/StyleHelper.h"
#include "utils/TomahawkUtilsGui.h"

View File

@@ -23,6 +23,7 @@
#include "playlist/ArtistView.h"
#include "playlist/TreeModel.h"
#include "Source.h"
using namespace Tomahawk;

View File

@@ -22,6 +22,7 @@
#include "playlist/PlaylistModel.h"
#include "playlist/PlaylistView.h"
#include "playlist/TrackHeader.h"
#include "Source.h"
using namespace Tomahawk;

View File

@@ -17,6 +17,7 @@
*/
#include "WebContext.h"
#include "Source.h"
using namespace Tomahawk;

View File

@@ -17,6 +17,7 @@
*/
#include "WikipediaContext.h"
#include "Source.h"
using namespace Tomahawk;

View File

@@ -23,6 +23,7 @@
#include "DatabaseImpl.h"
#include "DatabaseWorker.h"
#include "utils/Logger.h"
#include "Source.h"
#define DEFAULT_WORKER_THREADS 4
#define MAX_WORKER_THREADS 16

View File

@@ -1,6 +1,6 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
* Copyright 2010-2011, Leo Franchi <lfranchi@kde.org>
*
* Tomahawk is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -21,6 +21,7 @@
#include "DatabaseImpl.h"
#include "TomahawkSqlQuery.h"
#include "utils/Logger.h"
#include "Source.h"
DatabaseCommand_AddClientAuth::DatabaseCommand_AddClientAuth( const QString& clientToken,

View File

@@ -22,6 +22,7 @@
#include "DatabaseImpl.h"
#include "utils/Logger.h"
#include "Source.h"
DatabaseCommand_addSource::DatabaseCommand_addSource( const QString& username, const QString& fname, QObject* parent )

View File

@@ -1,6 +1,6 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
* Copyright 2010-2011, Leo Franchi <lfranchi@kde.org>
*
* Tomahawk is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -21,6 +21,7 @@
#include "DatabaseImpl.h"
#include "TomahawkSqlQuery.h"
#include "utils/Logger.h"
#include "Source.h"
DatabaseCommand_ClientAuthValid::DatabaseCommand_ClientAuthValid( const QString& clientToken, QObject* parent )

View File

@@ -23,6 +23,7 @@
#include "DatabaseImpl.h"
#include "utils/Logger.h"
#include "Source.h"
void

View File

@@ -23,6 +23,7 @@
#include "DatabaseImpl.h"
#include "utils/Logger.h"
#include "Source.h"
void

View File

@@ -24,6 +24,7 @@
#include "Source.h"
#include "dynamic/DynamicPlaylist.h"
#include "utils/Logger.h"
#include "Source.h"
using namespace Tomahawk;

View File

@@ -28,6 +28,7 @@
#include "dynamic/GeneratorFactory.h"
#include "qjson/parser.h"
#include "utils/Logger.h"
#include "Source.h"
using namespace Tomahawk;

View File

@@ -21,6 +21,7 @@
#include "DatabaseImpl.h"
#include "Collection.h"
#include "utils/Logger.h"
#include "Source.h"
DatabaseCommand_LoadFiles::DatabaseCommand_LoadFiles( unsigned int id, QObject* parent )

View File

@@ -24,6 +24,7 @@
#include "Query.h"
#include "qjson/parser.h"
#include "utils/Logger.h"
#include "Source.h"
using namespace Tomahawk;

View File

@@ -21,6 +21,7 @@
#include "utils/Logger.h"
#include "Playlist.h"
#include "Source.h"
using namespace Tomahawk;

View File

@@ -19,6 +19,7 @@
#include "DatabaseCommand_SetTrackAttributes.h"
#include "TomahawkSqlQuery.h"
#include "DatabaseImpl.h"
#include "Source.h"
using namespace Tomahawk;

View File

@@ -21,6 +21,7 @@
#include "DatabaseImpl.h"
#include "TomahawkSqlQuery.h"
#include "utils/Logger.h"
#include "Source.h"
DatabaseCommand_SourceOffline::DatabaseCommand_SourceOffline( int id )

View File

@@ -18,6 +18,7 @@
#include "DatabaseCommand_TrackAttributes.h"
#include "DatabaseImpl.h"
#include "Source.h"
using namespace Tomahawk;
DatabaseCommand_TrackAttributes::DatabaseCommand_TrackAttributes( DatabaseCommand_SetTrackAttributes::AttributeType type, const QList< Tomahawk::QID > ids )

View File

@@ -1,6 +1,7 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
* Copyright 2012 Leo Franchi <lfranchi@kde.org>
*
* Tomahawk is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -24,6 +25,7 @@
#include "jobview/IndexingJobItem.h"
#include "jobview/JobStatusView.h"
#include "jobview/JobStatusModel.h"
#include "Source.h"
#include <QSqlRecord>

View File

@@ -22,6 +22,7 @@
#include "network/Servent.h"
#include "database/Database.h"
#include "database/DatabaseCommand_Resolve.h"
#include "Source.h"
#include "utils/Logger.h"

View File

@@ -27,6 +27,7 @@
#include "DatabaseImpl.h"
#include "utils/TomahawkUtils.h"
#include "utils/Logger.h"
#include "Source.h"
using namespace lucene::analysis;
using namespace lucene::analysis::standard;

View File

@@ -26,6 +26,7 @@
#include "InfoSystemWorker.h"
#include "utils/TomahawkUtils.h"
#include "utils/Logger.h"
#include "Source.h"
namespace Tomahawk
{

View File

@@ -34,6 +34,7 @@
#include "DllMacro.h"
#include "utils/TomahawkUtils.h"
#include "Typedefs.h"
class QNetworkAccessManager;
@@ -49,100 +50,6 @@ enum PushInfoFlags { // must be powers of 2
PushShortUrlFlag = 2
};
enum InfoType { // as items are saved in cache, mark them here to not change them
InfoNoInfo = 0, //WARNING: *ALWAYS* keep this first!
InfoTrackID = 1,
InfoTrackArtist = 2,
InfoTrackAlbum = 3,
InfoTrackGenre = 4,
InfoTrackComposer = 5,
InfoTrackDate = 6,
InfoTrackNumber = 7,
InfoTrackDiscNumber = 8,
InfoTrackBitRate = 9,
InfoTrackLength = 10,
InfoTrackSampleRate = 11,
InfoTrackFileSize = 12,
InfoTrackBPM = 13,
InfoTrackReplayGain = 14,
InfoTrackReplayPeakGain = 15,
InfoTrackLyrics = 16,
InfoTrackLocation = 17,
InfoTrackProfile = 18,
InfoTrackEnergy = 19,
InfoTrackDanceability = 20,
InfoTrackTempo = 21,
InfoTrackLoudness = 22,
InfoTrackSimilars = 23, // cached -- do not change
InfoArtistID = 25,
InfoArtistName = 26,
InfoArtistBiography = 27,
InfoArtistImages = 28, //cached -- do not change
InfoArtistBlog = 29,
InfoArtistFamiliarity = 30,
InfoArtistHotttness = 31,
InfoArtistSongs = 32, //cached -- do not change
InfoArtistSimilars = 33, //cached -- do not change
InfoArtistNews = 34,
InfoArtistProfile = 35,
InfoArtistReviews = 36,
InfoArtistTerms = 37,
InfoArtistLinks = 38,
InfoArtistVideos = 39,
InfoArtistReleases = 40,
InfoAlbumID = 42,
InfoAlbumCoverArt = 43, //cached -- do not change
InfoAlbumName = 44,
InfoAlbumArtist = 45,
InfoAlbumDate = 46,
InfoAlbumGenre = 47,
InfoAlbumComposer = 48,
InfoAlbumSongs = 49,
/** \var Tomahawk::InfoSystem::InfoType Tomahawk::InfoSystem::InfoType::InfoChartCapabilities
* Documentation for InfoChartCapabilities
*
* Clients of this InfoType expect a QVariant
*
*/
InfoChartCapabilities = 50,
/**
* Documentation for InfoChartArtists
*/
InfoChart = 51,
InfoNewReleaseCapabilities = 52,
InfoNewRelease = 53,
InfoMiscTopHotttness = 60,
InfoMiscTopTerms = 61,
InfoSubmitNowPlaying = 70,
InfoSubmitScrobble = 71,
InfoNowPlaying = 80,
InfoNowPaused = 81,
InfoNowResumed = 82,
InfoNowStopped = 83,
InfoTrackUnresolved = 84,
InfoLove = 90,
InfoUnLove = 91,
InfoShareTrack = 92,
InfoNotifyUser = 100,
InfoLastInfo = 101 //WARNING: *ALWAYS* keep this last!
};
typedef QMap< InfoType, QVariant > InfoTypeMap;
typedef QMap< InfoType, uint > InfoTimeoutMap;
typedef QHash< QString, QString > InfoStringHash;
typedef QPair< QVariantMap, QVariant > PushInfoPair;
struct InfoRequestData {
quint64 requestId;
@@ -237,8 +144,6 @@ private:
};
typedef QWeakPointer< InfoPlugin > InfoPluginPtr;
class InfoSystemCacheThread : public QThread
{
Q_OBJECT

View File

@@ -19,9 +19,6 @@
#include <QtDebug>
#include <QDir>
#include <QSettings>
#include <QCryptographicHash>
#ifndef ENABLE_HEADLESS
#include <QDesktopServices>
@@ -30,7 +27,11 @@
#include "InfoSystemCache.h"
#include "TomahawkSettings.h"
#include "utils/Logger.h"
#include "Source.h"
#include <QDir>
#include <QSettings>
#include <QCryptographicHash>
namespace Tomahawk
{

View File

@@ -18,6 +18,17 @@
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
*/
#include "InfoSystemWorker.h"
#include "config.h"
#include "HeadlessCheck.h"
#include "InfoSystemCache.h"
#include "GlobalActionManager.h"
#include "utils/TomahawkUtils.h"
#include "utils/Logger.h"
#include "Source.h"
#include <QCoreApplication>
#include <QNetworkConfiguration>
#include <QNetworkProxy>
@@ -25,14 +36,6 @@
#include <QLibrary>
#include <QPluginLoader>
#include "config.h"
#include "HeadlessCheck.h"
#include "InfoSystemWorker.h"
#include "InfoSystemCache.h"
#include "GlobalActionManager.h"
#include "utils/TomahawkUtils.h"
#include "utils/Logger.h"
namespace Tomahawk
{

View File

@@ -21,6 +21,7 @@
#include "JobStatusModel.h"
#include "utils/TomahawkUtils.h"
#include "utils/Logger.h"
#include <QPixmap>
#include <QPainter>

View File

@@ -27,6 +27,7 @@
#include "TransferStatusItem.h"
#include "LatchedStatusItem.h"
#include "utils/Logger.h"
#include "Source.h"
#include <QHeaderView>
#include <QVBoxLayout>

View File

@@ -25,6 +25,7 @@
#include "TomahawkApp.h"
#include "JobStatusModel.h"
#include "JobStatusView.h"
#include "Source.h"
PipelineStatusItem::PipelineStatusItem()

View File

@@ -19,11 +19,12 @@
#include "Connection.h"
#include <QtCore/QTime>
#include <QtCore/QThread>
#include "network/Servent.h"
#include "utils/Logger.h"
#include "Source.h"
#include <QtCore/QTime>
#include <QtCore/QThread>
#define PROTOVER "4" // must match remote peer, or we can't talk.

View File

@@ -19,14 +19,15 @@
#include "PortFwdThread.h"
#include "HeadlessCheck.h"
#include "portfwd/portfwd.h"
#include "utils/Logger.h"
#include "Source.h"
#include <QNetworkInterface>
#include <QStringList>
#include <QTime>
#include <QTimer>
#include "portfwd/portfwd.h"
#include "utils/Logger.h"
PortFwdThread::PortFwdThread( unsigned int port )

View File

@@ -20,6 +20,7 @@
#include "utils/TomahawkUtils.h"
#include "utils/Logger.h"
#include "Source.h"
using namespace Tomahawk;

View File

@@ -27,6 +27,8 @@
#include "Artist.h"
#include "Query.h"
#include "Result.h"
#include "Source.h"
#include "audio/AudioEngine.h"
#include "utils/TomahawkUtils.h"
#include "utils/Logger.h"

View File

@@ -89,7 +89,7 @@ public:
}
public slots:
virtual void setRepeatMode( Tomahawk::PlaylistInterface::RepeatMode /*mode*/ ) {}
virtual void setRepeatMode( Tomahawk::PlaylistModes::RepeatMode /*mode*/ ) {}
virtual void setShuffled( bool /*shuffled*/ ) {}
void addAlbums( const QList<Tomahawk::album_ptr>& albums );
@@ -97,7 +97,7 @@ public slots:
void addQueries( const QList<Tomahawk::query_ptr>& queries );
signals:
void repeatModeChanged( Tomahawk::PlaylistInterface::RepeatMode mode );
void repeatModeChanged( Tomahawk::PlaylistModes::RepeatMode mode );
void shuffleModeChanged( bool enabled );
void itemCountChanged( unsigned int items );

View File

@@ -25,6 +25,7 @@
#include "Artist.h"
#include "AlbumItem.h"
#include "Query.h"
#include "Source.h"
#include "utils/Logger.h"

View File

@@ -23,6 +23,7 @@
#include "Artist.h"
#include "AlbumItem.h"
#include "Query.h"
#include "Source.h"
#include "utils/Logger.h"
using namespace Tomahawk;
@@ -30,7 +31,7 @@ using namespace Tomahawk;
AlbumProxyModelPlaylistInterface::AlbumProxyModelPlaylistInterface( AlbumProxyModel *proxyModel )
: Tomahawk::PlaylistInterface()
, m_proxyModel( proxyModel )
, m_repeatMode( PlaylistInterface::NoRepeat )
, m_repeatMode( PlaylistModes::NoRepeat )
, m_shuffled( false )
{
}

View File

@@ -50,12 +50,12 @@ public:
virtual QString filter() const;
virtual void setFilter( const QString& pattern );
virtual Tomahawk::PlaylistInterface::RepeatMode repeatMode() const { return m_repeatMode; }
virtual Tomahawk::PlaylistModes::RepeatMode repeatMode() const { return m_repeatMode; }
virtual bool shuffled() const { return m_shuffled; }
virtual Tomahawk::PlaylistInterface::ViewMode viewMode() const { return Tomahawk::PlaylistInterface::Album; }
virtual Tomahawk::PlaylistModes::ViewMode viewMode() const { return Tomahawk::PlaylistModes::Album; }
signals:
void repeatModeChanged( Tomahawk::PlaylistInterface::RepeatMode mode );
void repeatModeChanged( Tomahawk::PlaylistModes::RepeatMode mode );
void shuffleModeChanged( bool enabled );
void trackCountChanged( unsigned int tracks );
@@ -64,12 +64,12 @@ signals:
void nextTrackReady();
public slots:
virtual void setRepeatMode( Tomahawk::PlaylistInterface::RepeatMode mode ) { m_repeatMode = mode; emit repeatModeChanged( mode ); }
virtual void setRepeatMode( Tomahawk::PlaylistModes::RepeatMode mode ) { m_repeatMode = mode; emit repeatModeChanged( mode ); }
virtual void setShuffled( bool enabled ) { m_shuffled = enabled; emit shuffleModeChanged( enabled ); }
private:
QWeakPointer< AlbumProxyModel > m_proxyModel;
RepeatMode m_repeatMode;
PlaylistModes::RepeatMode m_repeatMode;
bool m_shuffled;
};

View File

@@ -51,7 +51,7 @@ public:
void addFilteredCollection( const Tomahawk::collection_ptr& collection, unsigned int amount, DatabaseCommand_AllTracks::SortOrder order );
signals:
void repeatModeChanged( Tomahawk::PlaylistInterface::RepeatMode mode );
void repeatModeChanged( Tomahawk::PlaylistModes::RepeatMode mode );
void shuffleModeChanged( bool enabled );
void loadingStarted();

View File

@@ -26,6 +26,7 @@
#include "Album.h"
#include "Query.h"
#include "utils/Logger.h"
#include "Source.h"
CollectionProxyModel::CollectionProxyModel( QObject* parent )

Some files were not shown because too many files have changed in this diff Show More