***************************************************************************/
#include <tbytevectorlist.h>
+#include <id3v2tag.h>
#include <tdebug.h>
#include "commentsframe.h"
d->textEncoding = encoding;
}
+CommentsFrame *CommentsFrame::findByDescription(const ID3v2::Tag *tag, const String &d) // static
+{
+ ID3v2::FrameList comments = tag->frameList("COMM");
+
+ for(ID3v2::FrameList::ConstIterator it = comments.begin();
+ it != comments.end();
+ ++it)
+ {
+ CommentsFrame *frame = dynamic_cast<CommentsFrame *>(*it);
+ if(frame && frame->description() == d)
+ return frame;
+ }
+
+ return 0;
+}
+
////////////////////////////////////////////////////////////////////////////////
// protected members
////////////////////////////////////////////////////////////////////////////////
// The channel mode is encoded as a 2 bit value at the end of the 3nd byte,
// i.e. xxxxxx11
- d->channelMode = ChannelMode(uchar(data[2]) & 0x3);
+ d->channelMode = ChannelMode((uchar(data[3]) & 0xC0) >> 6);
// TODO: Add mode extension for completeness
- d->isCopyrighted = flags[0];
- d->isOriginal = flags[1];
+ d->isOriginal = flags[2];
+ d->isCopyrighted = flags[3];
// Calculate the frame length