/*!
* Returns a pointer to the ID3v1 tag of the file.
*
- * If \a create is false (the default) this will return a null pointer
+ * If \a create is false (the default) this may return a null pointer
* if there is no valid ID3v1 tag. If \a create is true it will create
- * an ID3v1 tag if one does not exist. If there is already an APE tag, the
- * new ID3v1 tag will be placed after it.
+ * an ID3v1 tag if one does not exist and returns a valid pointer.
*
- * \note The Tag <b>is still</b> owned by the APE::File and should not be
+ * \note This may return a valid pointer regardless of whether or not the
+ * file on disk has an ID3v1 tag. Use hasID3v1Tag() to check if the file
+ * on disk actually has an ID3v1 tag.
+ *
+ * \note The Tag <b>is still</b> owned by the MPEG::File and should not be
* deleted by the user. It will be deleted when the file (object) is
* destroyed.
+ *
+ * \see hasID3v1Tag()
*/
ID3v1::Tag *ID3v1Tag(bool create = false);
/*!
* Returns a pointer to the APE tag of the file.
*
- * If \a create is false (the default) this will return a null pointer
+ * If \a create is false (the default) this may return a null pointer
* if there is no valid APE tag. If \a create is true it will create
- * a APE tag if one does not exist.
+ * an APE tag if one does not exist and returns a valid pointer.
+ *
+ * \note This may return a valid pointer regardless of whether or not the
+ * file on disk has an APE tag. Use hasAPETag() to check if the file
+ * on disk actually has an APE tag.
*
- * \note The Tag <b>is still</b> owned by the APE::File and should not be
+ * \note The Tag <b>is still</b> owned by the MPEG::File and should not be
* deleted by the user. It will be deleted when the file (object) is
* destroyed.
+ *
+ * \see hasAPETag()
*/
APE::Tag *APETag(bool create = false);
void strip(int tags = AllTags);
/*!
- * Returns whether or not the file on disk contains an APE tag.
+ * Returns whether or not the file on disk actually has an APE tag.
+ *
+ * \see APETag()
*/
bool hasAPETag() const;
/*!
- * Returns whether or not the file on disk contains an ID3v1 tag.
+ * Returns whether or not the file on disk actually has an ID3v1 tag.
+ *
+ * \see ID3v1Tag()
*/
bool hasID3v1Tag() const;
virtual bool save();
private:
-
int readBYTE(bool *ok = 0);
int readWORD(bool *ok = 0);
unsigned int readDWORD(bool *ok = 0);
/*!
* Returns a pointer to the ID3v2 tag of the file.
*
- * If \a create is false (the default) this will return a null pointer
+ * If \a create is false (the default) this returns a null pointer
* if there is no valid ID3v2 tag. If \a create is true it will create
- * an ID3v2 tag if one does not exist.
+ * an ID3v2 tag if one does not exist and returns a valid pointer.
*
- * \note The Tag <b>is still</b> owned by the FLAC::File and should not be
+ * \note This may return a valid pointer regardless of whether or not the
+ * file on disk has an ID3v2 tag. Use hasID3v2Tag() to check if the file
+ * on disk actually has an ID3v2 tag.
+ *
+ * \note The Tag <b>is still</b> owned by the MPEG::File and should not be
* deleted by the user. It will be deleted when the file (object) is
* destroyed.
+ *
+ * \see hasID3v2Tag()
*/
ID3v2::Tag *ID3v2Tag(bool create = false);
/*!
* Returns a pointer to the ID3v1 tag of the file.
*
- * If \a create is false (the default) this will return a null pointer
- * if there is no valid ID3v1 tag. If \a create is true it will create
- * an ID3v1 tag if one does not exist.
+ * If \a create is false (the default) this returns a null pointer
+ * if there is no valid APE tag. If \a create is true it will create
+ * an APE tag if one does not exist and returns a valid pointer.
*
- * \note The Tag <b>is still</b> owned by the FLAC::File and should not be
+ * \note This may return a valid pointer regardless of whether or not the
+ * file on disk has an ID3v1 tag. Use hasID3v1Tag() to check if the file
+ * on disk actually has an ID3v1 tag.
+ *
+ * \note The Tag <b>is still</b> owned by the MPEG::File and should not be
* deleted by the user. It will be deleted when the file (object) is
* destroyed.
+ *
+ * \see hasID3v1Tag()
*/
ID3v1::Tag *ID3v1Tag(bool create = false);
/*!
* Returns a pointer to the XiphComment for the file.
*
- * If \a create is false (the default) this will return a null pointer
+ * If \a create is false (the default) this returns a null pointer
* if there is no valid XiphComment. If \a create is true it will create
- * a XiphComment if one does not exist.
+ * a XiphComment if one does not exist and returns a valid pointer.
*
+ * \note This may return a valid pointer regardless of whether or not the
+ * file on disk has a XiphComment. Use hasXiphComment() to check if the
+ * file on disk actually has a XiphComment.
+ *
* \note The Tag <b>is still</b> owned by the FLAC::File and should not be
* deleted by the user. It will be deleted when the file (object) is
* destroyed.
+ *
+ * \see hasXiphComment()
*/
Ogg::XiphComment *xiphComment(bool create = false);
void addPicture(Picture *picture);
/*!
- * Returns whether or not the file on disk contains a Xiph comment.
+ * Returns whether or not the file on disk actually has a XiphComment.
+ *
+ * \see xiphComment()
*/
bool hasXiphComment() const;
/*!
- * Returns whether or not the file on disk contains an ID3v1 tag.
+ * Returns whether or not the file on disk actually has an ID3v1 tag.
+ *
+ * \see ID3v1Tag()
*/
bool hasID3v1Tag() const;
/*!
- * Returns whether or not the file on disk contains an ID3v2 tag.
+ * Returns whether or not the file on disk actually has an ID3v2 tag.
+ *
+ * \see ID3v2Tag()
*/
bool hasID3v2Tag() const;
/*!
* Returns a pointer to the ID3v1 tag of the file.
*
- * If \a create is false (the default) this will return a null pointer
- * if there is no valid ID3v1 tag. If \a create is true it will create
- * an ID3v1 tag if one does not exist. If there is already an APE tag, the
- * new ID3v1 tag will be placed after it.
+ * If \a create is false (the default) this returns a null pointer
+ * if there is no valid APE tag. If \a create is true it will create
+ * an APE tag if one does not exist and returns a valid pointer.
+ *
+ * \note This may return a valid pointer regardless of whether or not the
+ * file on disk has an ID3v1 tag. Use hasID3v1Tag() to check if the file
+ * on disk actually has an ID3v1 tag.
*
- * \note The Tag <b>is still</b> owned by the APE::File and should not be
+ * \note The Tag <b>is still</b> owned by the MPEG::File and should not be
* deleted by the user. It will be deleted when the file (object) is
* destroyed.
+ *
+ * \see hasID3v1Tag()
*/
ID3v1::Tag *ID3v1Tag(bool create = false);
/*!
* Returns a pointer to the APE tag of the file.
*
- * If \a create is false (the default) this will return a null pointer
+ * If \a create is false (the default) this may return a null pointer
* if there is no valid APE tag. If \a create is true it will create
- * a APE tag if one does not exist. If there is already an ID3v1 tag, thes
- * new APE tag will be placed before it.
+ * an APE tag if one does not exist and returns a valid pointer. If
+ * there already be an ID3v1 tag, the new APE tag will be placed before it.
+ *
+ * \note This may return a valid pointer regardless of whether or not the
+ * file on disk has an APE tag. Use hasAPETag() to check if the file
+ * on disk actually has an APE tag.
*
- * \note The Tag <b>is still</b> owned by the APE::File and should not be
+ * \note The Tag <b>is still</b> owned by the MPEG::File and should not be
* deleted by the user. It will be deleted when the file (object) is
* destroyed.
+ *
+ * \see hasAPETag()
*/
APE::Tag *APETag(bool create = false);
void remove(int tags = AllTags);
/*!
- * Returns whether or not the file on disk contains an ID3v1 tag.
+ * Returns whether or not the file on disk actually has an ID3v1 tag.
+ *
+ * \see ID3v1Tag()
*/
bool hasID3v1Tag() const;
/*!
- * Returns whether or not the file on disk contains an APE tag.
+ * Returns whether or not the file on disk actually has an APE tag.
+ *
+ * \see APETag()
*/
bool hasAPETag() const;
/*!
* Returns a pointer to the ID3v2 tag of the file.
*
- * A tag will always be returned, regardless of whether there is a
- * tag in the file or not. Use ID3v2::Tag::isEmpty() to check if
- * the tag contains no data.
+ * If \a create is false (the default) this may return a null pointer
+ * if there is no valid ID3v2 tag. If \a create is true it will create
+ * an ID3v2 tag if one does not exist and returns a valid pointer.
+ *
+ * \note This may return a valid pointer regardless of whether or not the
+ * file on disk has an ID3v2 tag. Use hasID3v2Tag() to check if the file
+ * on disk actually has an ID3v2 tag.
*
* \note The Tag <b>is still</b> owned by the MPEG::File and should not be
* deleted by the user. It will be deleted when the file (object) is
* destroyed.
+ *
+ * \see hasID3v2Tag()
*/
ID3v2::Tag *ID3v2Tag(bool create = false);
/*!
* Returns a pointer to the ID3v1 tag of the file.
*
- * A tag will always be returned, regardless of whether there is a
- * tag in the file or not. Use Tag::isEmpty() to check if
- * the tag contains no data.
+ * If \a create is false (the default) this may return a null pointer
+ * if there is no valid ID3v1 tag. If \a create is true it will create
+ * an ID3v1 tag if one does not exist and returns a valid pointer.
+ *
+ * \note This may return a valid pointer regardless of whether or not the
+ * file on disk has an ID3v1 tag. Use hasID3v1Tag() to check if the file
+ * on disk actually has an ID3v1 tag.
*
* \note The Tag <b>is still</b> owned by the MPEG::File and should not be
* deleted by the user. It will be deleted when the file (object) is
* destroyed.
+ *
+ * \see hasID3v1Tag()
*/
ID3v1::Tag *ID3v1Tag(bool create = false);
/*!
* Returns a pointer to the APE tag of the file.
*
- * If \a create is false (the default) this will return a null pointer
+ * If \a create is false (the default) this may return a null pointer
* if there is no valid APE tag. If \a create is true it will create
- * an APE tag if one does not exist.
+ * an APE tag if one does not exist and returns a valid pointer.
+ *
+ * \note This may return a valid pointer regardless of whether or not the
+ * file on disk has an APE tag. Use hasAPETag() to check if the file
+ * on disk actually has an APE tag.
*
* \note The Tag <b>is still</b> owned by the MPEG::File and should not be
* deleted by the user. It will be deleted when the file (object) is
* destroyed.
+ *
+ * \see hasAPETag()
*/
APE::Tag *APETag(bool create = false);
long lastFrameOffset();
/*!
- * Returns whether or not the file on disk contains an ID3v1 tag.
+ * Returns whether or not the file on disk actually has an ID3v1 tag.
+ *
+ * \see ID3v1Tag()
*/
bool hasID3v1Tag() const;
/*!
- * Returns whether or not the file on disk contains an ID3v2 tag.
+ * Returns whether or not the file on disk actually has an ID3v2 tag.
+ *
+ * \see ID3v2Tag()
*/
bool hasID3v2Tag() const;
/*!
- * Returns whether or not the file on disk contains an APE tag.
+ * Returns whether or not the file on disk actually has an APE tag.
+ *
+ * \see APETag()
*/
bool hasAPETag() const;
return Ogg::File::save();
}
+bool Ogg::FLAC::File::hasXiphComment() const
+{
+ return d->hasXiphComment;
+}
+
////////////////////////////////////////////////////////////////////////////////
// private members
////////////////////////////////////////////////////////////////////////////////
d->scanned = true;
}
-
-bool Ogg::FLAC::File::hasXiphComment() const
-{
- return d->hasXiphComment;
-}
/*!
* Returns the Tag for this file. This will always be a XiphComment.
+ *
+ * \note This always returns a valid pointer regardless of whether or not
+ * the file on disk has a XiphComment. Use hasXiphComment() to check if
+ * the file on disk actually has a XiphComment.
+ *
+ * \note The Tag <b>is still</b> owned by the FLAC::File and should not be
+ * deleted by the user. It will be deleted when the file (object) is
+ * destroyed.
+ *
+ * \see hasXiphComment()
*/
virtual XiphComment *tag() const;
-
-
/*!
* Returns the FLAC::Properties for this file. If no audio properties
* were read then this will return a null pointer.
long streamLength();
/*!
- * Returns whether or not the file on disk contains a Xiph comment.
+ * Returns whether or not the file on disk actually has a XiphComment.
+ *
+ * \see tag()
*/
bool hasXiphComment() const;
/*!
* Returns the Tag for this file.
+ *
+ * \note This always returns a valid pointer regardless of whether or not
+ * the file on disk has an ID3v2 tag. Use hasID3v2Tag() to check if the file
+ * on disk actually has an ID3v2 tag.
+ *
+ * \see hasID3v2Tag()
*/
virtual ID3v2::Tag *tag() const;
virtual bool save();
/*!
- * Returns whether or not the file on disk contains an ID3v2 tag.
+ * Returns whether or not the file on disk actually has an ID3v2 tag.
+ *
+ * \see ID3v2Tag()
*/
bool hasID3v2Tag() const;
/*!
* Returns the ID3v2 Tag for this file.
+ *
+ * \note This always returns a valid pointer regardless of whether or not
+ * the file on disk has an ID3v2 tag. Use hasID3v2Tag() to check if the
+ * file on disk actually has an ID3v2 tag.
+ *
+ * \see hasID3v2Tag()
*/
ID3v2::Tag *ID3v2Tag() const;
/*!
* Returns the RIFF INFO Tag for this file.
+ *
+ * \note This always returns a valid pointer regardless of whether or not
+ * the file on disk has a RIFF INFO tag. Use hasInfoTag() to check if the
+ * file on disk actually has a RIFF INFO tag.
+ *
+ * \see hasInfoTag()
*/
Info::Tag *InfoTag() const;
bool save(TagTypes tags, bool stripOthers = true, int id3v2Version = 4);
/*!
- * Returns whether or not the file on disk contains an ID3v2 tag.
+ * Returns whether or not the file on disk actually has an ID3v2 tag.
+ *
+ * \see ID3v2Tag()
*/
bool hasID3v2Tag() const;
/*!
- * Returns whether or not the file on disk contains an RIFF INFO tag.
+ * Returns whether or not the file on disk actually has a RIFF INFO tag.
+ *
+ * \see InfoTag()
*/
bool hasInfoTag() const;
virtual bool save();
/*!
- * Returns a pointer to the ID3v2 tag of the file.
+ * Returns a pointer to the ID3v1 tag of the file.
*
- * If \a create is false (the default) this will return a null pointer
- * if there is no valid ID3v2 tag. If \a create is true it will create
- * an ID3v1 tag if one does not exist. If there is already an APE tag, the
- * new ID3v1 tag will be placed after it.
+ * If \a create is false (the default) this may return a null pointer
+ * if there is no valid ID3v1 tag. If \a create is true it will create
+ * an ID3v1 tag if one does not exist and returns a valid pointer.
*
- * \note The Tag <b>is still</b> owned by the TrueAudio::File and should not be
+ * \note This may return a valid pointer regardless of whether or not the
+ * file on disk has an ID3v1 tag. Use hasID3v1Tag() to check if the file
+ * on disk actually has an ID3v1 tag.
+ *
+ * \note The Tag <b>is still</b> owned by the MPEG::File and should not be
* deleted by the user. It will be deleted when the file (object) is
* destroyed.
+ *
+ * \see hasID3v1Tag()
*/
ID3v1::Tag *ID3v1Tag(bool create = false);
/*!
- * Returns a pointer to the ID3v1 tag of the file.
+ * Returns a pointer to the ID3v2 tag of the file.
*
- * If \a create is false (the default) this will return a null pointer
- * if there is no valid ID3v1 tag. If \a create is true it will create
- * an ID3v1 tag if one does not exist. If there is already an APE tag, the
- * new ID3v1 tag will be placed after it.
+ * If \a create is false (the default) this may return a null pointer
+ * if there is no valid ID3v2 tag. If \a create is true it will create
+ * an ID3v2 tag if one does not exist and returns a valid pointer.
+ *
+ * \note This may return a valid pointer regardless of whether or not the
+ * file on disk has an ID3v2 tag. Use hasID3v2Tag() to check if the file
+ * on disk actually has an ID3v2 tag.
*
- * \note The Tag <b>is still</b> owned by the TrueAudio::File and should not be
+ * \note The Tag <b>is still</b> owned by the MPEG::File and should not be
* deleted by the user. It will be deleted when the file (object) is
* destroyed.
+ *
+ * \see hasID3v2Tag()
*/
ID3v2::Tag *ID3v2Tag(bool create = false);
void strip(int tags = AllTags);
/*!
- * Returns whether or not the file on disk contains an ID3v1 tag.
+ * Returns whether or not the file on disk actually has an ID3v1 tag.
+ *
+ * \see ID3v1Tag()
*/
bool hasID3v1Tag() const;
/*!
- * Returns whether or not the file on disk contains an ID3v2 tag.
+ * Returns whether or not the file on disk actually has an ID3v2 tag.
+ *
+ * \see ID3v2Tag()
*/
bool hasID3v2Tag() const;
/*!
* Returns a pointer to the ID3v1 tag of the file.
*
- * If \a create is false (the default) this will return a null pointer
+ * If \a create is false (the default) this may return a null pointer
* if there is no valid ID3v1 tag. If \a create is true it will create
- * an ID3v1 tag if one does not exist. If there is already an APE tag, the
- * new ID3v1 tag will be placed after it.
+ * an ID3v1 tag if one does not exist and returns a valid pointer.
*
- * \note The Tag <b>is still</b> owned by the APE::File and should not be
+ * \note This may return a valid pointer regardless of whether or not the
+ * file on disk has an ID3v1 tag. Use hasID3v1Tag() to check if the file
+ * on disk actually has an ID3v1 tag.
+ *
+ * \note The Tag <b>is still</b> owned by the MPEG::File and should not be
* deleted by the user. It will be deleted when the file (object) is
* destroyed.
+ *
+ * \see hasID3v1Tag()
*/
ID3v1::Tag *ID3v1Tag(bool create = false);
/*!
* Returns a pointer to the APE tag of the file.
*
- * If \a create is false (the default) this will return a null pointer
+ * If \a create is false (the default) this may return a null pointer
* if there is no valid APE tag. If \a create is true it will create
- * a APE tag if one does not exist.
+ * an APE tag if one does not exist and returns a valid pointer.
+ *
+ * \note This may return a valid pointer regardless of whether or not the
+ * file on disk has an APE tag. Use hasAPETag() to check if the file
+ * on disk actually has an APE tag.
*
- * \note The Tag <b>is still</b> owned by the APE::File and should not be
+ * \note The Tag <b>is still</b> owned by the MPEG::File and should not be
* deleted by the user. It will be deleted when the file (object) is
* destroyed.
+ *
+ * \see hasAPETag()
*/
APE::Tag *APETag(bool create = false);
void strip(int tags = AllTags);
/*!
- * Returns whether or not the file on disk contains an ID3v1 tag.
+ * Returns whether or not the file on disk actually has an ID3v1 tag.
+ *
+ * \see ID3v1Tag()
*/
bool hasID3v1Tag() const;
/*!
- * Returns whether or not the file on disk contains an APE tag.
+ * Returns whether or not the file on disk actually has an APE tag.
+ *
+ * \see APETag()
*/
bool hasAPETag() const;