summaryrefslogtreecommitdiffstats
path: root/juk/coverinfo.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commite2de64d6f1beb9e492daf5b886e19933c1fa41dd (patch)
tree9047cf9e6b5c43878d5bf82660adae77ceee097a /juk/coverinfo.h
downloadtdemultimedia-e2de64d6f1beb9e492daf5b886e19933c1fa41dd.tar.gz
tdemultimedia-e2de64d6f1beb9e492daf5b886e19933c1fa41dd.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'juk/coverinfo.h')
-rw-r--r--juk/coverinfo.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/juk/coverinfo.h b/juk/coverinfo.h
new file mode 100644
index 00000000..1caae8d0
--- /dev/null
+++ b/juk/coverinfo.h
@@ -0,0 +1,67 @@
+/***************************************************************************
+ copyright : (C) 2004 Nathan Toone
+ email : nathan@toonetown.com
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef COVERINFO_H
+#define COVERINFO_H
+
+#include <qimage.h>
+
+#include "filehandle.h"
+#include "covermanager.h"
+
+class CoverInfo
+{
+ friend class FileHandle;
+
+public:
+ enum CoverSize { FullSize, Thumbnail };
+
+ CoverInfo(const FileHandle &file);
+
+ bool hasCover();
+
+ void clearCover();
+ void setCover(const QImage &image = QImage());
+
+ // Use this to assign to a specific cover id.
+ void setCoverId(coverKey id);
+
+ /**
+ * This function sets the cover identifier for all tracks that have the
+ * same Artist and Album as this track, to the cover identifier of this
+ * track.
+ *
+ * @param overwriteExistingCovers If set to true, this function will always
+ * apply the new cover to a track even if the track already had
+ * a different cover set.
+ */
+ void applyCoverToWholeAlbum(bool overwriteExistingCovers = false) const;
+
+ coverKey coverId() const { return m_coverKey; }
+
+ QPixmap pixmap(CoverSize size) const;
+ void popup() const;
+
+private:
+ QString coverLocation(CoverSize size) const;
+ bool convertOldStyleCover() const;
+
+ FileHandle m_file;
+ bool m_hasCover;
+ bool m_haveCheckedForCover;
+ mutable coverKey m_coverKey;
+ mutable bool m_needsConverting;
+};
+#endif
+