-
Notifications
You must be signed in to change notification settings - Fork 0
/
templatewinamp.cpp
145 lines (133 loc) · 4.88 KB
/
templatewinamp.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
/* qmmp-htmlplaylist -- exports your playlist as a single HTML file
* Copyright (C) 2020 Georg Gadinger <nilsding@nilsding.org>
*
* 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 Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "templatewinamp.h"
// use `qmake-qt5 "DEFINES += TEMPLATE_WINAMP_ORIGINAL" ..` to use the original
// Winamp 2 stylesheet -- it seems to display nicely in IE6 only due to its CSS
// parser being a weird mess
QString TemplateWinamp::headerStart() const
{
return "<html>"
"<head>"
"<link rel=\"stylesheet\" href=\"null\">"
"<style TYPE=\"text/css\">"
"<!--"
"BODY { background: #000040; }\n"
".para1 { margin-top: -42px; margin-left: 145px; margin-right: 10px; "
#ifdef TEMPLATE_WINAMP_ORIGINAL
"font-family: \"font2, Arial\"; "
#else
"font-family: \"Arial\", sans-serif; "
#endif
"font-size: 30px; line-height: 35px; text-align: left; color: #E1E1E1; }\n"
".para2 { margin-top: 15px; margin-left: 15px; margin-right: 50px; "
#ifdef TEMPLATE_WINAMP_ORIGINAL
"font-family: \"font1, Arial Black\"; "
#else
"font-family: \"Arial Black\", sans-serif; "
#endif
"font-size: 50px; line-height: 40px; text-align: left; color: #004080; }\n"
"-->"
"</style>"
"<title>";
}
QString TemplateWinamp::headerEnd() const
{
return "</title>"
"</head>"
"<body BGCOLOR=\"#000080\" topmargin=\"0\" leftmargin=\"0\" text=\"#FFFFFF\">"
"<!--TOOLBAR_START--><!--TOOLBAR_EXEMPT-->\n"
"<div align=\"center\">"
"<div CLASS=\"para2\" align=\"center\"><p>WINAMP</p></div>"
"<div CLASS=\"para1\" align=\"center\">\n<p>playlist</p></div>"
"</div>"
"<hr align=\"left\" width=\"90%\" noshade size=\"1\" color=\"#FFBF00\">"
"<div align=\"right\">\n"
"<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"98%\">"
"<tr>"
"<td>";
}
QString TemplateWinamp::playlistStatsStart(int numberOfTracks, QString& averageTrackLength) const
{
return QString("<small>"
"<small>"
"<font face=\"Arial\" color=\"#FFBF00\">\n")
.append(QString::number(numberOfTracks))
.append("</font>"
"<font color=\"#409FFF\" face=\"Arial\"> tracks in playlist, average track length: </font>"
"<font face=\"Arial\" color=\"#FFBF00\">")
.append(averageTrackLength)
.append("</font>"
"</small>"
"</small>"
"<br>"
"<small>"
"<small>"
"<font color=\"#409FFF\" face=\"Arial\">Playlist length: </font>");
}
QString TemplateWinamp::playlistStatsTotalNumberSingleUnit(int count, QString& unit) const
{
return QString("<font face=\"Arial\" color=\"#FFBF00\">")
.append(QString::number(count))
.append("</font>"
"<font color=\"#409FFF\" face=\"Arial\"> ")
.append(unit)
.append(" </font>");
}
QString TemplateWinamp::playlistStatsRightClickToSave(QString& url) const
{
return QString("<BR>\n"
"<font color=\"#409FFF\" face=\"Arial\">Right-click <a href=\"")
.append(url)
.append("\">here</a> to save this HTML file.</font>");
}
QString TemplateWinamp::playlistStatsEnd() const
{
return "</small>"
"</small>"
"</td>"
"</tr>"
"</table>"
"</div>";
}
QString TemplateWinamp::playlistFilesStart() const
{
return "<blockquote>"
"<p>"
"<font color=\"#FFBF00\" face=\"Arial\">"
"<big>Playlist files:</big>"
"</font>"
"<ul>"
"<font face=\"Arial\" color=\"#FFFFFF\">"
"<small>"; // yes, that <small> is left open in the Winamp 2.7 output, too :-)
}
QString TemplateWinamp::playlistFilesEntry(QString& entry) const
{
return QString(entry).append("<BR>\n");
}
QString TemplateWinamp::playlistFilesEnd() const
{
return "</font>"
"</ul>"
"</blockquote>";
}
QString TemplateWinamp::footer() const
{
return "<hr align=\"left\" width=\"90%\" noshade size=\"1\" color=\"#FFBF00\">"
"</body>"
"</html>";
}