-
Notifications
You must be signed in to change notification settings - Fork 0
/
pandorasong.cpp
122 lines (91 loc) · 1.95 KB
/
pandorasong.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#include "pandorasong.h"
PandoraSong::PandoraSong(PianoSong_t song)
{
artist = song.artist;
stationId = song.stationId;
album = song.album;
audioUrl = song.audioUrl;
coverArt = song.coverArt;
musicId = song.musicId;
title = song.title;
seedId = song.seedId;
feedbackId = song.feedbackId;
detailUrl = song.detailUrl;
trackToken = song.trackToken;
fileGain = song.fileGain;
rating = song.rating;
format = song.audioFormat;
songDownloaded = false;
albumArtDownloaded = false;
}
char* PandoraSong::getAlbum()
{
return album;
}
char* PandoraSong::getArtist()
{
return artist;
}
char* PandoraSong::getTitle()
{
return title;
}
QString PandoraSong::toString()
{
QString retString ("");
retString.append(artist);
retString.append(" - ");
retString.append(title);
retString.append(" - ");
retString.append(album);
return retString;
}
QString PandoraSong::toShortString()
{
QString retString ("");
retString.append(artist);
retString.append(" - ");
retString.append(title);
return retString;
}
QString PandoraSong::getAudioURL()
{
QString* AudioUrl = new QString(this->audioUrl);
return *AudioUrl;
}
QString PandoraSong::getAlbumArtURL()
{
QString* AlbumArtURL = new QString(this->coverArt);
return *AlbumArtURL;
}
bool PandoraSong::isSongBanned()
{
return rating == PIANO_RATE_BAN;
}
bool PandoraSong::isSongLoved()
{
return rating == PIANO_RATE_LOVE;
}
bool PandoraSong::isSongNeutral()
{
return rating == PIANO_RATE_NONE;
}
PianoSong_t PandoraSong::toPianoSong()
{
PianoSong_t song;
song.artist = artist;
song.stationId = stationId;
song.album = album;
song.audioUrl = audioUrl;
song.coverArt = coverArt;
song.musicId = musicId;
song.title = title;
song.seedId = seedId;
song.feedbackId = feedbackId;
song.detailUrl = detailUrl;
song.trackToken = trackToken;
song.fileGain = fileGain;
song.rating = rating;
song.audioFormat = format;
return song;
}