1 | /* |
2 | * BluezQt - Asynchronous BlueZ wrapper library |
3 | * |
4 | * SPDX-FileCopyrightText: 2015 David Rosca <nowrep@gmail.com> |
5 | * |
6 | * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL |
7 | */ |
8 | |
9 | #ifndef BLUEZQT_MEDIAPLAYERTRACK_H |
10 | #define BLUEZQT_MEDIAPLAYERTRACK_H |
11 | |
12 | #include <QSharedPointer> |
13 | #include <QString> |
14 | |
15 | #include "bluezqt_export.h" |
16 | |
17 | namespace BluezQt |
18 | { |
19 | /** |
20 | * @class BluezQt::MediaPlayerTrack mediaplayertrack.h <BluezQt/MediaPlayerTrack> |
21 | * |
22 | * Media player track. |
23 | * |
24 | * This class represents a track in media player. |
25 | */ |
26 | class BLUEZQT_EXPORT MediaPlayerTrack |
27 | { |
28 | public: |
29 | /** |
30 | * Creates a new invalid MediaPlayerTrack object. |
31 | */ |
32 | explicit MediaPlayerTrack(); |
33 | |
34 | /** |
35 | * Destroys a MediaPlayerTrack object. |
36 | */ |
37 | virtual ~MediaPlayerTrack(); |
38 | |
39 | /** |
40 | * Copy constructor. |
41 | * |
42 | * @param other |
43 | */ |
44 | MediaPlayerTrack(const MediaPlayerTrack &other); |
45 | |
46 | /** |
47 | * Copy assignment operator. |
48 | * |
49 | * @param other |
50 | */ |
51 | MediaPlayerTrack &operator=(const MediaPlayerTrack &other); |
52 | |
53 | /** |
54 | * Returns whether the track is valid. |
55 | * |
56 | * @return true if track is valid |
57 | */ |
58 | bool isValid() const; |
59 | |
60 | /** |
61 | * Returns a title of the track. |
62 | * |
63 | * @return track title |
64 | */ |
65 | QString title() const; |
66 | |
67 | /** |
68 | * Returns an artist of the track. |
69 | * |
70 | * @return track artist |
71 | */ |
72 | QString artist() const; |
73 | |
74 | /** |
75 | * Returns an album of the track. |
76 | * |
77 | * @return track album |
78 | */ |
79 | QString album() const; |
80 | |
81 | /** |
82 | * Returns a genre of the track. |
83 | * |
84 | * @return track genre |
85 | */ |
86 | QString genre() const; |
87 | |
88 | /** |
89 | * Returns a total number of tracks. |
90 | * |
91 | * @return total number of tracks |
92 | */ |
93 | quint32 numberOfTracks() const; |
94 | |
95 | /** |
96 | * Returns a track number of the track. |
97 | * |
98 | * @return track number |
99 | */ |
100 | quint32 trackNumber() const; |
101 | |
102 | /** |
103 | * Returns a duration of the track. |
104 | * |
105 | * @return track duration |
106 | */ |
107 | quint32 duration() const; |
108 | |
109 | private: |
110 | BLUEZQT_NO_EXPORT explicit MediaPlayerTrack(const QVariantMap &properties); |
111 | |
112 | QSharedPointer<class MediaPlayerTrackPrivate> d; |
113 | |
114 | friend class MediaPlayerPrivate; |
115 | }; |
116 | |
117 | } // namespace BluezQt |
118 | |
119 | Q_DECLARE_METATYPE(BluezQt::MediaPlayerTrack) |
120 | |
121 | #endif // BLUEZQT_MEDIAPLAYERTRACK_H |
122 | |