File indexing completed on 2025-01-05 04:26:03
0001 /**************************************************************************************** 0002 * Copyright (c) 2009 Alejandro Wainzinger <aikawarazuni@gmail.com> * 0003 * Copyright (c) 2009 Mark Kretschmann <kretschmann@kde.org> * 0004 * * 0005 * This program is free software; you can redistribute it and/or modify it under * 0006 * the terms of the GNU General Public License as published by the Free Software * 0007 * Foundation; either version 2 of the License, or (at your option) any later * 0008 * version. * 0009 * * 0010 * This program is distributed in the hope that it will be useful, but WITHOUT ANY * 0011 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * 0012 * PARTICULAR PURPOSE. See the GNU General Public License for more details. * 0013 * * 0014 * You should have received a copy of the GNU General Public License along with * 0015 * this program. If not, see <http://www.gnu.org/licenses/>. * 0016 ****************************************************************************************/ 0017 0018 #ifndef MTPREADCAPABILITY_H 0019 #define MTPREADCAPABILITY_H 0020 0021 #include "mediadevicecollection_export.h" 0022 #include "ReadCapability.h" 0023 0024 #include <QPointer> 0025 0026 0027 namespace Meta { 0028 class MtpHandler; 0029 } 0030 0031 namespace Handler 0032 { 0033 0034 class MtpReadCapability : public ReadCapability 0035 { 0036 Q_OBJECT 0037 0038 public: 0039 explicit MtpReadCapability( Meta::MtpHandler *handler ); 0040 0041 void prepareToParseTracks() override; 0042 0043 bool isEndOfParseTracksList() override; 0044 0045 void prepareToParseNextTrack() override; 0046 0047 void nextTrackToParse() override; 0048 0049 void setAssociateTrack( const Meta::MediaDeviceTrackPtr track ) override; 0050 0051 QString libGetTitle( const Meta::MediaDeviceTrackPtr &track ) override; 0052 QString libGetAlbum( const Meta::MediaDeviceTrackPtr &track ) override; 0053 QString libGetArtist( const Meta::MediaDeviceTrackPtr &track ) override; 0054 QString libGetAlbumArtist( const Meta::MediaDeviceTrackPtr &track ) override; 0055 QString libGetComposer( const Meta::MediaDeviceTrackPtr &track ) override; 0056 QString libGetGenre( const Meta::MediaDeviceTrackPtr &track ) override; 0057 int libGetYear( const Meta::MediaDeviceTrackPtr &track ) override; 0058 qint64 libGetLength( const Meta::MediaDeviceTrackPtr &track ) override; 0059 int libGetTrackNumber( const Meta::MediaDeviceTrackPtr &track ) override; 0060 QString libGetComment( const Meta::MediaDeviceTrackPtr &track ) override; 0061 int libGetDiscNumber( const Meta::MediaDeviceTrackPtr &track ) override; 0062 int libGetBitrate( const Meta::MediaDeviceTrackPtr &track ) override; 0063 int libGetSamplerate( const Meta::MediaDeviceTrackPtr &track ) override; 0064 qreal libGetBpm( const Meta::MediaDeviceTrackPtr &track ) override; 0065 int libGetFileSize( const Meta::MediaDeviceTrackPtr &track ) override; 0066 int libGetPlayCount( const Meta::MediaDeviceTrackPtr &track ) override; 0067 QDateTime libGetLastPlayed( const Meta::MediaDeviceTrackPtr &track ) override; 0068 int libGetRating( const Meta::MediaDeviceTrackPtr &track ) override; 0069 QString libGetType( const Meta::MediaDeviceTrackPtr &track ) override; 0070 QUrl libGetPlayableUrl( const Meta::MediaDeviceTrackPtr &track ) override; 0071 0072 float usedCapacity() const override; 0073 float totalCapacity() const override; 0074 0075 private: 0076 QPointer<Meta::MtpHandler> m_handler; 0077 }; 0078 0079 } 0080 0081 #endif