9 static constexpr
wchar_t key[] = {
10 L
'@', L
'G', L
'a', L
'w', L
'^', L
'2',
11 L
't', L
'G', L
'Q', L
'6', L
'1', L
'-',
12 L
'Î', L
'Ò', L
'n', L
'i'
32 if((fp = fopen(
qPrintable(input),
"rb")) ==
nullptr)
38 if(fstat(fileno(fp), &st))
45 uchar *src =
new uchar[st.st_size];
46 if(fread(src,
sizeof(uchar), st.st_size, fp) != (
size_t)st.st_size)
54 if(memcmp(src,
"krc1", 4) != 0)
63 for(
int i = 0; i < st.st_size; ++i)
65 src[i] = (uchar)(src[i] ^
key[i % 16]);
77 if(file.open(QIODevice::WriteOnly))
79 QTextStream outstream(&file);
80 outstream.setCodec(
"UTF-8");
102 c1 = (c1 >=
'A' && c1 <=
'Z') ? (c1 | 0x20) : c1;
103 c2 = (c2 >=
'A' && c2 <=
'Z') ? (c2 | 0x20) : c2;
166 for(
int i = 0; i < lrclen; ++i)
177 len = (strchr((
char*)&lrc[i],
']') - (
char*)&lrc[i]) + 1;
178 for(
int j = 0; j < len; ++j)
180 if(lrc[i + j] ==
':')
184 while(lrc[++i] !=
'\n' && i < lrclen)
193 for(
int j = 0; j < len; ++j)
196 if(lrc[i + j] ==
',')
200 ms = atoi((
char*)&lrc[i + 1]);
203 for(j = 0; j < 10; ++j)
219 else if(top == 1 && lrc[i] ==
'>')
#define TTKStaticCast(x, y)
#define TTKConstCast(x, y)
int ZEXPORT uncompress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)
static constexpr wchar_t key[]
QByteArray decodeString() const
int sncasecmp(char *s1, char *s2, size_t n)
#define QtNamespace(p)
Qt use namespace.
void createLrc(uchar *lrc, int lrclen)
int decompression(uchar *src, size_t srcsize, size_t *dstsize)
#define TTK_ERROR_STREAM(msg)
bool decode(const QString &input, const QString &output={})