From 29a31859ffe065fdf0c934c23dc2d6cb5a729568 Mon Sep 17 00:00:00 2001 From: Tsuda Kageyu Date: Fri, 31 Jul 2015 23:45:31 +0900 Subject: [PATCH] FLAC: Move some public functions to above private ones. --- taglib/flac/flacfile.cpp | 136 +++++++++++++++++++-------------------- 1 file changed, 68 insertions(+), 68 deletions(-) diff --git a/taglib/flac/flacfile.cpp b/taglib/flac/flacfile.cpp index e1db4bc2..66422f20 100644 --- a/taglib/flac/flacfile.cpp +++ b/taglib/flac/flacfile.cpp @@ -290,6 +290,74 @@ void FLAC::File::setID3v2FrameFactory(const ID3v2::FrameFactory *factory) d->ID3v2FrameFactory = factory; } +ByteVector FLAC::File::streamInfoData() +{ + return ByteVector(); +} + +long FLAC::File::streamLength() +{ + return 0; +} + +List FLAC::File::pictureList() +{ + List pictures; + for(uint i = 0; i < d->blocks.size(); i++) { + Picture *picture = dynamic_cast(d->blocks[i]); + if(picture) { + pictures.append(picture); + } + } + return pictures; +} + +void FLAC::File::addPicture(Picture *picture) +{ + d->blocks.append(picture); +} + +void FLAC::File::removePicture(Picture *picture, bool del) +{ + MetadataBlock *block = picture; + List::Iterator it = d->blocks.find(block); + if(it != d->blocks.end()) + d->blocks.erase(it); + + if(del) + delete picture; +} + +void FLAC::File::removePictures() +{ + List newBlocks; + for(uint i = 0; i < d->blocks.size(); i++) { + Picture *picture = dynamic_cast(d->blocks[i]); + if(picture) { + delete picture; + } + else { + newBlocks.append(d->blocks[i]); + } + } + d->blocks = newBlocks; +} + +bool FLAC::File::hasXiphComment() const +{ + return d->hasXiphComment; +} + +bool FLAC::File::hasID3v1Tag() const +{ + return d->hasID3v1; +} + +bool FLAC::File::hasID3v2Tag() const +{ + return d->hasID3v2; +} + //////////////////////////////////////////////////////////////////////////////// // private members //////////////////////////////////////////////////////////////////////////////// @@ -350,16 +418,6 @@ void FLAC::File::read(bool readProperties, Properties::ReadStyle propertiesStyle } } -ByteVector FLAC::File::streamInfoData() -{ - return ByteVector(); -} - -long FLAC::File::streamLength() -{ - return 0; -} - void FLAC::File::scan() { // Scan the metadata pages @@ -512,61 +570,3 @@ long FLAC::File::findID3v2() return -1; } - -List FLAC::File::pictureList() -{ - List pictures; - for(uint i = 0; i < d->blocks.size(); i++) { - Picture *picture = dynamic_cast(d->blocks[i]); - if(picture) { - pictures.append(picture); - } - } - return pictures; -} - -void FLAC::File::addPicture(Picture *picture) -{ - d->blocks.append(picture); -} - -void FLAC::File::removePicture(Picture *picture, bool del) -{ - MetadataBlock *block = picture; - List::Iterator it = d->blocks.find(block); - if(it != d->blocks.end()) - d->blocks.erase(it); - - if(del) - delete picture; -} - -void FLAC::File::removePictures() -{ - List newBlocks; - for(uint i = 0; i < d->blocks.size(); i++) { - Picture *picture = dynamic_cast(d->blocks[i]); - if(picture) { - delete picture; - } - else { - newBlocks.append(d->blocks[i]); - } - } - d->blocks = newBlocks; -} - -bool FLAC::File::hasXiphComment() const -{ - return d->hasXiphComment; -} - -bool FLAC::File::hasID3v1Tag() const -{ - return d->hasID3v1; -} - -bool FLAC::File::hasID3v2Tag() const -{ - return d->hasID3v2; -}