Artist.h | Artist.h | |||
---|---|---|---|---|
skipping to change at line 35 | skipping to change at line 35 | |||
#include "Config.h" | #include "Config.h" | |||
#include "ArtistTypes.h" | #include "ArtistTypes.h" | |||
#include "Song.h" | #include "Song.h" | |||
class QNetworkReply; | class QNetworkReply; | |||
class ArtistData; | class ArtistData; | |||
class Term; | class Term; | |||
namespace Echonest{ | namespace Echonest{ | |||
class Biography; | class Biography; | |||
class Catalog; | ||||
class Artist; | class Artist; | |||
typedef QVector< Artist > Artists; | typedef QVector< Artist > Artists; | |||
/** | /** | |||
* This encapsulates an Echo Nest artist---it always holds the basic in fo of artist id and | * This encapsulates an Echo Nest artist---it always holds the basic in fo of artist id and | |||
* artist name, and can be queried for more data. | * artist name, and can be queried for more data. | |||
* | * | |||
* It is also possible to fetch more information from a given artist na me or ID by creating an Artist | * It is also possible to fetch more information from a given artist na me or ID by creating an Artist | |||
* object yourself and calling the fetch() functions directly. | * object yourself and calling the fetch() functions directly. | |||
skipping to change at line 114 | skipping to change at line 115 | |||
}; | }; | |||
typedef QPair< Echonest::Artist::SearchParam, QVariant > SearchPara mEntry; | typedef QPair< Echonest::Artist::SearchParam, QVariant > SearchPara mEntry; | |||
typedef QVector< SearchParamEntry > SearchParams; | typedef QVector< SearchParamEntry > SearchParams; | |||
Artist(); | Artist(); | |||
Artist( const QByteArray& id, const QString& name ); | Artist( const QByteArray& id, const QString& name ); | |||
explicit Artist( const QString& name ); | explicit Artist( const QString& name ); | |||
Artist( const Artist& other ); | Artist( const Artist& other ); | |||
Artist& operator=( const Artist& artist ); | Artist& operator=( const Artist& artist ); | |||
~Artist(); | virtual ~Artist(); | |||
void init(); | ||||
QByteArray id() const; | QByteArray id() const; | |||
void setId( const QByteArray& id ); | void setId( const QByteArray& id ); | |||
QString name() const; | QString name() const; | |||
void setName( const QString& name ); | void setName( const QString& name ); | |||
/** | /** | |||
* The following require fetching from The Echo Nest, so return a Q NetworkReply* | * The following require fetching from The Echo Nest, so return a Q NetworkReply* | |||
* that is ready for parsing when the finished() signal is emitted . | * that is ready for parsing when the finished() signal is emitted . | |||
skipping to change at line 364 | skipping to change at line 367 | |||
*/ | */ | |||
static TermList parseTopTerms( QNetworkReply* ) throw( ParseError ) ; | static TermList parseTopTerms( QNetworkReply* ) throw( ParseError ) ; | |||
private: | private: | |||
QUrl setupQuery( const QByteArray& methodName, int numResults = 0, int start = -1 ) const; | QUrl setupQuery( const QByteArray& methodName, int numResults = 0, int start = -1 ) const; | |||
static QByteArray searchParamToString( SearchParam param ); | static QByteArray searchParamToString( SearchParam param ); | |||
static void addQueryInformation( QUrl& url, ArtistInformation parts ); | static void addQueryInformation( QUrl& url, ArtistInformation parts ); | |||
QSharedDataPointer<ArtistData> d; | QSharedDataPointer<ArtistData> d; | |||
friend class Catalog; | ||||
}; | }; | |||
ECHONEST_EXPORT QDebug operator<<(QDebug d, const Echonest::Artist& art ist); | ECHONEST_EXPORT QDebug operator<<(QDebug d, const Echonest::Artist& art ist); | |||
Q_DECLARE_OPERATORS_FOR_FLAGS(Artist::ArtistInformation) | Q_DECLARE_OPERATORS_FOR_FLAGS(Artist::ArtistInformation) | |||
} // namespace | } // namespace | |||
Q_DECLARE_METATYPE(Echonest::Artist) | ||||
#endif | #endif | |||
End of changes. 4 change blocks. | ||||
1 lines changed or deleted | 9 lines changed or added | |||
Playlist.h | Playlist.h | |||
---|---|---|---|---|
skipping to change at line 141 | skipping to change at line 141 | |||
Sort, /// SortingType enum, the type of sorting to use, | Sort, /// SortingType enum, the type of sorting to use, | |||
Limit, /// true, false if true songs will be limited to thos e that appear in the catalog specified by the id: bucket | Limit, /// true, false if true songs will be limited to thos e that appear in the catalog specified by the id: bucket | |||
Audio, /// true, false, if true songs will be limited to those that have associated audio | Audio, /// true, false, if true songs will be limited to those that have associated audio | |||
DMCA /// true, false Only valid for dynamic playlists. Sets if playlist will follow DMCA rules (see web api doc for details) | DMCA /// true, false Only valid for dynamic playlists. Sets if playlist will follow DMCA rules (see web api doc for details) | |||
}; | }; | |||
typedef QPair< PlaylistParam, QVariant > PlaylistParamData; | typedef QPair< PlaylistParam, QVariant > PlaylistParamData; | |||
typedef QVector< PlaylistParamData > PlaylistParams; | typedef QVector< PlaylistParamData > PlaylistParams; | |||
DynamicPlaylist(); | DynamicPlaylist(); | |||
~DynamicPlaylist(); | virtual ~DynamicPlaylist(); | |||
DynamicPlaylist( const DynamicPlaylist& other ); | DynamicPlaylist( const DynamicPlaylist& other ); | |||
DynamicPlaylist& operator=( const DynamicPlaylist& playlist ); | DynamicPlaylist& operator=( const DynamicPlaylist& playlist ); | |||
/** | /** | |||
* Start a dynamic playlist with the given parameters. | * Start a dynamic playlist with the given parameters. | |||
* Once the QNetworkReply has finished, pass it to parseStart() | * Once the QNetworkReply has finished, pass it to parseStart() | |||
* and the inital song will be populated and returned. The session Id(), currentSong(), | * and the inital song will be populated and returned. The session Id(), currentSong(), | |||
* and fetchNextSong() methods will then be useful. | * and fetchNextSong() methods will then be useful. | |||
*/ | */ | |||
QNetworkReply* start( const PlaylistParams& params ); | QNetworkReply* start( const PlaylistParams& params ); | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
Song.h | Song.h | |||
---|---|---|---|---|
skipping to change at line 32 | skipping to change at line 32 | |||
#include <QSharedData> | #include <QSharedData> | |||
#include <QHash> | #include <QHash> | |||
#include <QVariant> | #include <QVariant> | |||
#include <QDebug> | #include <QDebug> | |||
#include <QVector> | #include <QVector> | |||
#include "Config.h" | #include "Config.h" | |||
class QNetworkReply; | class QNetworkReply; | |||
class SongData; | class SongData; | |||
namespace Echonest{ | namespace Echonest{ | |||
class DynamicPlaylist; // forward declare for friend declaration | class DynamicPlaylist; // forward declare for friend declaration | |||
class AudioSummary; | class Catalog; | |||
class AudioSummary; | ||||
/** | /** | |||
* This encapsulates an Echo Nest song---use it if you wish to get informat ion about a song, | * This encapsulates an Echo Nest song---use it if you wish to get informat ion about a song, | |||
* search for a song, etc. | * search for a song, etc. | |||
* | * | |||
* This class is implicitly shared. | * This class is implicitly shared. | |||
*/ | */ | |||
class ECHONEST_EXPORT Song | class ECHONEST_EXPORT Song | |||
{ | { | |||
public: | public: | |||
enum SongInformationFlag { | enum SongInformationFlag { | |||
AudioSummaryInformation = 0x01, | AudioSummaryInformation = 0x01, | |||
Tracks = 0x02, | Tracks = 0x02, | |||
Hotttnesss = 0x04, | Hotttnesss = 0x04, | |||
ArtistHotttnesss = 0x08, | ArtistHotttnesss = 0x08, | |||
ArtistFamiliarity = 0x10, | ArtistFamiliarity = 0x10, | |||
ArtistLocation = 0x20 | ArtistLocation = 0x20, | |||
NoInformation = 0x40 | ||||
}; | }; | |||
Q_DECLARE_FLAGS( SongInformation, SongInformationFlag ) | Q_DECLARE_FLAGS( SongInformation, SongInformationFlag ) | |||
enum SearchParam { | enum SearchParam { | |||
Title, | Title, | |||
Artist, | Artist, | |||
Combined, | Combined, | |||
Description, | Description, | |||
ArtistId, | ArtistId, | |||
Results, | Results, | |||
skipping to change at line 93 | skipping to change at line 97 | |||
Key, | Key, | |||
Sort | Sort | |||
}; | }; | |||
typedef QPair< Echonest::Song::SearchParam, QVariant > SearchParamData; | typedef QPair< Echonest::Song::SearchParam, QVariant > SearchParamData; | |||
typedef QVector< SearchParamData > SearchParams; | typedef QVector< SearchParamData > SearchParams; | |||
Song(); | Song(); | |||
Song( const QByteArray& id, const QString& title, const QByteArray& artis tId, const QString& artistName ); | Song( const QByteArray& id, const QString& title, const QByteArray& artis tId, const QString& artistName ); | |||
Song( const Song& other ); | Song( const Song& other ); | |||
Song& operator=(const Song& song); | Song& operator=(const Song& song); | |||
~Song(); | virtual ~Song(); | |||
/** | /** | |||
* The following pieces of data are present in all Song objects, and do n ot require | * The following pieces of data are present in all Song objects, and do n ot require | |||
* on-demand fetching. | * on-demand fetching. | |||
*/ | */ | |||
QByteArray id() const; | QByteArray id() const; | |||
void setId( const QByteArray& id ); | void setId( const QByteArray& id ); | |||
QString title() const; | QString title() const; | |||
void setTitle( const QString& title ); | void setTitle( const QString& title ); | |||
skipping to change at line 197 | skipping to change at line 201 | |||
/** | /** | |||
* Identify a song from a given Echo Nest fingerprint hash code | * Identify a song from a given Echo Nest fingerprint hash code | |||
* | * | |||
* TODO | * TODO | |||
* static QNetworkReply* identify( ) const; | * static QNetworkReply* identify( ) const; | |||
*/ | */ | |||
QString toString() const; | QString toString() const; | |||
friend class DynamicPlaylist; | friend class DynamicPlaylist; | |||
friend class Catalog; // for access to searchParamToString | ||||
private: | private: | |||
static QByteArray searchParamToString( SearchParam param ); | static QByteArray searchParamToString( SearchParam param ); | |||
static void addQueryInformation( QUrl& url, SongInformation parts ); | static void addQueryInformation( QUrl& url, SongInformation parts ); | |||
QSharedDataPointer<SongData> d; | QSharedDataPointer<SongData> d; | |||
}; | }; | |||
typedef QVector< Song > SongList; | typedef QVector< Song > SongList; | |||
ECHONEST_EXPORT QDebug operator<<(QDebug d, const Song &song); | ECHONEST_EXPORT QDebug operator<<(QDebug d, const Song &song); | |||
End of changes. 5 change blocks. | ||||
4 lines changed or deleted | 9 lines changed or added | |||
Util.h | Util.h | |||
---|---|---|---|---|
skipping to change at line 39 | skipping to change at line 39 | |||
namespace Analysis | namespace Analysis | |||
{ | { | |||
enum AnalysisStatus { | enum AnalysisStatus { | |||
Unknown = 0, | Unknown = 0, | |||
Pending = 1, | Pending = 1, | |||
Complete = 2, | Complete = 2, | |||
Error = 4 | Error = 4 | |||
}; | }; | |||
} | } | |||
namespace CatalogTypes | ||||
{ | ||||
enum Type { | ||||
Artist = 0, | ||||
Song = 1 | ||||
}; | ||||
enum Action { | ||||
Delete, | ||||
Update, | ||||
Play, | ||||
Skip | ||||
}; | ||||
enum TicketStatus { | ||||
Unknown = 0, | ||||
Pending = 1, | ||||
Complete = 2, | ||||
Error = 4 | ||||
}; | ||||
} | ||||
typedef struct | typedef struct | |||
{ | { | |||
qreal confidence; | qreal confidence; | |||
qreal duration; | qreal duration; | |||
qreal start; | qreal start; | |||
} AudioChunk; | } AudioChunk; | |||
typedef AudioChunk Bar; | typedef AudioChunk Bar; | |||
typedef AudioChunk Beat; | typedef AudioChunk Beat; | |||
typedef AudioChunk Section; | typedef AudioChunk Section; | |||
skipping to change at line 77 | skipping to change at line 99 | |||
typedef QVector< Segment > SegmentList; | typedef QVector< Segment > SegmentList; | |||
typedef struct { | typedef struct { | |||
QUrl url; | QUrl url; | |||
QString attribution; | QString attribution; | |||
QString type; | QString type; | |||
} License; | } License; | |||
Analysis::AnalysisStatus statusToEnum( const QString& status ); | Analysis::AnalysisStatus statusToEnum( const QString& status ); | |||
QString statusToString( Analysis::AnalysisStatus status ); | QString statusToString( Analysis::AnalysisStatus status ); | |||
QByteArray catalogTypeToLiteral( CatalogTypes::Type ); | ||||
CatalogTypes::Type literalToCatalogType( const QByteArray& type ); | ||||
QByteArray catalogStatusToLiteral( CatalogTypes::TicketStatus ); | ||||
CatalogTypes::TicketStatus literalToCatalogStatus( const QByteArray& ty | ||||
pe ); | ||||
QByteArray catalogUpdateActionToLiteral( CatalogTypes::Action ); | ||||
CatalogTypes::Action literalToCatalogUpdateAction( const QByteArray& ty | ||||
pe ); | ||||
} | } | |||
#endif | #endif | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 33 lines changed or added | |||