TTKMusicPlayer  4.3.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
musicresultinfo.h
Go to the documentation of this file.
1 #ifndef MUSICRESULTINFO_H
2 #define MUSICRESULTINFO_H
3 
4 /***************************************************************************
5  * This file is part of the TTK Music Player project
6  * Copyright (C) 2015 - 2026 Greedysky Studio
7 
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 3 of the License, or
11  * (at your option) any later version.
12 
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17 
18  * You should have received a copy of the GNU General Public License along
19  * with this program; If not, see <http://www.gnu.org/licenses/>.
20  ***************************************************************************/
21 
22 #include "musicglobaldefine.h"
23 
28 {
29  QString m_songName;
30  QString m_artistName;
31  QString m_albumName;
32  QString m_duration;
33  QString m_type;
34 
36  : m_songName(TTK_DEFAULT_STR),
37  m_artistName(TTK_DEFAULT_STR),
38  m_albumName(TTK_DEFAULT_STR),
39  m_duration(TTK_DEFAULT_STR),
40  m_type(TTK_DEFAULT_STR)
41  {
42 
43  }
44 
46  : m_songName(info.m_songName),
47  m_artistName(info.m_artistName),
48  m_albumName(info.m_albumName),
49  m_duration(info.m_duration)
50  {
51 
52  }
53 
54  MusicResultInfoItem(const TTK::MusicSongInformation &info, const QString &type) noexcept
55  : MusicResultInfoItem(info)
56  {
57  m_type = type;
58  }
59 };
60 
65 {
66  QString m_id;
67  QString m_name;
68  QString m_title;
69  QString m_nickName;
70  QString m_coverUrl;
71  QString m_count;
72  QString m_description;
73  QString m_time;
74  QString m_category;
75 
77  : m_id(TTK_DEFAULT_STR),
78  m_name(TTK_DEFAULT_STR),
79  m_title(TTK_DEFAULT_STR),
80  m_nickName(TTK_DEFAULT_STR),
81  m_coverUrl(TTK_DEFAULT_STR),
82  m_count(TTK_DEFAULT_STR),
83  m_description(TTK_DEFAULT_STR),
84  m_time(TTK_DEFAULT_STR),
85  m_category(TTK_DEFAULT_STR)
86  {
87 
88  }
89 
90  inline bool isEmpty() const noexcept
91  {
92  return m_name == TTK_DEFAULT_STR || m_nickName == TTK_DEFAULT_STR || m_coverUrl == TTK_DEFAULT_STR || m_description == TTK_DEFAULT_STR || m_category == TTK_DEFAULT_STR;
93  }
94 };
96 
97 #endif // MUSICRESULTINFO_H
#define TTK_MODULE_EXPORT
The class of the search result data item.
MusicResultInfoItem(const TTK::MusicSongInformation &info) noexcept
#define TTK_DEFAULT_STR
Definition: ttkglobal.h:276
TTK_DECLARE_LIST(MusicResultDataItem)
MusicResultInfoItem() noexcept
bool isEmpty() const noexcept
MusicResultInfoItem(const TTK::MusicSongInformation &info, const QString &type) noexcept
The class of the search result info item.
MusicResultDataItem() noexcept
#define const
Definition: zconf.h:233
The class of the music song information.
Definition: musicobject.h:300