TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
TTK Namespace Reference

The namespace of the process utils. More...

Namespaces

 Algorithm
 
 Codec
 
 Core
 
 File
 
 Image
 
 Number
 
 String
 
 TTKQmmp
 
 UI
 
 Url
 
 Widget
 

Classes

struct  IndexProperty
 The class of the index property. More...
 
struct  MusicArtistProperty
 The class of the music artist property. More...
 
struct  MusicSongInformation
 The class of the music song information. More...
 
struct  MusicSongProperty
 The class of the music song property. More...
 

Typedefs

template<typename T >
using remove_cvr = typename std::remove_cv< typename std::remove_reference< T >::type >::type
 

Enumerations

enum  NetworkCode { NetworkCode::Query = 0xFF00, NetworkCode::Success = 0, NetworkCode::Error = -1, NetworkCode::UnKnow = 2 }
 
enum  ScopeGuardOnExit
 
enum  Direction {
  Direction::No = 0, Direction::Left = 1, Direction::Top = 2, Direction::Right = 4,
  Direction::Bottom = 8, Direction::LeftTop = Direction::Left | Direction::Top, Direction::LeftBottom = Direction::Left | Direction::Bottom, Direction::RightTop = Direction::Right | Direction::Top,
  Direction::RightBottom = Direction::Right | Direction::Bottom
}
 
enum  PlayState { PlayState::Stopped, PlayState::Playing, PlayState::Paused }
 
enum  PlayMode {
  PlayMode::Order, PlayMode::Random, PlayMode::ListLoop, PlayMode::OneLoop,
  PlayMode::Once
}
 
enum  FontStyleMode {
  FontStyleMode::Bold = 0x0001, FontStyleMode::Italic = 0x0002, FontStyleMode::Underline = 0x0004, FontStyleMode::Overline = 0x0008,
  FontStyleMode::StrikeOut = 0x0010, FontStyleMode::FixedPitch = 0x0020, FontStyleMode::Kerningt = 0x0040
}
 
enum  QueryQuality {
  QueryQuality::None, QueryQuality::Standard, QueryQuality::High, QueryQuality::Super,
  QueryQuality::Lossless
}
 
enum  Download {
  Download::Music, Download::Lrc, Download::Cover, Download::Background,
  Download::Video, Download::Other
}
 
enum  Record { Record::NormalDownload, Record::CloudDownload, Record::CloudUpload, Record::Null }
 
enum  Program { Program::Recommed, Program::Rank }
 
enum  Mode { Mode::Check, Mode::Apply }
 

Functions

template<typename _Tp >
constexpr const _Tp & min (const _Tp &a, const _Tp &b)
 
template<typename _Tp >
constexpr const _Tp & max (const _Tp &a, const _Tp &b)
 
TTK_MODULE_EXPORT void killProcessByName (const QString &process)
 
TTK_MODULE_EXPORT void killProcessByName (const QStringList &processes)
 
TTK_MODULE_EXPORT void makeContentTypeHeader (QNetworkRequest *request, const QByteArray &data={})
 
TTK_MODULE_EXPORT void makeUserAgentHeader (QNetworkRequest *request, const QByteArray &data={})
 
TTK_MODULE_EXPORT qint64 queryFileSizeByUrl (const QString &url)
 
TTK_MODULE_EXPORT void setSslConfiguration (QNetworkRequest *request, QSslSocket::PeerVerifyMode mode=QSslSocket::VerifyNone)
 
TTK_MODULE_EXPORT QByteArray syncNetworkQueryForGet (QNetworkRequest *request)
 
TTK_MODULE_EXPORT QByteArray syncNetworkQueryForPost (QNetworkRequest *request, const QByteArray &data)
 
template<typename T , typename... Args>
TTKAny make_any (Args &&...args)
 
template<typename T , typename _TYPE = remove_cvr<T>>
_TYPE any_cast (const TTKAny &other)
 
