mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-07 14:46:33 +02:00
various fixes, loads playlists now
This commit is contained in:
@@ -69,9 +69,8 @@ public slots:
|
|||||||
virtual void removeTracks( const QList<QVariant> &olditems ) = 0;
|
virtual void removeTracks( const QList<QVariant> &olditems ) = 0;
|
||||||
|
|
||||||
void setPlaylists( const QList<Tomahawk::playlist_ptr>& plists );
|
void setPlaylists( const QList<Tomahawk::playlist_ptr>& plists );
|
||||||
|
void setDynamicPlaylists( const QList< Tomahawk::dynplaylist_ptr >& dynplists );
|
||||||
void setTracks( const QList<Tomahawk::query_ptr>& tracks, Tomahawk::collection_ptr collection );
|
void setTracks( const QList<Tomahawk::query_ptr>& tracks, Tomahawk::collection_ptr collection );
|
||||||
|
|
||||||
void setDynamicPlaylistS( const QList< Tomahawk::dynplaylist_ptr >& dynplists );
|
|
||||||
protected:
|
protected:
|
||||||
QString m_name;
|
QString m_name;
|
||||||
unsigned int m_lastmodified; // unix time of last change to collection
|
unsigned int m_lastmodified; // unix time of last change to collection
|
||||||
|
@@ -131,7 +131,7 @@ Collection::setPlaylists( const QList<Tomahawk::playlist_ptr>& plists )
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Collection::setDynamicPlaylistS( const QList< Tomahawk::dynplaylist_ptr >& plists )
|
Collection::setDynamicPlaylists( const QList< Tomahawk::dynplaylist_ptr >& plists )
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << plists.count();
|
qDebug() << Q_FUNC_INFO << plists.count();
|
||||||
|
|
||||||
|
@@ -27,7 +27,7 @@ void DatabaseCommand_LoadAllDynamicPlaylists::exec( DatabaseImpl* dbi )
|
|||||||
{
|
{
|
||||||
TomahawkSqlQuery query = dbi->newquery();
|
TomahawkSqlQuery query = dbi->newquery();
|
||||||
|
|
||||||
query.exec( QString( "SELECT playlist.guid as guid, title, info, creator, lastmodified, shared, currentrevision, dynamic_playlist.pltype "
|
query.exec( QString( "SELECT playlist.guid as guid, title, info, creator, lastmodified, shared, currentrevision, dynamic_playlist.pltype, dynamic_playlist.plmode "
|
||||||
"FROM playlist, dynamic_playlist WHERE source %1 AND dynplaylist AND playlist.guid = dynamic_playlist.guid" )
|
"FROM playlist, dynamic_playlist WHERE source %1 AND dynplaylist AND playlist.guid = dynamic_playlist.guid" )
|
||||||
.arg( source()->isLocal() ? "IS NULL" :
|
.arg( source()->isLocal() ? "IS NULL" :
|
||||||
QString( "=%1" ).arg( source()->id() )
|
QString( "=%1" ).arg( source()->id() )
|
||||||
@@ -42,6 +42,7 @@ void DatabaseCommand_LoadAllDynamicPlaylists::exec( DatabaseImpl* dbi )
|
|||||||
query.value(2).toString(), //info
|
query.value(2).toString(), //info
|
||||||
query.value(3).toString(), //creator
|
query.value(3).toString(), //creator
|
||||||
query.value(7).toString(), // dynamic type
|
query.value(7).toString(), // dynamic type
|
||||||
|
static_cast<GeneratorMode>(query.value(7).toInt()), // dynamic mode
|
||||||
query.value(5).toBool(), //shared
|
query.value(5).toBool(), //shared
|
||||||
query.value(4).toInt(), //lastmod
|
query.value(4).toInt(), //lastmod
|
||||||
query.value(0).toString() //GUID
|
query.value(0).toString() //GUID
|
||||||
|
@@ -21,10 +21,10 @@ DatabaseCommand_LoadDynamicPlaylist::exec( DatabaseImpl* dbi )
|
|||||||
// now load the controls etc
|
// now load the controls etc
|
||||||
|
|
||||||
TomahawkSqlQuery controlsQuery = dbi->newquery();
|
TomahawkSqlQuery controlsQuery = dbi->newquery();
|
||||||
controlsQuery.prepare("SELECT controls, plmode, pltype"
|
controlsQuery.prepare("SELECT controls, plmode, pltype "
|
||||||
"FROM dynamic_playlist_revision "
|
"FROM dynamic_playlist_revision "
|
||||||
"WHERE guid = :guid");
|
"WHERE guid = ?");
|
||||||
controlsQuery.bindValue( ":guid", guid() );
|
controlsQuery.addBindValue( guid() );
|
||||||
controlsQuery.exec();
|
controlsQuery.exec();
|
||||||
|
|
||||||
QList< dyncontrol_ptr > controls;
|
QList< dyncontrol_ptr > controls;
|
||||||
|
@@ -45,6 +45,7 @@ DynamicPlaylist::DynamicPlaylist ( const Tomahawk::source_ptr& src,
|
|||||||
const QString& info,
|
const QString& info,
|
||||||
const QString& creator,
|
const QString& creator,
|
||||||
const QString& type,
|
const QString& type,
|
||||||
|
GeneratorMode mode,
|
||||||
bool shared,
|
bool shared,
|
||||||
int lastmod,
|
int lastmod,
|
||||||
const QString& guid )
|
const QString& guid )
|
||||||
@@ -53,6 +54,7 @@ DynamicPlaylist::DynamicPlaylist ( const Tomahawk::source_ptr& src,
|
|||||||
qDebug() << "Creating Dynamic Playlist 1";
|
qDebug() << "Creating Dynamic Playlist 1";
|
||||||
// TODO instantiate generator
|
// TODO instantiate generator
|
||||||
m_generator = geninterface_ptr( GeneratorFactory::create( type ) );
|
m_generator = geninterface_ptr( GeneratorFactory::create( type ) );
|
||||||
|
m_generator->setMode( mode );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -135,6 +135,7 @@ private:
|
|||||||
const QString& info,
|
const QString& info,
|
||||||
const QString& creator,
|
const QString& creator,
|
||||||
const QString& type,
|
const QString& type,
|
||||||
|
GeneratorMode mode,
|
||||||
bool shared,
|
bool shared,
|
||||||
int lastmod,
|
int lastmod,
|
||||||
const QString& guid = "" ); // populate db
|
const QString& guid = "" ); // populate db
|
||||||
@@ -149,7 +150,6 @@ private:
|
|||||||
bool shared );
|
bool shared );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(DynamicPlaylist)
|
|
||||||
geninterface_ptr m_generator;
|
geninterface_ptr m_generator;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -135,7 +135,9 @@ TomahawkApp::TomahawkApp( int& argc, char *argv[] )
|
|||||||
m_settings = new TomahawkSettings( this );
|
m_settings = new TomahawkSettings( this );
|
||||||
m_audioEngine = new AudioEngine;
|
m_audioEngine = new AudioEngine;
|
||||||
setupDatabase();
|
setupDatabase();
|
||||||
|
|
||||||
|
GeneratorFactory::registerFactory( "echonest", new EchonestFactory );
|
||||||
|
|
||||||
#ifndef NO_LIBLASTFM
|
#ifndef NO_LIBLASTFM
|
||||||
m_scrobbler = new Scrobbler( this );
|
m_scrobbler = new Scrobbler( this );
|
||||||
m_nam = new lastfm::NetworkAccessManager( this );
|
m_nam = new lastfm::NetworkAccessManager( this );
|
||||||
@@ -217,8 +219,6 @@ TomahawkApp::TomahawkApp( int& argc, char *argv[] )
|
|||||||
m_mainwindow->showSettingsDialog();
|
m_mainwindow->showSettingsDialog();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
GeneratorFactory::registerFactory( "echonest", new EchonestFactory );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -288,6 +288,7 @@ TomahawkApp::registerMetaTypes()
|
|||||||
qRegisterMetaType< Tomahawk::result_ptr >("Tomahawk::result_ptr");
|
qRegisterMetaType< Tomahawk::result_ptr >("Tomahawk::result_ptr");
|
||||||
qRegisterMetaType< Tomahawk::source_ptr >("Tomahawk::source_ptr");
|
qRegisterMetaType< Tomahawk::source_ptr >("Tomahawk::source_ptr");
|
||||||
qRegisterMetaType< QList<Tomahawk::playlist_ptr> >("QList<Tomahawk::playlist_ptr>");
|
qRegisterMetaType< QList<Tomahawk::playlist_ptr> >("QList<Tomahawk::playlist_ptr>");
|
||||||
|
qRegisterMetaType< QList<Tomahawk::dynplaylist_ptr> >("QList<Tomahawk::dynplaylist_ptr>");
|
||||||
qRegisterMetaType< QList<Tomahawk::plentry_ptr> >("QList<Tomahawk::plentry_ptr>");
|
qRegisterMetaType< QList<Tomahawk::plentry_ptr> >("QList<Tomahawk::plentry_ptr>");
|
||||||
qRegisterMetaType< QList<Tomahawk::query_ptr> >("QList<Tomahawk::query_ptr>");
|
qRegisterMetaType< QList<Tomahawk::query_ptr> >("QList<Tomahawk::query_ptr>");
|
||||||
qRegisterMetaType< QList<Tomahawk::result_ptr> >("QList<Tomahawk::result_ptr>");
|
qRegisterMetaType< QList<Tomahawk::result_ptr> >("QList<Tomahawk::result_ptr>");
|
||||||
@@ -295,6 +296,7 @@ TomahawkApp::registerMetaTypes()
|
|||||||
qRegisterMetaType< QList<Tomahawk::album_ptr> >("QList<Tomahawk::album_ptr>");
|
qRegisterMetaType< QList<Tomahawk::album_ptr> >("QList<Tomahawk::album_ptr>");
|
||||||
qRegisterMetaType< QMap< QString, Tomahawk::plentry_ptr > >("QMap< QString, Tomahawk::plentry_ptr >");
|
qRegisterMetaType< QMap< QString, Tomahawk::plentry_ptr > >("QMap< QString, Tomahawk::plentry_ptr >");
|
||||||
qRegisterMetaType< Tomahawk::PlaylistRevision >("Tomahawk::PlaylistRevision");
|
qRegisterMetaType< Tomahawk::PlaylistRevision >("Tomahawk::PlaylistRevision");
|
||||||
|
qRegisterMetaType< Tomahawk::DynamicPlaylistRevision >("Tomahawk::DynamicPlaylistRevision");
|
||||||
qRegisterMetaType< Tomahawk::QID >("Tomahawk::QID");
|
qRegisterMetaType< Tomahawk::QID >("Tomahawk::QID");
|
||||||
|
|
||||||
qRegisterMetaType< AudioErrorCode >("AudioErrorCode");
|
qRegisterMetaType< AudioErrorCode >("AudioErrorCode");
|
||||||
|
Reference in New Issue
Block a user