~ubuntu-branches/ubuntu/quantal/amarok/quantal

« back to all changes in this revision

Viewing changes to src/core-impl/collections/mediadevicecollection/handler/capabilities/WriteCapability.h

  • Committer: Package Import Robot
  • Author(s): Harald Sitter
  • Date: 2012-06-05 15:43:51 UTC
  • mfrom: (2.1.13 experimental)
  • Revision ID: package-import@ubuntu.com-20120605154351-nbkdf9q1chu7uvh1
Tags: 2:2.6~beta1-1ubuntu1
* Merge from Debian experimental, remaining changes: (LP: 1008645)
  - Don't build-depend on libavformat-dev and libofa0-dev as libavcodec*
    is not allowed on cd images.
  - Don't build-dep on libqt4-opengl-dev on armel and armhf and install
    file manually in debian/rules
  - build-dep on libmygpo
  - Add epoch "2:" to the version number.
  - More complete not-installed
  - Keep build-dep libmysqld-pic at 5.1.36-2 (new version not yet  in archive)
  - Do not manually compress with xz, we handle this in pkg-kde and explicitly
    doing it prevents global control
* Do not suggest libxine1-ffmpeg as this should have been in the Phonon
  backend to begin with and phonon-xine is no longer used anyway.
* amarok-common breaks amarok (<< 2.6~beta1-1ubuntu1~) due to wrongly
  packaged desktop files in a previous release
* Drop patches applied upstream:
  - kubuntu_Make-OpenGl-a-soft-dependency.diff
  - kubuntu_CMake-Move-occurence-of-OPENGL_INCLUDE_DIR-var.diff
  - kubuntu_kdelibs4.8_context_view.diff
* Refreshed patch kubuntu_mysql_pic_library_path.diff
* amarok-doc to Break and Replace all previous amarok-help-* packages
  having one big package and keep the diff small was deemed more reasonable
  on IRC

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
#ifndef MEDIADEVICEHANDLER_WRITECAPABILITY_H
18
18
#define MEDIADEVICEHANDLER_WRITECAPABILITY_H
19
19
 
20
 
#include "mediadevicecollection_export.h"
21
 
#include "WriteCapabilityBase.h"
22
 
#include "../../MediaDeviceMeta.h"
 
20
#include "core-impl/collections/mediadevicecollection/MediaDeviceMeta.h"
 
21
#include "core-impl/collections/mediadevicecollection/handler/MediaDeviceHandlerCapability.h"
 
22
#include "core-impl/collections/mediadevicecollection/support/mediadevicecollection_export.h"
23
23
 
24
24
namespace Handler
25
25
{
26
26
 
27
 
class MEDIADEVICECOLLECTION_EXPORT WriteCapability : public Handler::WriteCapabilityBase
 
27
class MEDIADEVICECOLLECTION_EXPORT WriteCapability : public Handler::Capability
28
28
{
29
29
    Q_OBJECT
30
30
 
31
31
    public:
32
 
        WriteCapability( QObject *parent ) : WriteCapabilityBase( parent ) {}
 
32
        WriteCapability( QObject *parent ) : Capability( parent ) {}
33
33
        virtual ~WriteCapability();
34
34
 
 
35
        static Type capabilityInterfaceType() { return Handler::Capability::Writable; }
 
36
 
 
37
        /**
 
38
         * Returns a list of formats supported by the device, all in lowercase
 
39
         * For example mp3, mpeg, aac.  This is used to avoid copying unsupported
 
40
         * types to a particular device.
 
41
         */
 
42
        virtual QStringList supportedFormats() = 0; // md:write
 
43
 
 
44
        /**
 
45
         * Finds the place to copy the track to on the device, which
 
46
         * could be a url in the case of Ipods, or a folder in the
 
47
         * case of MTP devices.
 
48
         * @param srcTrack The source track of the copy
 
49
         * @param destTrack The destination track whose path we seek
 
50
         */
 
51
        virtual void findPathToCopy( const Meta::TrackPtr &srcTrack, const Meta::MediaDeviceTrackPtr &destTrack ) = 0;
 
52
 
 
53
        /**
 
54
         * libCopyTrack does the actual file copying.  For Ipods, it uses KIO,
 
55
         * for MTPs this uses a libmtp call
 
56
         * Copy the file associate with srcTrack to destTrack
 
57
         * @param srcTrack The track being copied from
 
58
         * @param destTrack The track being copied to
 
59
         * @return Whether or not the track copy was successful
 
60
         */
 
61
        virtual bool libCopyTrack( const Meta::TrackPtr &srcTrack, Meta::MediaDeviceTrackPtr &destTrack ) = 0;
 
62
 
 
63
        /**
 
64
         * libDeleteTrack does the actual file deleting.  For Ipods, it uses KIO,
 
65
         * for MTPs this uses a libmtp call.  Must emit libRemoveTrackDone when finished.
 
66
         * @param track The track whose file is to be deleted
 
67
         * @return Whether or not the track removal was successful
 
68
         */
 
69
        virtual bool libDeleteTrackFile( const Meta::MediaDeviceTrackPtr &track ) = 0;
 
70
 
 
71
        /**
 
72
         * This function is called just before copying tracks begin and allows
 
73
         * a subclass to prepare to copy, e.g. for Ipods it would initialize
 
74
         * the job counter to 0.
 
75
         */
 
76
        virtual void prepareToCopy() = 0;
 
77
 
 
78
        /**
 
79
         * This function is called just before deleting tracks begin and allows
 
80
         * a subclass to prepare to delete, e.g. for Ipods it would initialize
 
81
         * the m_tracksdeleting to keep track of urls it is deleting.
 
82
         */
 
83
        virtual void prepareToDelete() = 0;
 
84
 
 
85
        /**
 
86
         * Tells subclass that it can update the track, usually because
 
87
         * the track's tags have changed.
 
88
         * @param track The track whose tags should be updated
 
89
         */
 
90
        virtual void updateTrack( Meta::MediaDeviceTrackPtr &track )
 
91
        {
 
92
            Q_UNUSED( track )
 
93
        }
 
94
 
35
95
        /**
36
96
         * Creates a new track struct particular to the library of the device
37
97
         * e.g. LIBMTP_new_track_t(), and associates it with the track for
70
130
         */
71
131
        virtual void setDatabaseChanged() = 0;
72
132
 
73
 
        /**
 
133
        /*
74
134
         * Each libSet function sets the private track struct associated with @param track
75
135
         * to the second value passed into the function.
76
136
         */
 
137
 
77
138
        virtual void libSetTitle( Meta::MediaDeviceTrackPtr &track, const QString& title ) = 0;
78
139
        virtual void libSetAlbum( Meta::MediaDeviceTrackPtr &track, const QString& album ) = 0;
79
140
        virtual void libSetArtist( Meta::MediaDeviceTrackPtr &track, const QString& artist ) = 0;
95
156
        virtual void libSetType( Meta::MediaDeviceTrackPtr &track, const QString& type ) = 0;
96
157
        virtual void libSetPlayableUrl( Meta::MediaDeviceTrackPtr &destTrack, const Meta::TrackPtr &srcTrack ) = 0;
97
158
        virtual void libSetIsCompilation( Meta::MediaDeviceTrackPtr &track, bool isCompilation );
 
159
        virtual void libSetReplayGain( Meta::MediaDeviceTrackPtr &track, qreal newReplayGain );
98
160
        virtual void libSetCoverArt( Meta::MediaDeviceTrackPtr &track, const QImage &cover ) = 0;
99
161
};
100
162
}