template<typename T , typename _TYPE = remove_cvr<T>>
_TYPE any_cast (TTKAny &other)
 
template<typename T , typename _TYPE = remove_cvr<T>>
_TYPE any_cast (TTKAny &&other)
 
template<typename T , typename _TYPE = remove_cvr<T>>
_TYPE any_cast (const TTKAny *const other) noexcept
 
template<typename T , typename _TYPE = remove_cvr<T>>
_TYPE any_cast (TTKAny *const other) noexcept
 
static bool isBase64 (unsigned char c)
 
static TTKString base64Encode (const unsigned char *bytes, unsigned int length)
 
static TTKString base64Decode (const TTKString &bytes)
 
TTK_MODULE_EXPORT void setApplicationFont ()
 
TTK_MODULE_EXPORT void setBorderShadow (QWidget *widget, QPainter *painter)
 
TTK_MODULE_EXPORT void initRandom ()
 
TTK_MODULE_EXPORT int random (int value=RAND_MAX)
 
static QString applicationPath ()
 
static bool endWith (const TTKString &value, const TTKString &tail)
 
 TTK_DECLARE_LIST (IndexProperty)
 
 TTK_DECLARE_LIST (MusicSongProperty)
 
 TTK_DECLARE_LIST (MusicArtistProperty)
 
 TTK_DECLARE_LIST (MusicSongInformation)
 
static QString configPath ()
 
static quint64 directorySize (const QString &dirName)
 
static void checkCacheSize ()
 
static QString languageCore (int index)
 
static QString languageQmmp (int index)
 
TTK_MODULE_EXPORT bool playlistRowValid (int index)
 
TTK_MODULE_EXPORT QString trackRelatedPath (const QString &path)
 
TTK_MODULE_EXPORT QString generateSongName (const QString &title, const QString &artist)
 
TTK_MODULE_EXPORT QString generateSongTitle (const QString &name, const QString &key=TTK_DEFAULT_STR)
 
TTK_MODULE_EXPORT QString generateSongArtist (const QString &name, const QString &key=TTK_DEFAULT_STR)
 
TTK_MODULE_EXPORT MusicSongList generateSongList (const QString &path)
 
TTK_MODULE_EXPORT QString generateNetworkSongTime (const QString &path)
 
TTK_MODULE_EXPORT QString generateNetworkSongPath (const QString &path)
 
static bool isCoverValid (const QString &url)
 
TTK_MODULE_EXPORT QString toString (Record type)
 
MusicLrcColor mapIndexToColor (MusicLrcColor::Color index)
 
QList< QColor > readColorConfig (const QString &value)
 
QString writeColorConfig (const QList< QColor > &colors)
 
static QString generateArtist (const QString &v)
 
static QString generateAlbum (const QString &v)
 
static QString generateYear (const QString &v)
 
static QString generateGenre (const QString &v)
 
TTK_MODULE_EXPORT QStringList supportAssociations ()
 
TTK_MODULE_EXPORT QStringList unsupportAssociations ()
 

Variables

static const char * base64_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
 

Detailed Description

The namespace of the process utils.

The namespace of the association helper.

The namespace of the application ui object.

The namespace of the lrc color helper.

The namespace of the utils widget.

The namespace of the utils url.

The namespace of the utils string.

The namespace of the utils ttk qmmp.

The namespace of the utils number.

The namespace of the utils image.

The namespace of the utils file.

The namespace of the utils core.

The namespace of the utils codec.

The namespace of the utils algorithm.

The namespace of the mode type data.

The namespace of the record type helper.

The namespace of the program type.

The namespace of the cover helper.

The namespace of the playlist helper.

The namespace of the application object.

The namespace of the random helper.

The namespace of the global defines.

The namespace of the global helper.

The namespace of the defer helper.

The namespace of the any helper.

The namespace of the network helper.

The namespace of the network data.

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

