[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: extragear/multimedia/amarok/src/servicebrowser/jamendo
From: Nikolaj Hald Nielsen <nhnFreespirit () gmail ! com>
Date: 2007-05-30 19:19:06
Message-ID: 1180552746.782874.27243.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 669912 by nhnielsen:
Flesh out the JamendoMeta types a bit more. Jamendo service is still using the basic \
ServiceMetaBase types
M +86 -18 JamendoMeta.cpp
M +28 -22 JamendoMeta.h
--- trunk/extragear/multimedia/amarok/src/servicebrowser/jamendo/JamendoMeta.cpp \
#669911:669912 @@ -22,6 +22,83 @@
#include "JamendoMeta.h"
+JamendoMetaFactory::JamendoMetaFactory(const QString & dbPrefix)
+ : ServiceMetaFactory( dbPrefix )
+{
+}
+
+TrackPtr JamendoMetaFactory::createTrack(const QStringList & rows)
+{
+ return TrackPtr( new JamendoTrack( rows ) );
+}
+
+int JamendoMetaFactory::getAlbumSqlRowCount()
+{
+ return ServiceMetaFactory::getAlbumSqlRowCount() + 4;
+}
+
+QString JamendoMetaFactory::getAlbumSqlRows()
+{
+ QString sqlRows = ServiceMetaFactory::getAlbumSqlRows();
+
+ sqlRows += ", ";
+ sqlRows += tablePrefix() + "_albums.popularity, ";
+ sqlRows += tablePrefix() + "_albums.cover_url, ";
+ sqlRows += tablePrefix() + "_albums.launch_date, ";
+ sqlRows += tablePrefix() + "_albums.genre ";
+
+ return sqlRows;
+}
+
+AlbumPtr JamendoMetaFactory::createAlbum(const QStringList & rows)
+{
+ return AlbumPtr( new JamendoAlbum( rows ) );
+}
+
+int JamendoMetaFactory::getArtistSqlRowCount()
+{
+ return ServiceMetaFactory::getArtistSqlRowCount() + 4;
+}
+
+QString JamendoMetaFactory::getArtistSqlRows()
+{
+ QString sqlRows = ServiceMetaFactory::getArtistSqlRows();
+
+ sqlRows += ", ";
+ sqlRows += tablePrefix() + "_artists.country, ";
+ sqlRows += tablePrefix() + "_artists.photo_url, ";
+ sqlRows += tablePrefix() + "_artists.jamendo_url, ";
+ sqlRows += tablePrefix() + "_artists.home_url ";
+
+ return sqlRows;
+}
+
+ArtistPtr JamendoMetaFactory::createArtist(const QStringList & rows)
+{
+ return ArtistPtr( new JamendoArtist( rows ) );
+}
+
+
+GenrePtr JamendoMetaFactory::createGenre(const QStringList & rows)
+{
+ return GenrePtr( new JamendoGenre( rows ) );
+}
+
+
+//// JamendoTrack ////
+
+JamendoTrack::JamendoTrack( const QString &name )
+ : ServiceTrack( name )
+{
+}
+
+JamendoTrack::JamendoTrack(const QStringList & resultRow)
+ : ServiceTrack( resultRow )
+{
+}
+
+
+
//// JamendoArtist ////
JamendoArtist::JamendoArtist( const QString &name )
@@ -40,7 +117,7 @@
m_photoURL = photoURL;
}
-QString JamendoArtist::getPhotoURL( ) const
+QString JamendoArtist::photoURL( ) const
{
return m_photoURL;
}
@@ -102,16 +179,6 @@
return m_launchDate;
}
-void JamendoAlbum::setJamendoTags(const QStringList & tags)
-{
- m_tags = tags;
-}
-
-QStringList JamendoAlbum::getJamendoTags() const
-{
- return m_tags;
-}
-
void JamendoAlbum::setGenre( const QString&genre )
{
m_genre = genre;
@@ -122,19 +189,20 @@
return m_genre;
}
-
-//// JamendoTrack ////
-
-JamendoTrack::JamendoTrack( const QString &name )
- : ServiceTrack( name )
+JamendoGenre::JamendoGenre(const QString & name)
+ : ServiceGenre( name )
{
}
-JamendoTrack::JamendoTrack(const QStringList & resultRow)
- : ServiceTrack( resultRow )
+JamendoGenre::JamendoGenre(const QStringList & resultRow)
+ : ServiceGenre( resultRow )
{
}
+
+
+
+
--- trunk/extragear/multimedia/amarok/src/servicebrowser/jamendo/JamendoMeta.h \
#669911:669912 @@ -29,17 +29,15 @@
#include <QList>
-class JamendoMetaFactory
+class JamendoMetaFactory : public ServiceMetaFactory
{
public:
- ServiceMetaFactory( const QString &dbPrefix );
- virtual ~ServiceMetaFactory() {};
+ JamendoMetaFactory( const QString &dbPrefix );
+ virtual ~JamendoMetaFactory() {};
- QString tablePrefix();
-
- virtual int getTrackSqlRowCount();
- virtual QString getTrackSqlRows();
+ //virtual int getTrackSqlRowCount();
+ //virtual QString getTrackSqlRows();
virtual TrackPtr createTrack( const QStringList &rows );
virtual int getAlbumSqlRowCount();
@@ -50,14 +48,26 @@
virtual QString getArtistSqlRows();
virtual ArtistPtr createArtist( const QStringList &rows );
- virtual int getGenreSqlRowCount();
- virtual QString getGenreSqlRows();
+ //virtual int getGenreSqlRowCount();
+ //virtual QString getGenreSqlRows();
virtual GenrePtr createGenre( const QStringList &rows );
};
+
+class JamendoTrack : public ServiceTrack
+{
+
+
+public:
+ JamendoTrack( const QString &name );
+ JamendoTrack( const QStringList &resultRow );
+
+};
+
+
class JamendoArtist : public ServiceArtist
{
@@ -73,7 +83,10 @@
JamendoArtist( const QStringList &resultRow );
void setPhotoURL( const QString &photoURL );
- QString getPhotoURL() const;
+ QString photoURL() const;
+
+ void setCountry( const QString &photoURL );
+ QString country() const;
void setHomeURL( const QString &homeURL );
QString homeURL() const;
@@ -90,9 +103,8 @@
QString m_coverURL;
QDate m_launchDate;
QString m_genre;
- QString m_jamendoTags;
- QStringList m_tags;
+
public:
JamendoAlbum( const QString &name );
JamendoAlbum( const QStringList &resultRow );
@@ -106,27 +118,21 @@
void setLaunchDate( const QDate &launchDate );
QDate getLaunchDate() const;
- void setJamendoTags( const QStringList &tags );
- QStringList getJamendoTags() const;
-
void setGenre( const QString &genre );
QString getGenre() const;
};
-class JamendoTrack : public ServiceTrack
+class JamendoGenre : public ServiceGenre
{
-
public:
- JamendoTrack( const QString &name );
- JamendoTrack( const QStringList &resultRow );
+ JamendoGenre( const QString &name );
+ JamendoGenre( const QStringList &resultRow );
};
-//typedef QList<JamendoArtist> JamendoArtistList;
-//typedef QList<JamendoAlbum> JamendoAlbumList;
-//typedef QList<JamendoTrack> JamendoTrackList;
+
#endif
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic