From 286d474dae645411a8b240c772eb6b1a03070216 Mon Sep 17 00:00:00 2001 From: Scott Wheeler Date: Sun, 29 Jan 2006 16:06:07 +0000 Subject: [PATCH] Cleanups -- no functional changes. git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@503573 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- flac/flacfile.cpp | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/flac/flacfile.cpp b/flac/flacfile.cpp index a60e02e2..439e12a4 100644 --- a/flac/flacfile.cpp +++ b/flac/flacfile.cpp @@ -34,9 +34,10 @@ using namespace TagLib; namespace TagLib { -namespace FLAC { - enum BLOCK_TYPE { STREAMINFO = 0, PADDING, APPLICATION, SEEKTABLE, VORBISCOMMENT, CUESHEET }; -}} + namespace FLAC { + enum BlockType { StreamInfo = 0, Padding, Application, SeekTable, VorbisComment, CueSheet }; + } +} class FLAC::File::FilePrivate { @@ -79,9 +80,9 @@ public: FLAC::Tag *tag; Properties *properties; -// Map metaData; ByteVector streamInfoData; ByteVector xiphCommentData; + long flacStart; long streamStart; long streamLength; @@ -180,7 +181,7 @@ bool FLAC::File::save() length = header.mid(1, 3).toUInt(); // Type is vorbiscomment - if(blockType == 4) { + if(blockType == VorbisComment) { v[0] = header[0]; insert(v, nextPageOffset, length + 4); break; @@ -330,7 +331,6 @@ ByteVector FLAC::File::streamInfoData() { if (isValid()) return d->streamInfoData; -// return d->metaData[STREAMINFO]; else return ByteVector(); } @@ -339,7 +339,6 @@ ByteVector FLAC::File::xiphCommentData() { if (isValid() && d->hasXiphComment) return d->xiphCommentData; -// return d->metaData[VORBISCOMMENT]; else return ByteVector(); } @@ -395,13 +394,13 @@ void FLAC::File::scan() uint length = header.mid(1, 3).toUInt(); // First block should be the stream_info metadata - if(blockType != 0) { + + if(blockType != StreamInfo) { debug("FLAC::File::scan() -- invalid FLAC stream"); setValid(false); return; } d->streamInfoData = readBlock(length); -// d->metadata.insert(STREAMINFO, readBlock(length)); nextPageOffset += length + 4; // Search through the remaining metadata @@ -412,13 +411,12 @@ void FLAC::File::scan() lastBlock = header[0] & 0x80; length = header.mid(1, 3).toUInt(); - if(blockType == 1) { + if(blockType == Padding) { // debug("FLAC::File::scan() -- Padding found"); } // Found the vorbis-comment - else if(blockType == 4) { + else if(blockType == VorbisComment) { d->xiphCommentData = readBlock(length); -// d->metadata.insert(VORBISCOMMENT, readBlock(length)); d->hasXiphComment = true; }