Artist.h | Artist.h | |||
---|---|---|---|---|
/************************************************************************** ************** | /************************************************************************** ************** | |||
* Copyright (c) 2010 Leo Franchi <lfranchi@kde.org> * | * Copyright (c) 2010-2012 Leo Franchi <lfranchi@kde.org> * | |||
* * | * * | |||
* This program is free software; you can redistribute it and/or modify it under * | * This program is free software; you can redistribute it and/or modify it under * | |||
* the terms of the GNU General Public License as published by the Free Sof tware * | * the terms of the GNU General Public License as published by the Free Sof tware * | |||
* Foundation; either version 2 of the License, or (at your option) any lat er * | * Foundation; either version 2 of the License, or (at your option) any lat er * | |||
* version. * | * version. * | |||
* * | * * | |||
* This program is distributed in the hope that it will be useful, but WITH OUT ANY * | * This program is distributed in the hope that it will be useful, but WITH OUT ANY * | |||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNES S FOR A * | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNES S FOR A * | |||
* PARTICULAR PURPOSE. See the GNU General Public License for more details. * | * PARTICULAR PURPOSE. See the GNU General Public License for more details. * | |||
* * | * * | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
ArtistTypes.h | ArtistTypes.h | |||
---|---|---|---|---|
/************************************************************************** ************** | /************************************************************************** ************** | |||
* Copyright (c) 2010 Leo Franchi <lfranchi@kde.org> * | * Copyright (c) 2010-2012 Leo Franchi <lfranchi@kde.org> * | |||
* * | * * | |||
* This program is free software; you can redistribute it and/or modify it under * | * This program is free software; you can redistribute it and/or modify it under * | |||
* the terms of the GNU General Public License as published by the Free Sof tware * | * the terms of the GNU General Public License as published by the Free Sof tware * | |||
* Foundation; either version 2 of the License, or (at your option) any lat er * | * Foundation; either version 2 of the License, or (at your option) any lat er * | |||
* version. * | * version. * | |||
* * | * * | |||
* This program is distributed in the hope that it will be useful, but WITH OUT ANY * | * This program is distributed in the hope that it will be useful, but WITH OUT ANY * | |||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNES S FOR A * | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNES S FOR A * | |||
* PARTICULAR PURPOSE. See the GNU General Public License for more details. * | * PARTICULAR PURPOSE. See the GNU General Public License for more details. * | |||
* * | * * | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
AudioSummary.h | AudioSummary.h | |||
---|---|---|---|---|
/************************************************************************** ************** | /************************************************************************** ************** | |||
* Copyright (c) 2010 Leo Franchi <lfranchi@kde.org> * | * Copyright (c) 2010-2012 Leo Franchi <lfranchi@kde.org> * | |||
* * | * * | |||
* This program is free software; you can redistribute it and/or modify it under * | * This program is free software; you can redistribute it and/or modify it under * | |||
* the terms of the GNU General Public License as published by the Free Sof tware * | * the terms of the GNU General Public License as published by the Free Sof tware * | |||
* Foundation; either version 2 of the License, or (at your option) any lat er * | * Foundation; either version 2 of the License, or (at your option) any lat er * | |||
* version. * | * version. * | |||
* * | * * | |||
* This program is distributed in the hope that it will be useful, but WITH OUT ANY * | * This program is distributed in the hope that it will be useful, but WITH OUT ANY * | |||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNES S FOR A * | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNES S FOR A * | |||
* PARTICULAR PURPOSE. See the GNU General Public License for more details. * | * PARTICULAR PURPOSE. See the GNU General Public License for more details. * | |||
* * | * * | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
Catalog.h | Catalog.h | |||
---|---|---|---|---|
/************************************************************************** ************** | /************************************************************************** ************** | |||
* Copyright (c) 2010 Leo Franchi <lfranchi@kde.org> * | * Copyright (c) 2010-2012 Leo Franchi <lfranchi@kde.org> * | |||
* * | * * | |||
* This program is free software; you can redistribute it and/or modify it under * | * This program is free software; you can redistribute it and/or modify it under * | |||
* the terms of the GNU General Public License as published by the Free Sof tware * | * the terms of the GNU General Public License as published by the Free Sof tware * | |||
* Foundation; either version 2 of the License, or (at your option) any lat er * | * Foundation; either version 2 of the License, or (at your option) any lat er * | |||
* version. * | * version. * | |||
* * | * * | |||
* This program is distributed in the hope that it will be useful, but WITH OUT ANY * | * This program is distributed in the hope that it will be useful, but WITH OUT ANY * | |||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNES S FOR A * | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNES S FOR A * | |||
* PARTICULAR PURPOSE. See the GNU General Public License for more details. * | * PARTICULAR PURPOSE. See the GNU General Public License for more details. * | |||
* * | * * | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
CatalogArtist.h | CatalogArtist.h | |||
---|---|---|---|---|
/************************************************************************** ************** | /************************************************************************** ************** | |||
* Copyright (c) 2010 Leo Franchi <lfranchi@kde.org> * | * Copyright (c) 2010-2012 Leo Franchi <lfranchi@kde.org> * | |||
* * | * * | |||
* This program is free software; you can redistribute it and/or modify it under * | * This program is free software; you can redistribute it and/or modify it under * | |||
* the terms of the GNU General Public License as published by the Free Sof tware * | * the terms of the GNU General Public License as published by the Free Sof tware * | |||
* Foundation; either version 2 of the License, or (at your option) any lat er * | * Foundation; either version 2 of the License, or (at your option) any lat er * | |||
* version. * | * version. * | |||
* * | * * | |||
* This program is distributed in the hope that it will be useful, but WITH OUT ANY * | * This program is distributed in the hope that it will be useful, but WITH OUT ANY * | |||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNES S FOR A * | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNES S FOR A * | |||
* PARTICULAR PURPOSE. See the GNU General Public License for more details. * | * PARTICULAR PURPOSE. See the GNU General Public License for more details. * | |||
* * | * * | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
CatalogItem.h | CatalogItem.h | |||
---|---|---|---|---|
/************************************************************************** ************** | /************************************************************************** ************** | |||
* Copyright (c) 2010 Leo Franchi <lfranchi@kde.org> * | * Copyright (c) 2010-2012 Leo Franchi <lfranchi@kde.org> * | |||
* * | * * | |||
* This program is free software; you can redistribute it and/or modify it under * | * This program is free software; you can redistribute it and/or modify it under * | |||
* the terms of the GNU General Public License as published by the Free So ftware * | * the terms of the GNU General Public License as published by the Free So ftware * | |||
* Foundation; either version 2 of the License, or (at your option) any la ter * | * Foundation; either version 2 of the License, or (at your option) any la ter * | |||
* version. * | * version. * | |||
* * | * * | |||
* This program is distributed in the hope that it will be useful, but WIT HOUT ANY * | * This program is distributed in the hope that it will be useful, but WIT HOUT ANY * | |||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNE SS FOR A * | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNE SS FOR A * | |||
* PARTICULAR PURPOSE. See the GNU General Public License for more details . * | * PARTICULAR PURPOSE. See the GNU General Public License for more details . * | |||
* * | * * | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
CatalogSong.h | CatalogSong.h | |||
---|---|---|---|---|
/************************************************************************** ************** | /************************************************************************** ************** | |||
* Copyright (c) 2010 Leo Franchi <lfranchi@kde.org> * | * Copyright (c) 2010-2012 Leo Franchi <lfranchi@kde.org> * | |||
* * | * * | |||
* This program is free software; you can redistribute it and/or modify it under * | * This program is free software; you can redistribute it and/or modify it under * | |||
* the terms of the GNU General Public License as published by the Free Sof tware * | * the terms of the GNU General Public License as published by the Free Sof tware * | |||
* Foundation; either version 2 of the License, or (at your option) any lat er * | * Foundation; either version 2 of the License, or (at your option) any lat er * | |||
* version. * | * version. * | |||
* * | * * | |||
* This program is distributed in the hope that it will be useful, but WITH OUT ANY * | * This program is distributed in the hope that it will be useful, but WITH OUT ANY * | |||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNES S FOR A * | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNES S FOR A * | |||
* PARTICULAR PURPOSE. See the GNU General Public License for more details. * | * PARTICULAR PURPOSE. See the GNU General Public License for more details. * | |||
* * | * * | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
CatalogUpdateEntry.h | CatalogUpdateEntry.h | |||
---|---|---|---|---|
/************************************************************************** ************** | /************************************************************************** ************** | |||
* Copyright (c) 2010 Leo Franchi <lfranchi@kde.org> * | * Copyright (c) 2010-2012 Leo Franchi <lfranchi@kde.org> * | |||
* * | * * | |||
* This program is free software; you can redistribute it and/or modify it under * | * This program is free software; you can redistribute it and/or modify it under * | |||
* the terms of the GNU General Public License as published by the Free Sof tware * | * the terms of the GNU General Public License as published by the Free Sof tware * | |||
* Foundation; either version 2 of the License, or (at your option) any lat er * | * Foundation; either version 2 of the License, or (at your option) any lat er * | |||
* version. * | * version. * | |||
* * | * * | |||
* This program is distributed in the hope that it will be useful, but WITH OUT ANY * | * This program is distributed in the hope that it will be useful, but WITH OUT ANY * | |||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNES S FOR A * | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNES S FOR A * | |||
* PARTICULAR PURPOSE. See the GNU General Public License for more details. * | * PARTICULAR PURPOSE. See the GNU General Public License for more details. * | |||
* * | * * | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
Config.h | Config.h | |||
---|---|---|---|---|
/************************************************************************** ************** | /************************************************************************** ************** | |||
* Copyright (c) 2010 Leo Franchi <lfranchi@kde.org> * | * Copyright (c) 2010-2012 Leo Franchi <lfranchi@kde.org> * | |||
* * | * * | |||
* This program is free software; you can redistribute it and/or modify it under * | * This program is free software; you can redistribute it and/or modify it under * | |||
* the terms of the GNU General Public License as published by the Free Sof tware * | * the terms of the GNU General Public License as published by the Free Sof tware * | |||
* Foundation; either version 2 of the License, or (at your option) any lat er * | * Foundation; either version 2 of the License, or (at your option) any lat er * | |||
* version. * | * version. * | |||
* * | * * | |||
* This program is distributed in the hope that it will be useful, but WITH OUT ANY * | * This program is distributed in the hope that it will be useful, but WITH OUT ANY * | |||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNES S FOR A * | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNES S FOR A * | |||
* PARTICULAR PURPOSE. See the GNU General Public License for more details. * | * PARTICULAR PURPOSE. See the GNU General Public License for more details. * | |||
* * | * * | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
Playlist.h | Playlist.h | |||
---|---|---|---|---|
/************************************************************************** ************** | /************************************************************************** ************** | |||
* Copyright (c) 2010 Leo Franchi <lfranchi@kde.org> * | * Copyright (c) 2010-2012 Leo Franchi <lfranchi@kde.org> * | |||
* * | * * | |||
* This program is free software; you can redistribute it and/or modify it under * | * This program is free software; you can redistribute it and/or modify it under * | |||
* the terms of the GNU General Public License as published by the Free Sof tware * | * the terms of the GNU General Public License as published by the Free Sof tware * | |||
* Foundation; either version 2 of the License, or (at your option) any lat er * | * Foundation; either version 2 of the License, or (at your option) any lat er * | |||
* version. * | * version. * | |||
* * | * * | |||
* This program is distributed in the hope that it will be useful, but WITH OUT ANY * | * This program is distributed in the hope that it will be useful, but WITH OUT ANY * | |||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNES S FOR A * | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNES S FOR A * | |||
* PARTICULAR PURPOSE. See the GNU General Public License for more details. * | * PARTICULAR PURPOSE. See the GNU General Public License for more details. * | |||
* * | * * | |||
skipping to change at line 35 | skipping to change at line 35 | |||
#include "Artist.h" | #include "Artist.h" | |||
#include <QtCore/QString> | #include <QtCore/QString> | |||
#include "Catalog.h" | #include "Catalog.h" | |||
class QNetworkReply; | class QNetworkReply; | |||
class DynamicPlaylistData; | class DynamicPlaylistData; | |||
namespace Echonest{ | namespace Echonest{ | |||
typedef struct { | typedef struct { | |||
qreal served_time; | ||||
QByteArray artist_id; | ||||
QByteArray id; | ||||
QString artist_name; | ||||
QString title; | ||||
int rating; | ||||
} SessionItem; | ||||
typedef struct { | ||||
TermList terms; | ||||
SongList seed_songs; | ||||
// description .. what data is in here? | ||||
Artists banned_artists; | ||||
QVector< QString > rules; | ||||
QByteArray session_id; | QByteArray session_id; | |||
Artists seeds; | Artists banned_artists; | |||
QVector< SessionItem > skipped_songs; | Artists favorited_artists; | |||
QVector< SessionItem > banned_songs; | SongList banned_songs; | |||
QString playlist_type; | SongList favorited_songs; | |||
Catalogs seed_catalogs; | QVariantMap options; | |||
QVector< SessionItem > rated_songs; | QVariantMap ratingsMap; | |||
QVector< SessionItem > history; | // TODO favorites_map | |||
// TODO constraints | ||||
} SessionInfo; | } SessionInfo; | |||
/** | /** | |||
* This encapsulates an Echo Nest dynamic playlist. It contains a playl ist ID and | * This encapsulates an Echo Nest dynamic playlist. It contains a playl ist ID and | |||
* the current song, and can fetch the next song. | * the current song, and can fetch the next song. | |||
* | * | |||
* See http://developer.echonest.com/docs/v4/playlist.html#dynamic | * See http://developer.echonest.com/docs/v4/playlist.html | |||
* for more information | * for more information | |||
*/ | */ | |||
class ECHONEST_EXPORT DynamicPlaylist | class ECHONEST_EXPORT DynamicPlaylist | |||
{ | { | |||
public: | public: | |||
/** | /** | |||
* The types of playlist that can be generated. Artist plays songs for the given artist, | * The types of playlist that can be generated. Artist plays songs for the given artist, | |||
* ArtistRadio takes into account similar artists, and ArtistDescr iption plays songs matching | * ArtistRadio takes into account similar artists, and ArtistDescr iption plays songs matching | |||
* the given description. | * the given description. | |||
*/ | */ | |||
skipping to change at line 177 | skipping to change at line 165 | |||
Mode, /// (minor, major) 0, 1 the mode of songs in the play list | Mode, /// (minor, major) 0, 1 the mode of songs in the play list | |||
Key, /// (c, c-sharp, d, e-flat, e, f, f-sharp, g, a-flat, a, b -flat, b) 0 - 11 the key of songs in the playlist | Key, /// (c, c-sharp, d, e-flat, e, f, f-sharp, g, a-flat, a, b -flat, b) 0 - 11 the key of songs in the playlist | |||
SongInformation, /// what sort of song information should be re turned. Should be an Echonest::SongInformation object | SongInformation, /// what sort of song information should be re turned. Should be an Echonest::SongInformation object | |||
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) | |||
ChainXSPF, /// true, false If true, returns an xspf for this dynamic playlist with 2 items. The second item will be a link to the API c all for the next track in the chain. Please note that this sidesteps libech onest's handling of the tracks. | ChainXSPF, /// true, false If true, returns an xspf for this dynamic playlist with 2 items. The second item will be a link to the API c all for the next track in the chain. Please note that this sidesteps libech onest's handling of the tracks. | |||
Mood, /// A mood to limit this playlist to, for example "happy" or "sad". Multiples of this param are okay. See the method Artist::listTer ms for details on what moods are currently available | Mood, /// A mood to limit this playlist to, for example "happy" or "sad". Multiples of this param are okay. See the method Artist::listTer ms for details on what moods are currently available | |||
Style, /// A style to limit this playlist to, for example "happ y" or "sad". Multiples of this param are okay. See the method Artist::listT erms for details on what styles are currently available | Style, /// A style to limit this playlist to, for example "happ y" or "sad". Multiples of this param are okay. See the method Artist::listT erms for details on what styles are currently available | |||
Adventurousness | Adventurousness, /// A value of 0 means no adventurousness, onl | |||
y known and preferred music will be played. A value of 1 means high adventu | ||||
rousness, mostly unknown music will be played. This parameter only applies | ||||
to catalog and catalog-radio type playlists. | ||||
MoreLikeThis, /// When steering: Supply a song id to steer this | ||||
session towards. Can be boosted from 0-5 like so: SO12341234^2. Default is | ||||
1 | ||||
LessLikeThis, /// When steering: Supply a song id to steer this | ||||
session away from. Can be boosted from 0-5 like so: SO12341234^2. Default | ||||
is 1 | ||||
TargetTempo, /// When steering: 0.0 < tempo < 500. (BPM). Targe | ||||
t a desired tempo for the songs in this dynamic playlist session | ||||
TargetLoudness, /// When steering: -100. < loudness < 100. (BPM | ||||
)dB. Target a desired loudness for the songs in this dynamic playlist sessi | ||||
on | ||||
TargetDanceability, /// When steering: 0.0 < danceability < 1. | ||||
Target a desired danceability for the songs in this dynamic playlist sessio | ||||
n | ||||
TargetEnergy, /// When steering: 0.0 < energy < 1.Target a desi | ||||
red energy for the songs in this dynamic playlist session | ||||
TargetSongHotttnesss, /// When steering: 0.0 < song_hotttnesss | ||||
< 1.Target a desired song_hotttnesss for the songs in this dynamic playlist | ||||
session | ||||
TargetArtistHotttnesss, /// When steering: 0.0 < artist_hottttn | ||||
esss < 1.Target a desired artist_hottttnesss for the songs in this dynamic | ||||
playlist session | ||||
TargetArtistFamiliarity, /// When steering: 0.0 < artist_famili | ||||
arity < 1.Target a desired energy for the artist_familiarity in this dynami | ||||
c playlist session | ||||
}; | }; | |||
typedef QPair< PlaylistParam, QVariant > PlaylistParamData; | ||||
typedef QVector< PlaylistParamData > PlaylistParams; | ||||
/** | /** | |||
* The various controls for a dynamic playlist. | * The types of feedback that can be used to steer a dynamic playli | |||
* | st | |||
* Please see The Echo Nest API documentation for more information | ||||
*/ | */ | |||
enum DynamicControlItem { | enum DynamicFeedbackParam { | |||
Steer = 0, | BanArtist, /// Ban this artist from this dynamic session. [arti | |||
SteerDescription, | st_id, track_id, song_id, "last"] | |||
Rating, | FavoriteArtist, /// Mark this artist as 'liked' for this sessio | |||
Ban | n. [artist_id, track_id, song_id, "last"] | |||
BanSong, /// Ban this song from this dynamic session. [track_id | ||||
, song_id, "last"] | ||||
SkipSong, /// Mark this song as skipped by the user. Will not a | ||||
ppear for the rest of the session. [track_id, song_id, "last"] | ||||
FavoriteSong, /// Mark this song as a favorite. [track_id, song | ||||
_id, "last"] | ||||
PlaySong, /// Mark this song as played. Unneeded unless you wan | ||||
t to pre-seed a station. [track_id, song_id, "last"] | ||||
UnplaySong, /// Remove a song from a dynamic session's history. | ||||
Will not blacklist the song. [track_id, song_id, "last"] | ||||
RateSong, /// Rate the desired song. [track_id, song_id, "last" | ||||
]^[0-10]. E.g: "last^3" or "TRTLKZV12E5AC92E11^5" | ||||
}; | }; | |||
typedef QPair< DynamicControlItem, QString > DynamicControl; | ||||
typedef QVector< DynamicControl > DynamicControls; | typedef QPair< PlaylistParam, QVariant > PlaylistParamData; | |||
typedef QVector< PlaylistParamData > PlaylistParams; | ||||
typedef QPair< DynamicFeedbackParam, QByteArray > DynamicFeedbackPa | ||||
ramData; | ||||
typedef QVector< DynamicFeedbackParamData > DynamicFeedback; | ||||
typedef QPair< SongList, SongList > FetchPair; | ||||
DynamicPlaylist(); | DynamicPlaylist(); | |||
virtual ~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(), | * To fetch tracks, call fetchNextSong(). The info() method can be | |||
* and fetchNextSong() methods will then be useful. | used | |||
* to extract session information | ||||
*/ | ||||
QNetworkReply* create( const PlaylistParams& params ) const; | ||||
void parseCreate( QNetworkReply* ) throw( ParseError ); | ||||
/** | ||||
* Retart a dynamic playlist with the given parameters. | ||||
* Once the QNetworkReply has finished, pass it to parseStart() | ||||
* | ||||
* This is the same as start(), except it maintains the history fro | ||||
m an | ||||
* already-existing playing station. | ||||
*/ | */ | |||
QNetworkReply* start( const PlaylistParams& params ) const; | QNetworkReply* restart( const PlaylistParams& params ) const; | |||
Song parseStart( QNetworkReply* ) throw( ParseError ); | ||||
/** | /** | |||
* The session id of this dynamic playlist. If the playlist has end ed, or has not been started, | * The session id of this dynamic playlist. If the playlist has end ed, or has not been started, | |||
* the result is empty. | * the result is empty. | |||
* | * | |||
*/ | */ | |||
QByteArray sessionId() const; | QByteArray sessionId() const; | |||
void setSessionId( const QByteArray& id ); | void setSessionId( const QByteArray& id ); | |||
/** | /** | |||
* The current song of this dynamic playlist. Once this song has be en played, | * The current song of this dynamic playlist. Once this song has be en played, | |||
* or whenever is desired, call fetchNextSong() to get the next so ng. | * or whenever is desired, call fetchNextSong() to get the next so ng. | |||
*/ | */ | |||
Song currentSong() const; | Song currentSong() const; | |||
void setCurrentSong( const Song& song ); | void setCurrentSong( const Song& song ); | |||
/** | /** | |||
* Queries The Echo Nest for the next playable song in this | * Queries The Echo Nest for the next playable song(s) in this | |||
* dynamic playlist. | * dynamic playlist. | |||
* | * | |||
* Once the query has emitted the finished() signal, pass it to par | * \param @results How many results to return, 1-5. This lets you | |||
seNextSong(), which will | * reduce the calls if you need more than one. Defa | |||
* return the new song to play. It will also set the current song | ult is 1. | |||
to the newly parsed song. | * \param @lookahead The potential next songs (after the results) | |||
* if there is no steering applied. 0-5, default | ||||
of 0. | ||||
*/ | ||||
QNetworkReply* next( int results = 1, int lookahead = 0 ) const; | ||||
/** | ||||
* Return the result of a dynamic/next API call. This will return t | ||||
wo lists: | ||||
* the "next" list and the "lookahead" list. Consult the \ref next( | ||||
) docs | ||||
* and The Echo Nest documentation for more information. | ||||
*/ | ||||
FetchPair parseNext( QNetworkReply* reply ) throw( ParseError ); | ||||
/** | ||||
* Returns feedback to The Echo Nest for the currently playing dyna | ||||
mic | ||||
* playlist. | ||||
* | ||||
* See The Echo Nest api documentation for complete details. | ||||
* | ||||
* \param feedback A list of feedback items to apply. | ||||
*/ | ||||
QNetworkReply* feedback(const DynamicFeedback& feedback) const; | ||||
/** | ||||
* Parses the result of the feedback call. | ||||
* | * | |||
* If the playlist has no more songs, the returned song object will | * Will throw an exception if the return code is not successful (as | |||
be have no name nor id. | other parse methods do). | |||
*/ | ||||
void parseFeedback(QNetworkReply* reply) const throw( ParseError ); | ||||
/** | ||||
* Modifies the upcoming tracks in this dynamic playlist session by | ||||
steering it. | ||||
* | * | |||
* @param rating The rating for the song that was just played. Rang | * Steering is additive, and can be reset for a dynamic playlist by | |||
es from 1 (lowest) to 5 (highest) | calling reset. | |||
* @param controls The controls to apply when fetching the next tra | * | |||
ck. | * \param steerParams The desired steering params. Only use the enu | |||
m values that correspond to valid steering commands. | ||||
*/ | ||||
QNetworkReply* steer(const PlaylistParams& steerParams) const; | ||||
/** | ||||
* Parses the result of the steer call. | ||||
* | * | |||
* Will throw an exception if the return code is not successful (as other parse methods do). | ||||
*/ | */ | |||
QNetworkReply* fetchNextSong( int rating = -1 ) const; | void parseSteer(QNetworkReply* reply) const throw( ParseError ); | |||
QNetworkReply* fetchNextSong( const DynamicControls& controls ) con | ||||
st; | ||||
Song parseNextSong( QNetworkReply* reply ); | ||||
/** | /** | |||
* Returns a description of this dynamic playlist session | * Returns a description of this dynamic playlist session | |||
*/ | */ | |||
QNetworkReply* fetchSessionInfo() const; | QNetworkReply* fetchInfo() const; | |||
SessionInfo parseSessionInfo( QNetworkReply* reply ) throw( ParseEr | SessionInfo parseInfo( QNetworkReply* reply ) throw( ParseError ); | |||
ror ); | ||||
/** | ||||
* Deletes a currently active playlist session. A non-commercial AP | ||||
I can have, at most 1,000 active playlist sessions. | ||||
*/ | ||||
QNetworkReply* deleteSession() const; | ||||
void parseDeleteSession(QNetworkReply* reply); | ||||
/** | /** | |||
* Generate a static playlist, according to the desired criteria. U se parseXSPFPlaylist if | * Generate a static playlist, according to the desired criteria. U se parseXSPFPlaylist if | |||
* you pass format=xspf to \c staticPlaylist(). | * you pass format=xspf to \c staticPlaylist(). | |||
*/ | */ | |||
static QNetworkReply* staticPlaylist( const PlaylistParams& params ); | static QNetworkReply* staticPlaylist( const PlaylistParams& params ); | |||
static SongList parseStaticPlaylist( QNetworkReply* reply ) throw( ParseError ); | static SongList parseStaticPlaylist( QNetworkReply* reply ) throw( ParseError ); | |||
/** | /** | |||
* Parse an xspf playlist. Returns the full xspf content with no mo difications. | * Parse an xspf playlist. Returns the full xspf content with no mo difications. | |||
*/ | */ | |||
static QByteArray parseXSPFPlaylist( QNetworkReply* reply ) throw( ParseError ); | static QByteArray parseXSPFPlaylist( QNetworkReply* reply ) throw( ParseError ); | |||
private: | private: | |||
static QByteArray playlistParamToString( PlaylistParam param ); | static QByteArray playlistParamToString( PlaylistParam param ); | |||
static QNetworkReply* generateInternal( const PlaylistParams& param s, const QByteArray& type ); | static QNetworkReply* generateInternal( const PlaylistParams& param s, const QByteArray& type ); | |||
static QByteArray playlistSortToString(SortingType sorting); | static QByteArray playlistSortToString(SortingType sorting); | |||
static QByteArray playlistArtistPickToString(ArtistPick pick); | static QByteArray playlistArtistPickToString(ArtistPick pick); | |||
static QByteArray dynamicControlToString(DynamicControlItem control ); | static QByteArray dynamicFeedbackToString(DynamicFeedbackParam para m); | |||
QSharedDataPointer<DynamicPlaylistData> d; | QSharedDataPointer<DynamicPlaylistData> d; | |||
}; | }; | |||
ECHONEST_EXPORT QDebug operator<<(QDebug d, const Echonest::DynamicPlay list& playlist); | ECHONEST_EXPORT QDebug operator<<(QDebug d, const Echonest::DynamicPlay list& playlist); | |||
} // namespace | } // namespace | |||
Q_DECLARE_METATYPE( Echonest::DynamicPlaylist ) | Q_DECLARE_METATYPE( Echonest::DynamicPlaylist ) | |||
End of changes. 19 change blocks. | ||||
61 lines changed or deleted | 146 lines changed or added | |||
Song.h | Song.h | |||
---|---|---|---|---|
/************************************************************************** ************** | /************************************************************************** ************** | |||
* Copyright (c) 2010 Leo Franchi <lfranchi@kde.org> * | * Copyright (c) 2010-2012 Leo Franchi <lfranchi@kde.org> * | |||
* * | * * | |||
* This program is free software; you can redistribute it and/or modify it under * | * This program is free software; you can redistribute it and/or modify it under * | |||
* the terms of the GNU General Public License as published by the Free Sof tware * | * the terms of the GNU General Public License as published by the Free Sof tware * | |||
* Foundation; either version 2 of the License, or (at your option) any lat er * | * Foundation; either version 2 of the License, or (at your option) any lat er * | |||
* version. * | * version. * | |||
* * | * * | |||
* This program is distributed in the hope that it will be useful, but WITH OUT ANY * | * This program is distributed in the hope that it will be useful, but WITH OUT ANY * | |||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNES S FOR A * | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNES S FOR A * | |||
* PARTICULAR PURPOSE. See the GNU General Public License for more details. * | * PARTICULAR PURPOSE. See the GNU General Public License for more details. * | |||
* * | * * | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
Track.h | Track.h | |||
---|---|---|---|---|
/************************************************************************** ************** | /************************************************************************** ************** | |||
* Copyright (c) 2010 Leo Franchi <lfranchi@kde.org> * | * Copyright (c) 2010-2012 Leo Franchi <lfranchi@kde.org> * | |||
* * | * * | |||
* This program is free software; you can redistribute it and/or modify it under * | * This program is free software; you can redistribute it and/or modify it under * | |||
* the terms of the GNU General Public License as published by the Free Sof tware * | * the terms of the GNU General Public License as published by the Free Sof tware * | |||
* Foundation; either version 2 of the License, or (at your option) any lat er * | * Foundation; either version 2 of the License, or (at your option) any lat er * | |||
* version. * | * version. * | |||
* * | * * | |||
* This program is distributed in the hope that it will be useful, but WITH OUT ANY * | * This program is distributed in the hope that it will be useful, but WITH OUT ANY * | |||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNES S FOR A * | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNES S FOR A * | |||
* PARTICULAR PURPOSE. See the GNU General Public License for more details. * | * PARTICULAR PURPOSE. See the GNU General Public License for more details. * | |||
* * | * * | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
TypeInformation.h | TypeInformation.h | |||
---|---|---|---|---|
/************************************************************************** ************** | /************************************************************************** ************** | |||
* Copyright (c) 2010 Leo Franchi <lfranchi@kde.org> * | * Copyright (c) 2010-2012 Leo Franchi <lfranchi@kde.org> * | |||
* * | * * | |||
* This program is free software; you can redistribute it and/or modify it under * | * This program is free software; you can redistribute it and/or modify it under * | |||
* the terms of the GNU General Public License as published by the Free Sof tware * | * the terms of the GNU General Public License as published by the Free Sof tware * | |||
* Foundation; either version 2 of the License, or (at your option) any lat er * | * Foundation; either version 2 of the License, or (at your option) any lat er * | |||
* version. * | * version. * | |||
* * | * * | |||
* This program is distributed in the hope that it will be useful, but WITH OUT ANY * | * This program is distributed in the hope that it will be useful, but WITH OUT ANY * | |||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNES S FOR A * | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNES S FOR A * | |||
* PARTICULAR PURPOSE. See the GNU General Public License for more details. * | * PARTICULAR PURPOSE. See the GNU General Public License for more details. * | |||
* * | * * | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
Util.h | Util.h | |||
---|---|---|---|---|
/************************************************************************** ************** | /************************************************************************** ************** | |||
* Copyright (c) 2010 Leo Franchi <lfranchi@kde.org> * | * Copyright (c) 2010-2012 Leo Franchi <lfranchi@kde.org> * | |||
* * | * * | |||
* This program is free software; you can redistribute it and/or modify it under * | * This program is free software; you can redistribute it and/or modify it under * | |||
* the terms of the GNU General Public License as published by the Free Sof tware * | * the terms of the GNU General Public License as published by the Free Sof tware * | |||
* Foundation; either version 2 of the License, or (at your option) any lat er * | * Foundation; either version 2 of the License, or (at your option) any lat er * | |||
* version. * | * version. * | |||
* * | * * | |||
* This program is distributed in the hope that it will be useful, but WITH OUT ANY * | * This program is distributed in the hope that it will be useful, but WITH OUT ANY * | |||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNES S FOR A * | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNES S FOR A * | |||
* PARTICULAR PURPOSE. See the GNU General Public License for more details. * | * PARTICULAR PURPOSE. See the GNU General Public License for more details. * | |||
* * | * * | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
echonest_export.h | echonest_export.h | |||
---|---|---|---|---|
/************************************************************************** ************** | /************************************************************************** ************** | |||
* Copyright (c) 2010 Leo Franchi <lfranchi@kde.org> * | * Copyright (c) 2010-2012 Leo Franchi <lfranchi@kde.org> * | |||
* * | * * | |||
* This program is free software; you can redistribute it and/or modify it under * | * This program is free software; you can redistribute it and/or modify it under * | |||
* the terms of the GNU General Public License as published by the Free Sof tware * | * the terms of the GNU General Public License as published by the Free Sof tware * | |||
* Foundation; either version 2 of the License, or (at your option) any lat er * | * Foundation; either version 2 of the License, or (at your option) any lat er * | |||
* version. * | * version. * | |||
* * | * * | |||
* This program is distributed in the hope that it will be useful, but WITH OUT ANY * | * This program is distributed in the hope that it will be useful, but WITH OUT ANY * | |||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNES S FOR A * | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNES S FOR A * | |||
* PARTICULAR PURPOSE. See the GNU General Public License for more details. * | * PARTICULAR PURPOSE. See the GNU General Public License for more details. * | |||
* * | * * | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||