Typedef Documentation

template<typename T >
using TTK::remove_cvr = typedef typename std::remove_cv<typename std::remove_reference<T>::type>::type

Definition at line 164 of file ttkany.h.

Enumeration Type Documentation

enum TTK::Direction
strong
Enumerator
No 
Left 
Top 
Right 
Bottom 
LeftTop 
LeftBottom 
RightTop 
RightBottom 

Definition at line 27 of file ttklibrary.h.

enum TTK::Download
strong
Enumerator
Music 

type of dwonlaod music

Lrc 

type of dwonlaod lrc

Cover 

type of dwonlaod cover

Background 

type of dwonlaod background

Video 

type of dwonlaod video

Other 

type of dwonlaod other user mod

Definition at line 27 of file musicnetworkdefines.h.

enum TTK::FontStyleMode
strong
Enumerator
Bold 

font bold mode

Italic 

font italic mode

Underline 

font underline mode

Overline 

font overline mode

StrikeOut 

font strikeOut mode

FixedPitch 

font fixedPitch mode

Kerningt 

font kerningt mode

Definition at line 180 of file musicobject.h.

enum TTK::Mode
strong
Enumerator
Check 

Song Check Mode

Apply 

Song Apply Mode

Definition at line 29 of file musicsongchecktoolsunit.h.

enum TTK::NetworkCode
strong
Enumerator
Query 

Network state query

Success 

Network state success

Error 

Network state error

UnKnow 

Network state unknow

Definition at line 33 of file ttkabstractnetwork.h.

enum TTK::PlayMode
strong
Enumerator
Order 

play order mode

Random 

play random mode

ListLoop 

play list loop mode

OneLoop 

play single loop mode

Once 

play just once mode

Definition at line 171 of file musicobject.h.

enum TTK::PlayState
strong
Enumerator
Stopped 

stop state

Playing 

play state

Paused 

pause state

Definition at line 164 of file musicobject.h.

enum TTK::Program
strong
Enumerator
Recommed 
Rank 

Definition at line 29 of file musicdjradioprogramrequest.h.

enum TTK::QueryQuality
strong
Enumerator
None 

none quality

Standard 

sd quality

High 

hq quality

Super 

sq quality

Lossless 

cd quality

Definition at line 191 of file musicobject.h.

enum TTK::Record
strong
Enumerator
NormalDownload 

Local Download File Config

CloudDownload 

Cloud Download File Config

CloudUpload 

Cloud Upload Failed File Config

Null 

None File Config

Definition at line 37 of file musicnetworkdefines.h.

enum TTK::ScopeGuardOnExit
strong

Definition at line 71 of file ttkdefer.h.

Function Documentation

template<typename T , typename _TYPE = remove_cvr<T>>
_TYPE TTK::any_cast ( const TTKAny other)
inline

Make any cast helper.

Definition at line 170 of file ttkany.h.

References TTKAny::cast(), and TTKAny::isSame().

template<typename T , typename _TYPE = remove_cvr<T>>
_TYPE TTK::any_cast ( TTKAny other)
inline

Make any cast helper.

Definition at line 178 of file ttkany.h.

References TTKAny::cast(), and TTKAny::isSame().

template<typename T , typename _TYPE = remove_cvr<T>>
_TYPE TTK::any_cast ( TTKAny &&  other)
inline

Make any cast helper.

Definition at line 186 of file ttkany.h.

template<typename T , typename _TYPE = remove_cvr<T>>
_TYPE TTK::any_cast ( const TTKAny *const  other)
inlinenoexcept

Make any cast helper.

Definition at line 194 of file ttkany.h.

template<typename T , typename _TYPE = remove_cvr<T>>
_TYPE TTK::any_cast ( TTKAny *const  other)
inlinenoexcept

Make any cast helper.

Definition at line 202 of file ttkany.h.

static QString TTK::applicationPath ( )
inlinestatic

