TTKMusicPlayer  4.2.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
MusicLrcFromKrc Class Reference

The class of the krc to lrc. More...

#include <musiclrcparser.h>

+ Inheritance diagram for MusicLrcFromKrc:

Public Member Functions

 MusicLrcFromKrc ()
 
 ~MusicLrcFromKrc ()
 
virtual bool decode (const QString &input) overridefinal
 
bool decode (const QString &input, const QString &output)
 
- Public Member Functions inherited from MusicLrcFromInterface
virtual ~MusicLrcFromInterface ()=default
 
const QByteArray & data () const noexcept
 

Protected Member Functions

int sncasecmp (char *s1, char *s2, size_t n)
 
int decompression (uchar *src, size_t srcsize, size_t *dstsize)
 
int isfilter (char *tok)
 
void createLrc (uchar *lrc, int lrclen)
 

Protected Attributes

uchar * m_resultBytes
 
- Protected Attributes inherited from MusicLrcFromInterface
QByteArray m_data
 

Detailed Description

The class of the krc to lrc.

Author
Greedysky greed.nosp@m.ysky.nosp@m.@163..nosp@m.com

Definition at line 69 of file musiclrcparser.h.

Constructor & Destructor Documentation

MusicLrcFromKrc::MusicLrcFromKrc ( )

Object constructor.

Definition at line 37 of file musiclrcparser.cpp.

MusicLrcFromKrc::~MusicLrcFromKrc ( )

Object destructor.

Definition at line 44 of file musiclrcparser.cpp.

References m_resultBytes.

Member Function Documentation

void MusicLrcFromKrc::createLrc ( uchar *  lrc,
int  lrclen 
)
protected

Create lrc by input data and length.

Definition at line 187 of file musiclrcparser.cpp.

References isfilter(), MusicLrcFromInterface::m_data, TTK_DN_H2MS, TTK_DN_M2MS, and TTK_DN_S2MS.

Referenced by decode().

bool MusicLrcFromKrc::decode ( const QString &  input)
finaloverridevirtual

Decode file to lrc by input file.

Implements MusicLrcFromInterface.

Definition at line 49 of file musiclrcparser.cpp.

Referenced by MusicLrcAnalysis::loadFromFile(), and MusicTransformWidget::processTransform().

bool MusicLrcFromKrc::decode ( const QString &  input,
const QString &  output 
)

Decode krc file to lrc by input file and output file.

Definition at line 54 of file musiclrcparser.cpp.

References createLrc(), decompression(), key, MusicLrcFromInterface::m_data, m_resultBytes, qPrintable, QtNamespace, TTK_ERROR_STREAM, and TTKStaticCast.

int MusicLrcFromKrc::decompression ( uchar *  src,
size_t  srcsize,
size_t *  dstsize 
)
protected

Decompress the krc file data to normal data.

Definition at line 144 of file musiclrcparser.cpp.

References m_resultBytes, TTK_SN_MB2BT, uncompress(), and Z_OK.

Referenced by decode().

int MusicLrcFromKrc::isfilter ( char *  tok)
protected

Check the input string is filtered or not.

Definition at line 154 of file musiclrcparser.cpp.

References sncasecmp(), and TTKConstCast.

Referenced by createLrc().

int MusicLrcFromKrc::sncasecmp ( char *  s1,
char *  s2,
size_t  n 
)
protected

Sncasecmp by input and size n.

Definition at line 119 of file musiclrcparser.cpp.

Referenced by isfilter().

Member Data Documentation

uchar* MusicLrcFromKrc::m_resultBytes
protected

Definition at line 109 of file musiclrcparser.h.

Referenced by decode(), decompression(), and ~MusicLrcFromKrc().


The documentation for this class was generated from the following files: