]> granicus.if.org Git - taglib/commitdiff
Scott's silly nitpicks...
authorScott Wheeler <wheeler@kde.org>
Thu, 9 Sep 2004 00:28:57 +0000 (00:28 +0000)
committerScott Wheeler <wheeler@kde.org>
Thu, 9 Sep 2004 00:28:57 +0000 (00:28 +0000)
git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@345141 283d02a7-25f6-0310-bc7c-ecb5cbfe19da

ape/apefooter.cpp
ape/apetag.cpp
fileref.cpp
fileref.h
mpc/mpcproperties.cpp
mpeg/id3v2/frames/uniquefileidentifierframe.cpp

index bde69782c9d0f3856b4d76dfcbec66eaafe4d925..5fc8c26023af86daaaeacf1a2b1ba4b24ce44de0 100644 (file)
@@ -172,20 +172,24 @@ void Footer::parse(const ByteVector &data)
   // The first eight bytes, data[0..7], are the File Identifier, "APETAGEX".
 
   // Read the version number
+
   d->version = data.mid(8, 4).toUInt(false);
 
   // Read the tag size
+
   d->tagSize = data.mid(12, 4).toUInt(false);
 
   // Read the item count
+
   d->itemCount = data.mid(16, 4).toUInt(false);
 
   // Read the flags
+
   std::bitset<32> flags(data.mid(20, 4).toUInt(false));
 
-  d->headerPresent         = flags[31];
-  d->footerPresent         = !flags[30];
-  d->isHeader              = flags[29];
+  d->headerPresent = flags[31];
+  d->footerPresent = !flags[30];
+  d->isHeader = flags[29];
 
 }
 
@@ -194,6 +198,7 @@ ByteVector Footer::render(bool isHeader) const
   ByteVector v;
 
   // add the file identifier -- "APETAGEX"
+
   v.append(fileIdentifier());
 
   // add the version number -- we always render a 2.000 tag regardless of what
@@ -202,12 +207,15 @@ ByteVector Footer::render(bool isHeader) const
   v.append(ByteVector::fromUInt(2000, false));
 
   // add the tag size
+
   v.append(ByteVector::fromUInt(d->tagSize, false));
 
   // add the item count
+
   v.append(ByteVector::fromUInt(d->itemCount, false));
 
   // render and add the flags
+
   std::bitset<32> flags;
 
   flags[31] = d->headerPresent;
@@ -217,6 +225,7 @@ ByteVector Footer::render(bool isHeader) const
   v.append(ByteVector::fromUInt(flags.to_ulong(), false));
 
   // add the reserved 64bit
+
   v.append(ByteVector::fromLongLong(0));
 
   return v;
index 94df2b134e88c75a0e3bd02903578f225a11536c..0474ee7d1095e672d5b13b109440b2a3b94b98a3 100644 (file)
@@ -149,7 +149,7 @@ void APE::Tag::setGenre(const String &s)
 
 void APE::Tag::setYear(uint i)
 {
-  if(i <=)
+  if(i <= 0)
     removeItem("YEAR");
   else
     addValue("YEAR", String::number(i), true);
@@ -157,7 +157,7 @@ void APE::Tag::setYear(uint i)
 
 void APE::Tag::setTrack(uint i)
 {
-  if(i <=)
+  if(i <= 0)
     removeItem("TRACK");
   else
     addValue("TRACK", String::number(i), true);
index 4e72396f40e1159e61eb2d7d563351d25b480c11..2da2e71ff2de780ceaf349b4a31a260496b82baf 100644 (file)
@@ -45,6 +45,11 @@ public:
 // public members
 ////////////////////////////////////////////////////////////////////////////////
 
+FileRef::FileRef()
+{
+    d = new FileRefPrivate(0);
+}
+
 FileRef::FileRef(const char *fileName, bool readAudioProperties,
                  AudioProperties::ReadStyle audioPropertiesStyle)
 {
index 14789e08d3501c027408d0423e90b725e871b01d..ffa7864fc37723bc00e04db569e09d4cc444bd51 100644 (file)
--- a/fileref.h
+++ b/fileref.h
@@ -69,6 +69,8 @@ namespace TagLib {
   {
   public:
 
+    FileRef();
+
     /*!
      * Create a FileRef from \a fileName.  If \a readAudioProperties is true then
      * the audio properties will be read using \a audioPropertiesStyle.  If
index 2c333edc46672bc9cdaafcba0ec2b78ba441fb2e..fb61b244d072c8aa630b7777db7cdcada9ce6130 100644 (file)
@@ -31,9 +31,9 @@ using namespace TagLib;
 class MPC::Properties::PropertiesPrivate
 {
 public:
-  PropertiesPrivate(const ByteVector &d, long st, ReadStyle s) :
+  PropertiesPrivate(const ByteVector &d, long length, ReadStyle s) :
     data(d),
-    streamLength(st),
+    streamLength(length),
     style(s),
     version(0),
     length(0),
@@ -114,7 +114,7 @@ void MPC::Properties::read()
   unsigned int frames;
 
   if(d->version >= 7) {
-    frames = d->data.mid(4,4).toUInt(false);
+    frames = d->data.mid(4, 4).toUInt(false);
 
     std::bitset<32> flags = d->data.mid(8, 4).toUInt(true);
     d->sampleRate = sftable[flags[17] * 2 + flags[16]];
index 40cade0004f358f15a25ca75c4ed6bb82bed5889..0eee906c04f706143cd9194ec112bb06105223ca 100644 (file)
@@ -33,6 +33,10 @@ public:
   ByteVector identifier;
 };
 
+////////////////////////////////////////////////////////////////////////////////
+// public methods
+////////////////////////////////////////////////////////////////////////////////
+
 UniqueFileIdentifierFrame::UniqueFileIdentifierFrame(const ByteVector &data) :
     ID3v2::Frame(data)
 {