1bf0c3a3aSlifegpc #pragma once 21596c33dSlifegpc #include "SongInfo.h" 3bf0c3a3aSlifegpc 4bf0c3a3aSlifegpc class LastFMTrack { 5bf0c3a3aSlifegpc public: 6bf0c3a3aSlifegpc /// The artist name. 7bf0c3a3aSlifegpc wstring artist; 8bf0c3a3aSlifegpc /// The track name. 9bf0c3a3aSlifegpc wstring track; 10bf0c3a3aSlifegpc /// The time the track started playing, in UNIX timestamp format (integer number of seconds since 00:00:00, January 1st 1970 UTC). This must be in the UTC time zone. 11bf0c3a3aSlifegpc uint64_t timestamp; 12bf0c3a3aSlifegpc /// The album name. 13bf0c3a3aSlifegpc wstring album; 14bf0c3a3aSlifegpc /// The stream id for this track received from the radio.getPlaylist service, if scrobbling Last.fm radio 15bf0c3a3aSlifegpc wstring streamId; 16bf0c3a3aSlifegpc /// Set to 1 if the user chose this song, or 0 if the song was chosen by someone else (such as a radio station or recommendation service). Assumes 1 if not specified 17bf0c3a3aSlifegpc bool chosenByUser = true; 18bf0c3a3aSlifegpc /// The track number of the track on the album. 19bf0c3a3aSlifegpc uint16_t trackNumber; 20bf0c3a3aSlifegpc /// The MusicBrainz Track ID. 21bf0c3a3aSlifegpc wstring mbid; 22bf0c3a3aSlifegpc /// The album artist - if this differs from the track artist. 23bf0c3a3aSlifegpc wstring albumArtist; 24bf0c3a3aSlifegpc /// The length of the track in seconds. 25bf0c3a3aSlifegpc Time duration; 261596c33dSlifegpc void Clear(); 27bf0c3a3aSlifegpc void SaveDataTo(CArchive &archive); 28bf0c3a3aSlifegpc void ReadDataFrom(CArchive &archive); 29*7a904577Slrisora void ReadDataFrom(const SongInfo& info); 3089c4b514Slifegpc bool operator==(const LastFMTrack& track); 31040c544fSlifegpc bool operator==(const SongInfo& info); 32bf0c3a3aSlifegpc }; 33bf0c3a3aSlifegpc 34bf0c3a3aSlifegpc class LastFMDataArchive { 35bf0c3a3aSlifegpc public: 36bf0c3a3aSlifegpc /// The origin track information of current track. 37bf0c3a3aSlifegpc LastFMTrack current_track; 38bf0c3a3aSlifegpc /// The track information of current track after corrected. 39bf0c3a3aSlifegpc LastFMTrack corrected_current_track; 40bf0c3a3aSlifegpc /// The list of tracks are not scrobbed. 4145230f77Slrisora std::list<LastFMTrack> cached_tracks; 42bf0c3a3aSlifegpc /// A session key generated by authenticating a user via the authentication protocol. 43bf0c3a3aSlifegpc wstring session_key; 449b620a10Slifegpc /// User name 459b620a10Slifegpc wstring user_name; 462c5259deSlifegpc /// The played time for current song in millisecond. 4768b9087aSlifegpc int32_t current_played_time; 4868b9087aSlifegpc /// The current song is pushed to cache list or not. 4968b9087aSlifegpc bool is_pushed; 50bf0c3a3aSlifegpc void SaveData(wstring path); 51bf0c3a3aSlifegpc void LoadData(wstring path); 52bf0c3a3aSlifegpc }; 53