Commit b21f1908 authored by Erik de Castro Lopo's avatar Erik de Castro Lopo

Add a convenience function to create a Metadata::Padding object with a

certain size in one statement.

Patch from Bastiaan Timmer <basjetimmer@yahoo.com>
parent 8d9e5c6e
......@@ -359,6 +359,10 @@ namespace FLAC {
*/
inline Padding(::FLAC__StreamMetadata *object, bool copy): Prototype(object, copy) { }
/** Constructs an object with the given length.
*/
Padding(unsigned length);
~Padding();
//@{
......@@ -387,6 +391,8 @@ namespace FLAC {
inline bool operator!=(const ::FLAC__StreamMetadata *object) const { return Prototype::operator!=(object); }
//@}
/** Sets the length in bytes of the padding block.
*/
void set_length(unsigned length);
};
......
......@@ -361,6 +361,12 @@ namespace FLAC {
Prototype(FLAC__metadata_object_new(FLAC__METADATA_TYPE_PADDING), /*copy=*/false)
{ }
Padding::Padding(unsigned length):
Prototype(FLAC__metadata_object_new(FLAC__METADATA_TYPE_PADDING), /*copy=*/false)
{
set_length(length);
}
Padding::~Padding()
{ }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment