LeechCraft
0.6.70-13729-g7046a9d2a7
Modular cross-platform feature rich live environment.
audiostructs.h
Go to the documentation of this file.
1
/**********************************************************************
2
* LeechCraft - modular cross-platform feature rich internet client.
3
* Copyright (C) 2006-2014 Georg Rudoy
4
*
5
* Boost Software License - Version 1.0 - August 17th, 2003
6
*
7
* Permission is hereby granted, free of charge, to any person or organization
8
* obtaining a copy of the software and accompanying documentation covered by
9
* this license (the "Software") to use, reproduce, display, distribute,
10
* execute, and transmit the Software, and to prepare derivative works of the
11
* Software, and to permit third-parties to whom the Software is furnished to
12
* do so, all subject to the following:
13
*
14
* The copyright notices in the Software and this entire statement, including
15
* the above license grant, this restriction and the following disclaimer,
16
* must be included in all copies of the Software, in whole or in part, and
17
* all derivative works of the Software, unless such copies or derivative
18
* works are solely in the form of machine-executable object code generated by
19
* a source language processor.
20
*
21
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
* FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
24
* SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
25
* FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
26
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27
* DEALINGS IN THE SOFTWARE.
28
**********************************************************************/
29
30
#pragma once
31
32
#include <QStringList>
33
#include <QVariantMap>
34
#include <QUrl>
35
#include <
util/sll/eitherfwd.h
>
36
37
namespace
Media
38
{
41
struct
AudioInfo
42
{
45
QString
Artist_
;
46
49
QString
Album_
;
50
53
QString
Title_
;
54
57
QStringList
Genres_
;
58
61
qint32
Length_
= 0;
62
65
qint32
Year_
= 0;
66
69
qint32
TrackNumber_
= 0;
70
77
QVariantMap
Other_
;
78
81
inline
bool
operator==
(
const
AudioInfo
& other)
const
82
{
83
return
Artist_
== other.
Artist_
&&
84
Album_
== other.
Album_
&&
85
Title_
== other.
Title_
&&
86
Genres_
== other.
Genres_
&&
87
Length_
== other.
Length_
&&
88
Year_
== other.
Year_
&&
89
TrackNumber_
== other.
TrackNumber_
&&
90
Other_
== other.
Other_
;
91
}
92
95
inline
bool
operator!=
(
const
AudioInfo
& other)
const
96
{
97
return
!(*
this
== other);
98
}
99
};
100
103
struct
TagInfo
104
{
107
QString
Name_
;
108
};
109
112
typedef
QList<TagInfo>
TagInfos_t
;
113
116
struct
ArtistInfo
117
{
120
QString
Name_
;
121
124
QString
ShortDesc_
;
125
128
QString
FullDesc_
;
129
132
QUrl
Image_
;
133
136
QUrl
LargeImage_
;
137
146
QUrl
Page_
;
147
150
TagInfos_t
Tags_
;
151
};
152
166
struct
SimilarityInfo
167
{
170
ArtistInfo
Artist_
;
171
176
int
Similarity_
;
177
180
QStringList
SimilarTo_
;
181
};
182
185
using
SimilarityInfos_t
=
QList<SimilarityInfo>
;
186
187
using
SimilarityQueryResult_t
=
LC::Util::Either<QString, SimilarityInfos_t>
;
188
}
189
190
Q_DECLARE_METATYPE
(
Media::AudioInfo
)
191
Q_DECLARE_METATYPE
(
QList<Media::AudioInfo>
)
Media::TagInfo::Name_
QString Name_
Name of the tag.
Definition:
audiostructs.h:107
Media::AudioInfo::Length_
qint32 Length_
The length of this track in seconds.
Definition:
audiostructs.h:61
Media::TagInfos_t
QList< TagInfo > TagInfos_t
A list of tags.
Definition:
audiostructs.h:112
Media::AudioInfo::operator!=
bool operator!=(const AudioInfo &other) const
Returns whether this audio info isn't equal to another one.
Definition:
audiostructs.h:95
Media::AudioInfo
Describes a single audio track.
Definition:
audiostructs.h:41
Media::ArtistInfo::Page_
QUrl Page_
An URL to a page describing this artist.
Definition:
audiostructs.h:146
Media::ArtistInfo::FullDesc_
QString FullDesc_
Full artist description, not including the short description.
Definition:
audiostructs.h:128
Media::AudioInfo::Year_
qint32 Year_
The year of the Album_ this track is on.
Definition:
audiostructs.h:65
Media::ArtistInfo::ShortDesc_
QString ShortDesc_
Short artist description.
Definition:
audiostructs.h:124
Media::TagInfo
Information about a tag like a genre.
Definition:
audiostructs.h:103
Media::AudioInfo::Other_
QVariantMap Other_
Other fields of this audio info.
Definition:
audiostructs.h:77
Media::SimilarityInfo::Similarity_
int Similarity_
Similarity in percents.
Definition:
audiostructs.h:176
Media::ArtistInfo::Image_
QUrl Image_
An URL of a thumbnail artist image.
Definition:
audiostructs.h:132
Media::AudioInfo::operator==
bool operator==(const AudioInfo &other) const
Returns whether this audio info is equal to another one.
Definition:
audiostructs.h:81
Media::AudioInfo::TrackNumber_
qint32 TrackNumber_
The number of this track on the Album_.
Definition:
audiostructs.h:69
Media::SimilarityInfo::SimilarTo_
QStringList SimilarTo_
Names of the artists similar to this one.
Definition:
audiostructs.h:180
Media
Definition:
audiostructs.h:37
eitherfwd.h
Media::ArtistInfo
A structure describing an artist.
Definition:
audiostructs.h:116
Media::AudioInfo::Title_
QString Title_
The title of this track.
Definition:
audiostructs.h:53
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(QVariantList *)
Media::AudioInfo::Artist_
QString Artist_
The artist performing this track.
Definition:
audiostructs.h:45
Media::ArtistInfo::Tags_
TagInfos_t Tags_
Genres this artist plays in.
Definition:
audiostructs.h:150
QList< TagInfo >
LC::Util::Either
Definition:
either.h:45
Media::SimilarityInfo
Describes similarty information of an artist.
Definition:
audiostructs.h:166
Media::ArtistInfo::LargeImage_
QUrl LargeImage_
A bigger artist image.
Definition:
audiostructs.h:136
Media::ArtistInfo::Name_
QString Name_
The artist name.
Definition:
audiostructs.h:120
Media::AudioInfo::Album_
QString Album_
The album this track is on.
Definition:
audiostructs.h:49
Media::SimilarityInfo::Artist_
ArtistInfo Artist_
Information about artist this similary info is about.
Definition:
audiostructs.h:170
Media::AudioInfo::Genres_
QStringList Genres_
The genres of this track.
Definition:
audiostructs.h:57
src
interfaces
media
audiostructs.h
Generated by
1.8.14