strawberry-audio-player-win.../3rdparty/taglib/asf/asftag.h

202 lines
5.7 KiB
C
Raw Normal View History

2018-05-10 15:29:28 +02:00
/**************************************************************************
copyright : (C) 2005-2007 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_ASFTAG_H
#define TAGLIB_ASFTAG_H
#include "tag.h"
#include "tlist.h"
#include "tmap.h"
#include "taglib_export.h"
#include "asfattribute.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 ASF {
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
typedef List<Attribute> AttributeList;
typedef Map<String, AttributeList> AttributeListMap;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
class TAGLIB_EXPORT Tag : public Strawberry_TagLib::TagLib::Tag {
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
friend class File;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
public:
explicit Tag();
2018-05-10 15:29:28 +02:00
2020-06-26 23:30:30 +02:00
~Tag() override;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Returns the track name.
*/
2020-06-26 23:30:30 +02:00
String title() const override;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Returns the artist name.
*/
2020-06-26 23:30:30 +02:00
String artist() const override;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Returns the album name; if no album name is present in the tag String::null will be returned.
*/
2020-06-26 23:30:30 +02:00
String album() const override;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Returns the track comment.
*/
2020-06-26 23:30:30 +02:00
String comment() const override;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Returns the genre name; if no genre is present in the tag String::null will be returned.
*/
2020-06-26 23:30:30 +02:00
String genre() const override;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Returns the rating.
*/
2020-06-13 19:02:42 +02:00
virtual String rating() const;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Returns the genre name; if no genre is present in the tag String::null will be returned.
*/
2020-06-13 19:02:42 +02:00
virtual String copyright() const;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Returns the year; if there is no year set, this will return 0.
*/
2020-06-26 23:30:30 +02:00
unsigned int year() const override;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Returns the track number; if there is no track number set, this will return 0.
*/
2020-06-26 23:30:30 +02:00
unsigned int track() const override;
PictureMap pictures() const override;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Sets the title to \a s.
*/
2020-06-26 23:30:30 +02:00
void setTitle(const String &value) override;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Sets the artist to \a s.
*/
2020-06-26 23:30:30 +02:00
void setArtist(const String &value) override;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Sets the album to \a s. If \a s is String::null then this value will be cleared.
*/
2020-06-26 23:30:30 +02:00
void setAlbum(const String &value) override;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Sets the comment to \a s.
*/
2020-06-26 23:30:30 +02:00
void setComment(const String &value) override;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Sets the rating to \a s.
*/
2020-06-14 18:58:24 +02:00
virtual void setRating(const String &value);
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Sets the copyright to \a s.
*/
2020-06-14 18:58:24 +02:00
virtual void setCopyright(const String &value);
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Sets the genre to \a s.
*/
2020-06-26 23:30:30 +02:00
void setGenre(const String &value) override;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Sets the year to \a i. If \a s is 0 then this value will be cleared.
*/
2020-06-26 23:30:30 +02:00
void setYear(unsigned int value) override;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Sets the track to \a i. If \a s is 0 then this value will be cleared.
*/
2020-06-26 23:30:30 +02:00
void setTrack(unsigned int value) override;
void setPictures(const PictureMap&) override;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Returns true if the tag does not contain any data.
* This should be reimplemented in subclasses that provide more than the basic tagging abilities in this class.
*/
2020-06-26 23:30:30 +02:00
bool isEmpty() const override;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Returns a reference to the item list map. This is an AttributeListMap of all of the items in the tag.
*/
2020-06-26 23:30:30 +02:00
const AttributeListMap &attributeListMap() const;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* \return True if a value for \a attribute is currently set.
*/
2020-06-14 18:58:24 +02:00
bool contains(const String &key) const;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Removes the \a key attribute from the tag
*/
2020-06-14 18:58:24 +02:00
void removeItem(const String &key);
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* \return The list of values for the key \a name, or an empty list if no values have been set.
*/
2020-06-13 19:02:42 +02:00
AttributeList attribute(const String &name) const;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Sets the \a key attribute to the value of \a attribute. If an attribute with the \a key is already present, it will be replaced.
*/
2020-06-13 19:02:42 +02:00
void setAttribute(const String &name, const Attribute &attribute);
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Sets multiple \a values to the key \a name.
*/
2020-06-13 19:02:42 +02:00
void setAttribute(const String &name, const AttributeList &values);
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
/*!
* Sets the \a key attribute to the value of \a attribute. If an attribute
* with the \a key is already present, it will be added to the list.
*/
2020-06-13 19:02:42 +02:00
void addAttribute(const String &name, const Attribute &attribute);
2018-05-10 15:29:28 +02:00
2020-06-26 23:30:30 +02:00
PropertyMap properties() const override;
void removeUnsupportedProperties(const StringList &props) override;
PropertyMap setProperties(const PropertyMap &props) override;
2018-05-10 15:29:28 +02:00
2020-06-13 19:02:42 +02:00
private:
class TagPrivate;
TagPrivate *d;
};
2020-06-26 23:30:30 +02:00
2020-06-13 19:02:42 +02:00
} // namespace ASF
} // namespace TagLib
} // namespace Strawberry_TagLib
2020-06-26 23:30:30 +02:00
2018-05-10 15:29:28 +02:00
#endif