File indexing completed on 2024-12-01 12:29:50

0001 /*
0002  * BluezQt - Asynchronous BlueZ wrapper library
0003  *
0004  * SPDX-FileCopyrightText: 2015 David Rosca <nowrep@gmail.com>
0005  *
0006  * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007  */
0008 
0009 #ifndef BLUEZQT_MEDIAPLAYERTRACK_H
0010 #define BLUEZQT_MEDIAPLAYERTRACK_H
0011 
0012 #include <QSharedPointer>
0013 #include <QString>
0014 
0015 #include "bluezqt_export.h"
0016 
0017 namespace BluezQt
0018 {
0019 /**
0020  * @class BluezQt::MediaPlayerTrack mediaplayertrack.h <BluezQt/MediaPlayerTrack>
0021  *
0022  * Media player track.
0023  *
0024  * This class represents a track in media player.
0025  */
0026 class BLUEZQT_EXPORT MediaPlayerTrack
0027 {
0028 public:
0029     /**
0030      * Creates a new invalid MediaPlayerTrack object.
0031      */
0032     explicit MediaPlayerTrack();
0033 
0034     /**
0035      * Destroys a MediaPlayerTrack object.
0036      */
0037     virtual ~MediaPlayerTrack();
0038 
0039     /**
0040      * Copy constructor.
0041      *
0042      * @param other
0043      */
0044     MediaPlayerTrack(const MediaPlayerTrack &other);
0045 
0046     /**
0047      * Copy assignment operator.
0048      *
0049      * @param other
0050      */
0051     MediaPlayerTrack &operator=(const MediaPlayerTrack &other);
0052 
0053     /**
0054      * Returns whether the track is valid.
0055      *
0056      * @return true if track is valid
0057      */
0058     bool isValid() const;
0059 
0060     /**
0061      * Returns a title of the track.
0062      *
0063      * @return track title
0064      */
0065     QString title() const;
0066 
0067     /**
0068      * Returns an artist of the track.
0069      *
0070      * @return track artist
0071      */
0072     QString artist() const;
0073 
0074     /**
0075      * Returns an album of the track.
0076      *
0077      * @return track album
0078      */
0079     QString album() const;
0080 
0081     /**
0082      * Returns a genre of the track.
0083      *
0084      * @return track genre
0085      */
0086     QString genre() const;
0087 
0088     /**
0089      * Returns a total number of tracks.
0090      *
0091      * @return total number of tracks
0092      */
0093     quint32 numberOfTracks() const;
0094 
0095     /**
0096      * Returns a track number of the track.
0097      *
0098      * @return track number
0099      */
0100     quint32 trackNumber() const;
0101 
0102     /**
0103      * Returns a duration of the track.
0104      *
0105      * @return track duration
0106      */
0107     quint32 duration() const;
0108 
0109 private:
0110     BLUEZQT_NO_EXPORT explicit MediaPlayerTrack(const QVariantMap &properties);
0111 
0112     QSharedPointer<class MediaPlayerTrackPrivate> d;
0113 
0114     friend class MediaPlayerPrivate;
0115 };
0116 
0117 } // namespace BluezQt
0118 
0119 Q_DECLARE_METATYPE(BluezQt::MediaPlayerTrack)
0120 
0121 #endif // BLUEZQT_MEDIAPLAYERTRACK_H