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

« back to all changes in this revision

Viewing changes to src/core-impl/collections/ipodcollection/handler/capabilities/IpodArtworkCapability.cpp

  • 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:
1
 
/****************************************************************************************
2
 
 * Copyright (c) 2009 Seb Ruiz <ruiz@kde.org>                                           *
3
 
 *                                                                                      *
4
 
 * This program is free software; you can redistribute it and/or modify it under        *
5
 
 * the terms of the GNU General Public License as published by the Free Software        *
6
 
 * Foundation; either version 2 of the License, or (at your option) any later           *
7
 
 * version.                                                                             *
8
 
 *                                                                                      *
9
 
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY      *
10
 
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A      *
11
 
 * PARTICULAR PURPOSE. See the GNU General Public License for more details.             *
12
 
 *                                                                                      *
13
 
 * You should have received a copy of the GNU General Public License along with         *
14
 
 * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
15
 
 ****************************************************************************************/
16
 
 
17
 
#include "IpodArtworkCapability.h"
18
 
#include "IpodHandler.h"
19
 
 
20
 
using namespace Handler;
21
 
 
22
 
IpodArtworkCapability::IpodArtworkCapability( Meta::IpodHandler *handler )
23
 
    : ArtworkCapability( handler )
24
 
    , m_handler( handler )
25
 
{
26
 
}
27
 
 
28
 
IpodArtworkCapability::~IpodArtworkCapability()
29
 
{
30
 
    // nothing to do here
31
 
}
32
 
 
33
 
QImage IpodArtworkCapability::getCover( const Meta::MediaDeviceTrackPtr &track )
34
 
{
35
 
    return m_handler->libGetCoverArt( track );
36
 
}
37
 
 
38
 
void IpodArtworkCapability::setCover( Meta::MediaDeviceAlbumPtr album, const QImage &image )
39
 
{
40
 
    foreach( Meta::TrackPtr t, album->tracks() )
41
 
    {
42
 
        Meta::MediaDeviceTrackPtr track = Meta::MediaDeviceTrackPtr::dynamicCast( t );
43
 
        m_handler->libSetCoverArt( track, image );
44
 
    }
45
 
}
46
 
 
47
 
void IpodArtworkCapability::setCoverPath( Meta::MediaDeviceAlbumPtr album, const QString &path )
48
 
{
49
 
    foreach( Meta::TrackPtr t, album->tracks() )
50
 
    {
51
 
        Meta::MediaDeviceTrackPtr track = Meta::MediaDeviceTrackPtr::dynamicCast( t );
52
 
        m_handler->libSetCoverArtPath( track, path );
53
 
    }
54
 
}
55
 
 
56
 
bool IpodArtworkCapability::canUpdateCover() const
57
 
{
58
 
    return m_handler->isWritable() && m_handler->supportsArtwork();
59
 
}
60