2011-09-02 00:28:11 +02:00
|
|
|
/* This file is part of Clementine.
|
2011-10-02 12:05:56 +02:00
|
|
|
Copyright 2011, David Sansome <me@davidsansome.com>
|
2011-09-02 00:28:11 +02:00
|
|
|
|
|
|
|
Clementine 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 Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
Clementine is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef GROOVESHARKSERVICE_H
|
|
|
|
#define GROOVESHARKSERVICE_H
|
|
|
|
|
|
|
|
#include "internetmodel.h"
|
|
|
|
#include "internetservice.h"
|
|
|
|
|
2012-01-08 18:46:50 +01:00
|
|
|
#include <QSslError>
|
|
|
|
|
2011-10-05 21:59:15 +02:00
|
|
|
class GroovesharkUrlHandler;
|
2011-09-02 00:28:11 +02:00
|
|
|
class NetworkAccessManager;
|
|
|
|
class Playlist;
|
2012-06-27 01:21:57 +02:00
|
|
|
class SearchBoxWidget;
|
2012-02-13 21:44:04 +01:00
|
|
|
|
2011-09-02 00:28:11 +02:00
|
|
|
class QMenu;
|
2012-02-13 21:44:04 +01:00
|
|
|
class QNetworkReply;
|
2011-09-02 00:28:11 +02:00
|
|
|
class QNetworkRequest;
|
2012-02-13 21:44:04 +01:00
|
|
|
class QSortFilterProxyModel;
|
2011-09-02 00:28:11 +02:00
|
|
|
|
2011-10-05 21:59:15 +02:00
|
|
|
class GroovesharkService : public InternetService {
|
2011-09-02 00:28:11 +02:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2012-02-12 14:41:50 +01:00
|
|
|
GroovesharkService(Application* app, InternetModel *parent);
|
2011-10-05 21:59:15 +02:00
|
|
|
~GroovesharkService();
|
2011-09-02 00:28:11 +02:00
|
|
|
|
2011-10-30 23:59:43 +01:00
|
|
|
enum Role {
|
|
|
|
Role_UserPlaylistId = InternetModel::RoleCount,
|
2011-11-07 19:37:29 +01:00
|
|
|
Role_PlaylistType
|
|
|
|
};
|
|
|
|
|
|
|
|
enum PlaylistType {
|
2011-11-24 20:18:42 +01:00
|
|
|
UserPlaylist = Qt::UserRole,
|
2012-07-21 18:09:16 +02:00
|
|
|
// Favorites and Library list are like playlists, but we want to do special
|
|
|
|
// treatments in some cases
|
2011-11-25 01:00:58 +01:00
|
|
|
UserFavorites,
|
2012-07-21 18:09:16 +02:00
|
|
|
UserLibrary,
|
2011-11-25 01:00:58 +01:00
|
|
|
SubscribedPlaylist
|
2011-10-30 23:59:43 +01:00
|
|
|
};
|
|
|
|
|
2011-09-13 22:32:10 +02:00
|
|
|
// Values are persisted - don't change.
|
|
|
|
enum LoginState {
|
|
|
|
LoginState_LoggedIn = 1,
|
|
|
|
LoginState_AuthFailed = 2,
|
|
|
|
LoginState_NoPremium = 3,
|
|
|
|
LoginState_OtherError = 4
|
|
|
|
};
|
|
|
|
|
2011-09-02 00:28:11 +02:00
|
|
|
// Internet Service methods
|
|
|
|
QStandardItem* CreateRootItem();
|
|
|
|
void LazyPopulate(QStandardItem *parent);
|
|
|
|
|
|
|
|
void ItemDoubleClicked(QStandardItem* item);
|
2011-11-29 13:57:35 +01:00
|
|
|
smart_playlists::GeneratorPtr CreateGenerator(QStandardItem* item);
|
2011-10-30 23:59:43 +01:00
|
|
|
void DropMimeData(const QMimeData* data, const QModelIndex& index);
|
2011-11-06 16:12:44 +01:00
|
|
|
QList<QAction*> playlistitem_actions(const Song& song);
|
2012-03-11 15:44:43 +01:00
|
|
|
void ShowContextMenu(const QPoint& global_pos);
|
2012-06-27 01:21:57 +02:00
|
|
|
QWidget* HeaderWidget() const;
|
2011-09-02 00:28:11 +02:00
|
|
|
|
2011-09-20 00:26:24 +02:00
|
|
|
// User should be logged in to be able to generate streaming urls
|
2011-11-29 23:52:19 +01:00
|
|
|
QUrl GetStreamingUrlFromSongId(const QString& song_id, const QString& artist_id,
|
2011-10-02 12:05:56 +02:00
|
|
|
QString* server_id, QString* stream_key,
|
|
|
|
qint64* length_nanosec);
|
2011-09-13 22:32:10 +02:00
|
|
|
void Login(const QString& username, const QString& password);
|
|
|
|
void Logout();
|
2011-10-20 15:03:47 +02:00
|
|
|
bool IsLoggedIn() const { return !session_id_.isEmpty(); }
|
2011-09-24 12:06:31 +02:00
|
|
|
void RetrieveUserPlaylists();
|
2011-10-29 20:42:25 +02:00
|
|
|
void RetrieveUserFavorites();
|
2012-07-21 18:09:16 +02:00
|
|
|
void RetrieveUserLibrarySongs();
|
2011-11-23 01:07:40 +01:00
|
|
|
void RetrievePopularSongs();
|
2011-11-19 18:56:29 +01:00
|
|
|
void RetrievePopularSongsMonth();
|
|
|
|
void RetrievePopularSongsToday();
|
2011-11-25 01:00:58 +01:00
|
|
|
void RetrieveSubscribedPlaylists();
|
2011-11-29 13:57:35 +01:00
|
|
|
void RetrieveAutoplayTags();
|
2011-10-30 23:59:43 +01:00
|
|
|
void SetPlaylistSongs(int playlist_id, const QList<int>& songs_ids);
|
2012-05-11 21:28:28 +02:00
|
|
|
void RemoveFromPlaylist(int playlist_id, const QList<int>& songs_ids_to_remove);
|
2011-10-30 23:59:43 +01:00
|
|
|
// Refresh playlist_id playlist , or create it if it doesn't exist
|
2011-12-01 23:46:27 +01:00
|
|
|
void RefreshPlaylist(int playlist_id);
|
2011-11-05 02:34:49 +01:00
|
|
|
void DeletePlaylist(int playlist_id);
|
2011-11-28 21:59:25 +01:00
|
|
|
void RenamePlaylist(int playlist_id);
|
2011-11-02 00:02:49 +01:00
|
|
|
void AddUserFavoriteSong(int song_id);
|
2012-05-11 21:46:07 +02:00
|
|
|
void RemoveFromFavorites(const QList<int>& songs_ids_to_remove);
|
2012-07-21 18:31:08 +02:00
|
|
|
void AddUserLibrarySongs(const QList<int>& songs_ids);
|
2012-07-21 18:09:16 +02:00
|
|
|
void RemoveFromLibrary(const QList<int>& songs_ids_to_remove);
|
2011-11-10 00:56:27 +01:00
|
|
|
void GetSongUrlToShare(int song_id);
|
2012-03-27 00:43:47 +02:00
|
|
|
void GetPlaylistUrlToShare(int playlist_id);
|
2011-11-29 13:57:35 +01:00
|
|
|
// Start autoplay for the given tag_id, fill the autoplay_state, returns a
|
|
|
|
// first song to play
|
|
|
|
Song StartAutoplayTag(int tag_id, QVariantMap& autoplay_state);
|
2011-11-29 23:52:19 +01:00
|
|
|
Song StartAutoplay(QVariantMap& autoplay_state);
|
2011-11-29 13:57:35 +01:00
|
|
|
// Get another autoplay song. autoplay_state is the autoplay_state received from StartAutoplayTag
|
|
|
|
Song GetAutoplaySong(QVariantMap& autoplay_state);
|
2011-10-02 12:05:56 +02:00
|
|
|
void MarkStreamKeyOver30Secs(const QString& stream_key, const QString& server_id);
|
|
|
|
void MarkSongComplete(const QString& song_id, const QString& stream_key, const QString& server_id);
|
2011-09-24 12:06:31 +02:00
|
|
|
|
2011-09-13 22:32:10 +02:00
|
|
|
// Persisted in the settings and updated on each Login().
|
|
|
|
LoginState login_state() const { return login_state_; }
|
|
|
|
const QString& session_id() { return session_id_; }
|
|
|
|
|
2011-09-30 15:35:09 +02:00
|
|
|
int SimpleSearch(const QString& query);
|
2011-10-04 18:26:40 +02:00
|
|
|
int SearchAlbums(const QString& query);
|
2012-03-05 00:54:24 +01:00
|
|
|
void GetAlbumSongs(quint64 album_id);
|
2011-09-02 00:28:11 +02:00
|
|
|
|
|
|
|
static const char* kServiceName;
|
2011-09-13 22:32:10 +02:00
|
|
|
static const char* kSettingsGroup;
|
2011-09-02 00:28:11 +02:00
|
|
|
|
2011-09-13 22:32:10 +02:00
|
|
|
signals:
|
|
|
|
void LoginFinished(bool success);
|
2011-09-30 15:35:09 +02:00
|
|
|
void SimpleSearchResults(int id, SongList songs);
|
2012-03-05 00:54:24 +01:00
|
|
|
// AlbumSearchResult emits the search id and the Grooveshark ids of the
|
|
|
|
// albums found. Albums' songs will be loaded asynchronously and
|
|
|
|
// AlbumSongsLoaded will be emitted, containing the actual Albums' songs.
|
|
|
|
void AlbumSearchResult(int id, QList<quint64> albums_ids);
|
|
|
|
void AlbumSongsLoaded(quint64 id, SongList songs);
|
2011-09-13 22:32:10 +02:00
|
|
|
|
2011-10-20 15:03:47 +02:00
|
|
|
public slots:
|
2012-06-27 01:21:57 +02:00
|
|
|
void Search(const QString& text, bool now = false);
|
2011-10-20 15:03:47 +02:00
|
|
|
void ShowConfig();
|
|
|
|
|
2011-09-02 00:28:11 +02:00
|
|
|
protected:
|
2011-09-24 12:06:31 +02:00
|
|
|
struct PlaylistInfo {
|
|
|
|
PlaylistInfo() {}
|
2012-05-16 01:30:18 +02:00
|
|
|
PlaylistInfo(int id, QString name, QStandardItem* item = NULL)
|
2011-11-25 01:00:58 +01:00
|
|
|
: id_(id), name_(name), item_(item) {}
|
2011-09-24 12:06:31 +02:00
|
|
|
|
2012-05-16 01:30:18 +02:00
|
|
|
bool operator< (const PlaylistInfo other) const {
|
2012-05-17 01:56:11 +02:00
|
|
|
return name_.localeAwareCompare(other.name_) < 0;
|
2012-05-16 01:30:18 +02:00
|
|
|
}
|
|
|
|
|
2011-09-24 12:06:31 +02:00
|
|
|
int id_;
|
|
|
|
QString name_;
|
2011-10-30 23:59:43 +01:00
|
|
|
QStandardItem* item_;
|
|
|
|
QList<int> songs_ids_;
|
2011-09-24 12:06:31 +02:00
|
|
|
};
|
|
|
|
|
2011-09-02 00:28:11 +02:00
|
|
|
private slots:
|
2012-10-12 13:43:55 +02:00
|
|
|
void SessionCreated(QNetworkReply* reply);
|
2011-09-20 19:12:06 +02:00
|
|
|
void DoSearch();
|
2012-10-12 13:43:55 +02:00
|
|
|
void SearchSongsFinished(QNetworkReply* reply);
|
|
|
|
void SimpleSearchFinished(QNetworkReply* reply, int id);
|
2011-10-04 18:26:40 +02:00
|
|
|
void SearchAlbumsFinished(QNetworkReply* reply, int id);
|
2012-03-05 00:54:24 +01:00
|
|
|
void GetAlbumSongsFinished(QNetworkReply* reply, quint64 album_id);
|
2012-10-12 13:43:55 +02:00
|
|
|
void Authenticated(QNetworkReply* reply);
|
|
|
|
void UserPlaylistsRetrieved(QNetworkReply* reply);
|
2011-11-23 01:07:40 +01:00
|
|
|
void UserFavoritesRetrieved(QNetworkReply* reply, int task_id);
|
2012-07-21 18:09:16 +02:00
|
|
|
void UserLibrarySongsRetrieved(QNetworkReply* reply, int task_id);
|
2011-11-19 18:56:29 +01:00
|
|
|
void PopularSongsMonthRetrieved(QNetworkReply* reply);
|
|
|
|
void PopularSongsTodayRetrieved(QNetworkReply* reply);
|
2011-11-25 01:00:58 +01:00
|
|
|
void SubscribedPlaylistsRetrieved(QNetworkReply* reply);
|
2011-11-29 13:57:35 +01:00
|
|
|
void AutoplayTagsRetrieved(QNetworkReply* reply);
|
2012-10-12 13:43:55 +02:00
|
|
|
void PlaylistSongsRetrieved(QNetworkReply* reply, int playlist_id);
|
2011-11-23 01:07:40 +01:00
|
|
|
void PlaylistSongsSet(QNetworkReply* reply, int playlist_id, int task_id);
|
2011-11-05 02:34:49 +01:00
|
|
|
void CreateNewPlaylist();
|
|
|
|
void NewPlaylistCreated(QNetworkReply* reply, const QString& name);
|
|
|
|
void DeleteCurrentPlaylist();
|
2011-11-28 21:59:25 +01:00
|
|
|
void RenameCurrentPlaylist();
|
2011-11-05 02:34:49 +01:00
|
|
|
void PlaylistDeleted(QNetworkReply* reply, int playlist_id);
|
2011-11-28 21:59:25 +01:00
|
|
|
void PlaylistRenamed(QNetworkReply* reply, int playlist_id, const QString& new_name);
|
2012-07-21 18:09:16 +02:00
|
|
|
void AddCurrentSongToUserFavorites() { AddUserFavoriteSong(current_song_id_); }
|
|
|
|
void AddCurrentSongToUserLibrary() { AddUserLibrarySongs(QList<int>() << current_song_id_); }
|
2011-11-06 16:12:44 +01:00
|
|
|
void AddCurrentSongToPlaylist(QAction* action);
|
2011-11-23 01:07:40 +01:00
|
|
|
void UserFavoriteSongAdded(QNetworkReply* reply, int task_id);
|
2012-07-21 18:09:16 +02:00
|
|
|
void UserLibrarySongAdded(QNetworkReply* reply, int task_id);
|
2011-11-10 00:56:27 +01:00
|
|
|
void GetCurrentSongUrlToShare();
|
|
|
|
void SongUrlToShareReceived(QNetworkReply* reply);
|
2012-03-27 00:43:47 +02:00
|
|
|
void GetCurrentPlaylistUrlToShare();
|
|
|
|
void PlaylistUrlToShareReceived(QNetworkReply* reply);
|
2011-11-02 23:41:58 +01:00
|
|
|
void RemoveCurrentFromPlaylist();
|
|
|
|
void RemoveCurrentFromFavorites();
|
2012-07-21 18:09:16 +02:00
|
|
|
void RemoveCurrentFromLibrary();
|
|
|
|
void SongsRemovedFromFavorites(QNetworkReply* reply, int task_id);
|
|
|
|
void SongsRemovedFromLibrary(QNetworkReply* reply, int task_id);
|
2012-10-12 13:43:55 +02:00
|
|
|
void StreamMarked(QNetworkReply* reply);
|
|
|
|
void SongMarkedAsComplete(QNetworkReply* reply);
|
2011-09-02 00:28:11 +02:00
|
|
|
|
2012-01-08 18:46:50 +01:00
|
|
|
void RequestSslErrors(const QList<QSslError>& errors);
|
|
|
|
|
2011-11-23 23:56:02 +01:00
|
|
|
void Homepage();
|
2011-12-22 20:45:44 +01:00
|
|
|
// Refresh all Grooveshark's items, and re-fill them
|
|
|
|
void RefreshItems();
|
2011-09-30 15:35:09 +02:00
|
|
|
|
2011-09-02 00:28:11 +02:00
|
|
|
private:
|
|
|
|
void EnsureMenuCreated();
|
2011-09-22 19:54:59 +02:00
|
|
|
void EnsureItemsCreated();
|
2011-12-22 20:45:44 +01:00
|
|
|
void RemoveItems();
|
2011-09-02 00:28:11 +02:00
|
|
|
void EnsureConnected();
|
2012-06-27 01:21:57 +02:00
|
|
|
void ClearSearchResults();
|
2011-09-02 00:28:11 +02:00
|
|
|
|
2011-11-05 02:34:49 +01:00
|
|
|
// Create a playlist item, with data set as excepted. Doesn't fill the item
|
|
|
|
// with songs rows.
|
|
|
|
QStandardItem* CreatePlaylistItem(const QString& playlist_name, int playlist_id);
|
|
|
|
|
2011-09-13 22:32:10 +02:00
|
|
|
void AuthenticateSession();
|
2011-09-20 00:26:24 +02:00
|
|
|
void InitCountry();
|
2011-09-02 00:28:11 +02:00
|
|
|
|
|
|
|
// Create a request for the given method, with the given params.
|
|
|
|
// If need_authentication is true, add session_id to params.
|
|
|
|
// Returns the reply object created
|
2012-07-21 18:09:16 +02:00
|
|
|
QNetworkReply* CreateRequest(
|
|
|
|
const QString& method_name,
|
|
|
|
const QList<QPair<QString, QVariant> >& params,
|
|
|
|
bool use_https = false);
|
2011-11-29 13:57:35 +01:00
|
|
|
// Convenient function which block until 'reply' replies, or timeout after 10
|
|
|
|
// seconds. Returns false if reply has timeouted
|
|
|
|
bool WaitForReply(QNetworkReply* reply);
|
2012-03-27 00:43:47 +02:00
|
|
|
void ShowUrlBox(const QString& title, const QString& url);
|
2011-09-20 00:26:24 +02:00
|
|
|
// Convenient function for extracting result from reply
|
2011-09-13 22:32:10 +02:00
|
|
|
QVariantMap ExtractResult(QNetworkReply* reply);
|
2011-11-29 13:57:35 +01:00
|
|
|
// Convenient function for extracting songs from grooveshark result. result
|
|
|
|
// should be the "result" field of most Grooveshark replies
|
2011-09-24 12:06:31 +02:00
|
|
|
SongList ExtractSongs(const QVariantMap& result);
|
2011-11-29 13:57:35 +01:00
|
|
|
// Convenient function for extracting song from grooveshark result.
|
|
|
|
// result_song should be the song field ('song', 'nextSong', ...) of the
|
|
|
|
// Grooveshark reply
|
|
|
|
Song ExtractSong(const QVariantMap& result_song);
|
2011-11-02 23:41:58 +01:00
|
|
|
// Convenient functions for extracting Grooveshark songs ids
|
2011-10-30 23:59:43 +01:00
|
|
|
QList<int> ExtractSongsIds(const QVariantMap& result);
|
2011-11-02 23:41:58 +01:00
|
|
|
QList<int> ExtractSongsIds(const QList<QUrl>& urls);
|
|
|
|
int ExtractSongId(const QUrl& url); // Returns 0 if url is not a Grooveshark url
|
2012-05-16 01:30:18 +02:00
|
|
|
// Convenient function for extracting basic playlist info (only 'id' and
|
|
|
|
// 'name': QStandardItem still need to be created), and sort them by name
|
|
|
|
QList<PlaylistInfo> ExtractPlaylistInfo(const QVariantMap& result);
|
2011-11-02 23:41:58 +01:00
|
|
|
|
2011-09-13 22:32:10 +02:00
|
|
|
void ResetSessionId();
|
|
|
|
|
2011-09-02 00:28:11 +02:00
|
|
|
|
2011-10-05 21:59:15 +02:00
|
|
|
GroovesharkUrlHandler* url_handler_;
|
2011-09-24 12:06:31 +02:00
|
|
|
|
2011-09-20 19:12:06 +02:00
|
|
|
QString pending_search_;
|
2011-09-02 00:28:11 +02:00
|
|
|
|
2011-09-30 15:35:09 +02:00
|
|
|
int next_pending_search_id_;
|
|
|
|
|
2012-10-12 13:43:55 +02:00
|
|
|
QSet<int> pending_retrieve_playlists_;
|
2011-09-24 12:06:31 +02:00
|
|
|
|
2011-10-30 23:59:43 +01:00
|
|
|
QMap<int, PlaylistInfo> playlists_;
|
2011-11-25 01:00:58 +01:00
|
|
|
QMap<int, PlaylistInfo> subscribed_playlists_;
|
2011-10-30 23:59:43 +01:00
|
|
|
|
2011-09-02 00:28:11 +02:00
|
|
|
QStandardItem* root_;
|
|
|
|
QStandardItem* search_;
|
2011-11-19 18:56:29 +01:00
|
|
|
QStandardItem* popular_month_;
|
|
|
|
QStandardItem* popular_today_;
|
2011-11-29 13:57:35 +01:00
|
|
|
QStandardItem* stations_;
|
2011-11-29 23:52:19 +01:00
|
|
|
QStandardItem* grooveshark_radio_;
|
2011-11-02 00:02:49 +01:00
|
|
|
QStandardItem* favorites_;
|
2012-07-21 18:09:16 +02:00
|
|
|
// Grooveshark Library (corresponds to Grooveshark 'MyMusic' actually, but
|
|
|
|
// called 'Library' in the API).
|
|
|
|
// Nothing to do with Clementine's local library
|
|
|
|
QStandardItem* library_;
|
2012-06-27 01:21:57 +02:00
|
|
|
QStandardItem* playlists_parent_;
|
|
|
|
QStandardItem* subscribed_playlists_parent_;
|
2011-09-02 00:28:11 +02:00
|
|
|
|
|
|
|
NetworkAccessManager* network_;
|
|
|
|
|
|
|
|
QMenu* context_menu_;
|
2012-03-27 00:43:47 +02:00
|
|
|
// IDs kept when showing menu, to know what the user has clicked on, to be
|
|
|
|
// able to perform actions on corresponding items
|
2011-11-06 16:12:44 +01:00
|
|
|
int current_song_id_;
|
2012-03-27 00:43:47 +02:00
|
|
|
int current_playlist_id_;
|
2011-09-02 00:28:11 +02:00
|
|
|
|
2011-11-05 02:34:49 +01:00
|
|
|
QAction* create_playlist_;
|
|
|
|
QAction* delete_playlist_;
|
2011-11-28 21:59:25 +01:00
|
|
|
QAction* rename_playlist_;
|
2011-11-02 23:41:58 +01:00
|
|
|
QAction* remove_from_playlist_;
|
|
|
|
QAction* remove_from_favorites_;
|
2012-07-21 18:09:16 +02:00
|
|
|
QAction* remove_from_library_;
|
2012-03-26 23:57:26 +02:00
|
|
|
QAction* get_url_to_share_song_;
|
2012-03-27 00:43:47 +02:00
|
|
|
QAction* get_url_to_share_playlist_;
|
2011-11-06 16:12:44 +01:00
|
|
|
QList<QAction*> playlistitem_actions_;
|
2011-11-02 23:41:58 +01:00
|
|
|
|
2012-06-27 01:21:57 +02:00
|
|
|
SearchBoxWidget* search_box_;
|
|
|
|
|
2011-09-20 19:12:06 +02:00
|
|
|
QTimer* search_delay_;
|
|
|
|
QNetworkReply* last_search_reply_;
|
|
|
|
|
2011-09-13 22:32:10 +02:00
|
|
|
QString username_;
|
|
|
|
QString password_; // In fact, password's md5 hash
|
|
|
|
QString user_id_;
|
2011-09-02 00:28:11 +02:00
|
|
|
QString session_id_;
|
2011-09-20 00:26:24 +02:00
|
|
|
QMap<QString, QVariant> country_;
|
2011-11-29 23:52:19 +01:00
|
|
|
// The last artists and songs ids th users has listened to. Used for autoplay
|
|
|
|
QList<int> last_artists_ids_;
|
|
|
|
QList<int> last_songs_ids_;
|
2011-09-02 00:28:11 +02:00
|
|
|
QByteArray api_key_;
|
|
|
|
|
2011-09-13 22:32:10 +02:00
|
|
|
LoginState login_state_;
|
2011-11-01 13:00:27 +01:00
|
|
|
|
2011-11-23 01:07:40 +01:00
|
|
|
// Tasks' ids: we need to keep them in mind to be able to update task status
|
|
|
|
// on each step
|
|
|
|
int task_popular_id_;
|
|
|
|
int task_playlists_id_;
|
|
|
|
int task_search_id_;
|
|
|
|
|
2011-11-01 13:00:27 +01:00
|
|
|
static const char* kUrl;
|
|
|
|
static const char* kUrlCover;
|
2011-11-23 23:56:02 +01:00
|
|
|
static const char* kHomepage;
|
2011-11-01 13:00:27 +01:00
|
|
|
|
|
|
|
static const int kSongSearchLimit;
|
|
|
|
static const int kSongSimpleSearchLimit;
|
2013-08-28 22:20:58 +02:00
|
|
|
static const int kAlbumSearchLimit;
|
2011-11-01 13:00:27 +01:00
|
|
|
static const int kSearchDelayMsec;
|
|
|
|
|
|
|
|
static const char* kApiKey;
|
|
|
|
static const char* kApiSecret;
|
2011-09-02 00:28:11 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // GROOVESHARKSERVICE_H
|