Get application work dir.

Definition at line 44 of file ttkqtobject.h.

References TTK_SEPARATOR.

Referenced by TTK::TTKQmmp::pluginPath(), and MusicSettingWidget::saveParameterSettings().

TTKString TTK::base64Decode ( const TTKString bytes)
static

Bse64 decode.

Definition at line 79 of file ttkcryptographichash.cpp.

References base64_chars, and isBase64().

Referenced by TTKCryptographicHash::xxteaDecrypt().

TTKString TTK::base64Encode ( const unsigned char *  bytes,
unsigned int  length 
)
static

Bse64 encode.

Definition at line 29 of file ttkcryptographichash.cpp.

References base64_chars.

Referenced by TTKCryptographicHash::xxteaEncrypt().

void TTK::checkCacheSize ( )
static
static QString TTK::configPath ( )
inlinestatic

Get application config dir.

Definition at line 303 of file musicobject.h.

References MAIN_DIR_FULL, and TTK_SEPARATOR.

quint64 TTK::directorySize ( const QString &  dirName)
static

Generate input directory size.

Definition at line 34 of file musicruntimemanager.cpp.

References qAsConst.

Referenced by checkCacheSize().

static bool TTK::endWith ( const TTKString value,
const TTKString tail 
)
static

Definition at line 13 of file ttkrunobject.cpp.

Referenced by TTKRunObject::run().

static QString TTK::generateAlbum ( const QString &  v)
inlinestatic

Generate song album.

Definition at line 31 of file musiclocalmanagerwidget.cpp.

Referenced by MusicLocalManagerWidget::refreshItems().

static QString TTK::generateArtist ( const QString &  v)
inlinestatic

Generate song artist.

Definition at line 24 of file musiclocalmanagerwidget.cpp.

Referenced by MusicLocalManagerWidget::refreshItems().

static QString TTK::generateGenre ( const QString &  v)
inlinestatic

Generate song genre.

Definition at line 45 of file musiclocalmanagerwidget.cpp.

Referenced by MusicLocalManagerWidget::refreshItems().

QString TTK::generateNetworkSongPath ( const QString &  path)
QString TTK::generateNetworkSongTime ( const QString &  path)

Generate network song play time.

Definition at line 176 of file musicsong.cpp.

References MusicSongMeta::duration(), generateNetworkSongPath(), MusicSongMeta::read(), and TTK_DEFAULT_STR.

Referenced by MusicTKPLConfigManager::writeBuffer().

QString TTK::generateSongArtist ( const QString &  name,
const QString &  key = TTK_DEFAULT_STR 
)
MusicSongList TTK::generateSongList ( const QString &  path)
QString TTK::generateSongName ( const QString &  title,
const QString &  artist 
)
QString TTK::generateSongTitle ( const QString &  name,
const QString &  key = TTK_DEFAULT_STR 
)
static QString TTK::generateYear ( const QString &  v)
inlinestatic

Generate song year.

Definition at line 38 of file musiclocalmanagerwidget.cpp.

Referenced by MusicLocalManagerWidget::refreshItems().

void TTK::initRandom ( )
static bool TTK::isBase64 ( unsigned char  c)
inlinestatic

Char is base64 or not.

Definition at line 13 of file ttkcryptographichash.cpp.

References isalnum.

Referenced by base64Decode().

static bool TTK::isCoverValid ( const QString &  url)
inlinestatic
TTK_MODULE_EXPORT void TTK::killProcessByName ( const QString &  process)

Kill process by name.

Referenced by cleanupCache(), and MusicCoreMPlayer::closeModule().

TTK_MODULE_EXPORT void TTK::killProcessByName ( const QStringList &  processes)

Kill process by name list.

QString TTK::languageCore ( int  index)
static

Generate core language resource.

Definition at line 82 of file musicruntimemanager.cpp.

References LANGUAGE_DIR_FULL.

Referenced by MusicRunTimeManager::translator().

QString TTK::languageQmmp ( int  index)
static

Generate qmmp language resource.

Definition at line 94 of file musicruntimemanager.cpp.

References LANGUAGE_DIR_FULL.

Referenced by MusicRunTimeManager::translator().

template<typename T , typename... Args>
TTKAny TTK::make_any ( Args &&...  args)
inline

Make any helper.

Definition at line 158 of file ttkany.h.

References T.

void TTK::makeContentTypeHeader ( QNetworkRequest *  request,
const QByteArray &  data = {} 
)
void TTK::makeUserAgentHeader ( QNetworkRequest *  request,
const QByteArray &  data = {} 
)
MusicLrcColor TTK::mapIndexToColor ( MusicLrcColor::Color  index)
template<typename _Tp >
constexpr const _Tp& TTK::max ( const _Tp &  a,
const _Tp &  b 
)
inline
template<typename _Tp >
constexpr const _Tp& TTK::min ( const _Tp &  a,
const _Tp &  b 
)
inline
bool TTK::playlistRowValid ( int  index)
qint64 TTK::queryFileSizeByUrl ( const QString &  url)
int TTK::random ( int  value = RAND_MAX)
QList< QColor > TTK::readColorConfig ( const QString &  value)
void TTK::setApplicationFont ( )

Set application font.

Definition at line 10 of file ttkglobalhelper.cpp.

References TTK_INFO_STREAM.

Referenced by main().

void TTK::setBorderShadow ( QWidget *  widget,
QPainter *  painter 
)
void TTK::setSslConfiguration ( QNetworkRequest *  request,
QSslSocket::PeerVerifyMode  mode = QSslSocket::VerifyNone 
)
QStringList TTK::supportAssociations ( )

Get current support association files.

Definition at line 125 of file musicfileassociationwidget.cpp.

References MusicFormats::supportMusicFormats(), and unsupportAssociations().

Referenced by MusicApplicationModule::applyParameter().

QByteArray TTK::syncNetworkQueryForGet ( QNetworkRequest *  request)
QByteArray TTK::syncNetworkQueryForPost ( QNetworkRequest *  request,
const QByteArray &  data 
)
QString TTK::toString ( Record  type)

Mapping file path from enum type.

Definition at line 3 of file musicdownloadrecordconfigmanager.cpp.

References CLOUD_DOWN_PATH_FULL, CLOUD_UP_PATH_FULL, CloudDownload, CloudUpload, NORMAL_DOWN_PATH_FULL, and NormalDownload.

