strawberry-audio-player-win.../3rdparty/taglib/flac/flacpicture.h

204 lines
5.5 KiB
C
Raw Normal View History

2018-05-10 15:29:28 +02:00
/**************************************************************************
copyright : (C) 2010 by Lukáš Lalinský
email : lalinsky@gmail.com
**************************************************************************/
/***************************************************************************
* This library is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License version *
* 2.1 as published by the Free Software Foundation. *
* *
* This library is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA *
* 02110-1301 USA *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#ifndef TAGLIB_FLACPICTURE_H
#define TAGLIB_FLACPICTURE_H
#include "tlist.h"
#include "tstring.h"
#include "tbytevector.h"
#include "taglib_export.h"
#include "flacmetadatablock.h"
2019-04-26 01:12:42 +02:00
namespace Strawberry_TagLib {
namespace TagLib {
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
namespace FLAC {
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
class TAGLIB_EXPORT Picture : public MetadataBlock {
public:
/*!
* This describes the function or content of the picture.
*/
2020-06-13 19:02:42 +02:00
enum Type {
//! A type not enumerated below
Other = 0x00,
//! 32x32 PNG image that should be used as the file icon
FileIcon = 0x01,
//! File icon of a different size or format
OtherFileIcon = 0x02,
//! Front cover image of the album
FrontCover = 0x03,
//! Back cover image of the album
BackCover = 0x04,
//! Inside leaflet page of the album
LeafletPage = 0x05,
//! Image from the album itself
Media = 0x06,
//! Picture of the lead artist or soloist
LeadArtist = 0x07,
//! Picture of the artist or performer
Artist = 0x08,
//! Picture of the conductor
Conductor = 0x09,
//! Picture of the band or orchestra
Band = 0x0A,
//! Picture of the composer
Composer = 0x0B,
//! Picture of the lyricist or text writer
Lyricist = 0x0C,
//! Picture of the recording location or studio
RecordingLocation = 0x0D,
//! Picture of the artists during recording
DuringRecording = 0x0E,
//! Picture of the artists during performance
DuringPerformance = 0x0F,
//! Picture from a movie or video related to the track
MovieScreenCapture = 0x10,
//! Picture of a large, coloured fish
ColouredFish = 0x11,
//! Illustration related to the track
Illustration = 0x12,
//! Logo of the band or performer
BandLogo = 0x13,
//! Logo of the publisher (record company)
PublisherLogo = 0x14
};
explicit Picture();
explicit Picture(const ByteVector &data);
2020-06-26 23:30:30 +02:00
~Picture() override;
2020-06-13 19:02:42 +02:00
/*!
* Returns the type of the image.
*/
2020-06-13 19:02:42 +02:00
Type type() const;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Sets the type of the image.
*/
2020-06-13 19:02:42 +02:00
void setType(Type type);
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Returns the mime type of the image. This should in most cases be "image/png" or "image/jpeg".
*/
2020-06-13 19:02:42 +02:00
String mimeType() const;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Sets the mime type of the image. This should in most cases be "image/png" or "image/jpeg".
*/
2020-06-13 19:02:42 +02:00
void setMimeType(const String &m);
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Returns a text description of the image.
*/
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
String description() const;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Sets a textual description of the image to \a desc.
*/
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
void setDescription(const String &desc);
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Returns the width of the image.
*/
2020-06-13 19:02:42 +02:00
int width() const;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Sets the width of the image.
*/
2020-06-13 19:02:42 +02:00
void setWidth(int w);
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Returns the height of the image.
*/
2020-06-13 19:02:42 +02:00
int height() const;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Sets the height of the image.
*/
2020-06-13 19:02:42 +02:00
void setHeight(int h);
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Returns the color depth (in bits-per-pixel) of the image.
*/
2020-06-13 19:02:42 +02:00
int colorDepth() const;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Sets the color depth (in bits-per-pixel) of the image.
*/
2020-06-13 19:02:42 +02:00
void setColorDepth(int depth);
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Returns the number of colors used on the image..
*/
2020-06-13 19:02:42 +02:00
int numColors() const;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Sets the number of colors used on the image (for indexed images).
*/
2020-06-13 19:02:42 +02:00
void setNumColors(int numColors);
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Returns the image data.
*/
2020-06-13 19:02:42 +02:00
ByteVector data() const;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Sets the image data.
*/
2020-06-13 19:02:42 +02:00
void setData(const ByteVector &data);
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Returns the FLAC metadata block type.
*/
2020-06-26 23:30:30 +02:00
int code() const override;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Render the content to the FLAC picture block format.
*/
2020-06-26 23:30:30 +02:00
ByteVector render() const override;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Parse the picture data in the FLAC picture block format.
*/
2020-06-13 19:02:42 +02:00
bool parse(const ByteVector &rawData);
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
private:
2020-06-26 23:30:30 +02:00
Picture(const Picture &item);
2020-06-13 19:02:42 +02:00
Picture &operator=(const Picture &item);
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
class PicturePrivate;
PicturePrivate *d;
};
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
} // namespace FLAC
} // namespace TagLib
} // namespace Strawberry_TagLib
2018-05-10 15:29:28 +02:00
#endif