File indexing completed on 2025-01-05 04:26:03
0001 /**************************************************************************************** 0002 * Copyright (c) 2009 Alejandro Wainzinger <aikawarazuni@gmail.com> * 0003 * * 0004 * This program is free software; you can redistribute it and/or modify it under * 0005 * the terms of the GNU General Public License as published by the Free Software * 0006 * Foundation; either version 2 of the License, or (at your option) any later * 0007 * version. * 0008 * * 0009 * This program is distributed in the hope that it will be useful, but WITHOUT ANY * 0010 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * 0011 * PARTICULAR PURPOSE. See the GNU General Public License for more details. * 0012 * * 0013 * You should have received a copy of the GNU General Public License along with * 0014 * this program. If not, see <http://www.gnu.org/licenses/>. * 0015 ****************************************************************************************/ 0016 0017 #ifndef MTPWRITECAPABILITY_H 0018 #define MTPWRITECAPABILITY_H 0019 0020 #include "mediadevicecollection_export.h" 0021 #include "WriteCapability.h" 0022 0023 namespace Meta { 0024 class MtpHandler; 0025 } 0026 0027 namespace Handler 0028 { 0029 0030 class MtpWriteCapability : public WriteCapability 0031 { 0032 Q_OBJECT 0033 public: 0034 explicit MtpWriteCapability( Meta::MtpHandler *handler ); 0035 0036 QStringList supportedFormats() override; 0037 0038 void findPathToCopy( const Meta::TrackPtr &srcTrack, const Meta::MediaDeviceTrackPtr &destTrack ) override; 0039 0040 bool libCopyTrack( const Meta::TrackPtr &srcTrack, Meta::MediaDeviceTrackPtr &destTrack ) override; 0041 0042 bool libDeleteTrackFile( const Meta::MediaDeviceTrackPtr &track ) override; 0043 0044 void libCreateTrack( const Meta::MediaDeviceTrackPtr &track ) override; 0045 0046 void libDeleteTrack( const Meta::MediaDeviceTrackPtr &track ) override; 0047 0048 void addTrackInDB( const Meta::MediaDeviceTrackPtr &track ) override; 0049 0050 void removeTrackFromDB( const Meta::MediaDeviceTrackPtr &track ) override; 0051 0052 void setDatabaseChanged() override; 0053 0054 void libSetTitle( Meta::MediaDeviceTrackPtr &track, const QString& title ) override; 0055 void libSetAlbum( Meta::MediaDeviceTrackPtr &track, const QString& album ) override; 0056 void libSetArtist( Meta::MediaDeviceTrackPtr &track, const QString& artist ) override; 0057 void libSetAlbumArtist( Meta::MediaDeviceTrackPtr &track, const QString& albumArtist ) override; 0058 void libSetComposer( Meta::MediaDeviceTrackPtr &track, const QString& composer ) override; 0059 void libSetGenre( Meta::MediaDeviceTrackPtr &track, const QString& genre ) override; 0060 void libSetYear( Meta::MediaDeviceTrackPtr &track, const QString& year ) override; 0061 void libSetLength( Meta::MediaDeviceTrackPtr &track, int length ) override; 0062 void libSetTrackNumber( Meta::MediaDeviceTrackPtr &track, int tracknum ) override; 0063 void libSetComment( Meta::MediaDeviceTrackPtr &track, const QString& comment ) override; 0064 void libSetDiscNumber( Meta::MediaDeviceTrackPtr &track, int discnum ) override; 0065 void libSetBitrate( Meta::MediaDeviceTrackPtr &track, int bitrate ) override; 0066 void libSetSamplerate( Meta::MediaDeviceTrackPtr &track, int samplerate ) override; 0067 void libSetBpm( Meta::MediaDeviceTrackPtr &track, qreal bpm ) override; 0068 void libSetFileSize( Meta::MediaDeviceTrackPtr &track, int filesize ) override; 0069 void libSetPlayCount( Meta::MediaDeviceTrackPtr &track, int playcount ) override; 0070 void libSetLastPlayed( Meta::MediaDeviceTrackPtr &track, const QDateTime &lastplayed ) override; 0071 void libSetRating( Meta::MediaDeviceTrackPtr &track, int rating ) override; 0072 void libSetType( Meta::MediaDeviceTrackPtr &track, const QString& type ) override; 0073 void libSetPlayableUrl( Meta::MediaDeviceTrackPtr &destTrack, const Meta::TrackPtr &srcTrack ) override; 0074 void libSetCoverArt( Meta::MediaDeviceTrackPtr &track, const QImage &cover ) override; 0075 0076 void prepareToCopy() override; 0077 void prepareToDelete() override; 0078 0079 void updateTrack( Meta::MediaDeviceTrackPtr &track ) override; 0080 0081 private: 0082 Meta::MtpHandler *m_handler; 0083 }; 0084 0085 } 0086 0087 #endif