Referenced by MusicKGQueryPlaylistRequest::downloadDetailsFinished(), MusicWYQueryPlaylistRequest::downloadDetailsFinished(), MusicKWQueryPlaylistRequest::downloadDetailsFinished(), MusicDJRadioProgramCategoryRequest::downloadDetailsFinished(), MusicMVRadioCategoryRequest::downLoadFinished(), MusicMVRadioProgramRequest::downLoadFinished(), MusicKWDiscoverListRequest::downLoadFinished(), MusicKWDownLoadTextRequest::downLoadFinished(), MusicBarrageRequest::downLoadFinished(), MusicResourceRequest::downLoadFinished(), MusicDownloadBingSkinRequest::downLoadFinished(), MusicBDTranslationRequest::downLoadFinished(), MusicBingTranslationRequest::downLoadFinished(), MusicKWSongCommentsRequest::downLoadFinished(), MusicSongRecommendRequest::downLoadFinished(), MusicKGSongCommentsRequest::downLoadFinished(), MusicKGQueryArtistRequest::downLoadFinished(), MusicSongSuggestRequest::downLoadFinished(), MusicWYQueryAlbumRequest::downLoadFinished(), MusicWYQueryArtistRequest::downLoadFinished(), MusicKWQueryAlbumRequest::downLoadFinished(), MusicKGQueryArtistListRequest::downLoadFinished(), MusicKWQueryArtistRequest::downLoadFinished(), MusicFMRadioSongRequest::downLoadFinished(), MusicKWQueryToplistRequest::downLoadFinished(), MusicKGQueryToplistRequest::downLoadFinished(), MusicWYQueryToplistRequest::downLoadFinished(), MusicWYQueryMovieRequest::downLoadFinished(), MusicWYQueryRequest::downLoadFinished(), MusicKGQueryMovieRequest::downLoadFinished(), MusicKWQueryMovieRequest::downLoadFinished(), MusicKGQueryRequest::downLoadFinished(), MusicKWQueryRequest::downLoadFinished(), MusicDownloadBirdSkinRequest::downLoadFinished(), MusicKWQueryPlaylistRequest::downLoadFinished(), MusicIdentifySongRequest::downLoadFinished(), MusicKWPlaylistCommentsRequest::downLoadFinished(), MusicKGPlaylistCommentsRequest::downLoadFinished(), MusicKGQueryArtistAlbumRequest::downLoadFinished(), MusicWYQueryArtistAlbumRequest::downLoadFinished(), MusicKWQueryArtistAlbumRequest::downLoadFinished(), MusicKWQueryPlaylistRequest::downloadMoreDetailsFinished(), MusicKWQueryRequest::downLoadSingleFinished(), MusicKGQueryRequest::downLoadSingleFinished(), MusicWYQueryRequest::downLoadSingleFinished(), MusicUnityQueryMovieRequest::downLoadUnityFinished(), MusicTranslationRequest::findAllPlugins(), MusicMPRISPlayerCore::metadata(), ReqKWInterface::parseFromMovieInfo(), MusicWYQueryMovieRequest::parseFromMovieList(), ReqKGInterface::parseFromMovieProperty(), ReqKGInterface::parseFromSongAlbumInfo(), ReqKGInterface::parseFromSongAlbumLrc(), ReqLQInterface::parseFromSongProperty(), MusicWYQueryMovieRequest::parseFromVideoList(), MusicKWQueryArtistRequest::queryArtistIntro(), MusicWYQueryArtistRequest::queryArtistIntro(), MusicJSPFConfigManager::readBuffer(), MusicKGQueryPlaylistRequest::startToQueryInfo(), MusicWYTranslationRequest::startToRequest(), MusicDownloadWidget::startToRequestMusic(), MusicAbstractDownloadTableWidget::updateSongsList(), QHttpResponsePrivate::writeHeaders(), and MusicAbstractDownloadTableWidget::~MusicAbstractDownloadTableWidget().

QString TTK::trackRelatedPath ( const QString &  path)

Remove track info in path.

Definition at line 100 of file musicsong.cpp.

References MusicFormats::isTrack().

Referenced by MusicSong::MusicSong(), and MusicFileInformationWidget::openFileDir().

TTK::TTK_DECLARE_LIST ( IndexProperty  )
TTK::TTK_DECLARE_LIST ( MusicSongProperty  )
TTK::TTK_DECLARE_LIST ( MusicArtistProperty  )
TTK::TTK_DECLARE_LIST ( MusicSongInformation  )
QStringList TTK::unsupportAssociations ( )

Get current unsupport association files.

Definition at line 139 of file musicfileassociationwidget.cpp.

References MusicSettingManager::FileAssociationValue, and G_SETTING_PTR.

Referenced by MusicApplicationModule::applyParameter(), and supportAssociations().

QString TTK::writeColorConfig ( const QList< QColor > &  colors)

Transform color list to colors string.

Definition at line 143 of file musiclrcmanager.cpp.

References qAsConst.

Referenced by MusicSettingWidget::saveParameterSettings().

Variable Documentation

const char* TTK::base64_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
static

Definition at line 8 of file ttkcryptographichash.cpp.

Referenced by base64Decode(), and base64Encode().