当前位置: 首页>>代码示例>>C++>>正文


C++ FrameList::append方法代码示例

本文整理汇总了C++中taglib::id3v2::FrameList::append方法的典型用法代码示例。如果您正苦于以下问题:C++ FrameList::append方法的具体用法?C++ FrameList::append怎么用?C++ FrameList::append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在taglib::id3v2::FrameList的用法示例。


在下文中一共展示了FrameList::append方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

// Too bad can't use STL copy alogirthm....
// copy(src.begin(), src.end(), back_inserter(dest));
void MetaDSF::MetaDSFImpl::dupFrameList(const TagLib::ID3v2::FrameList &src, 
					TagLib::ID3v2::FrameList &dest) 
{
  TagLib::ID3v2::FrameList::ConstIterator it;

  for (it = src.begin(); it != src.end(); it++) {
    dest.append(*it);
  }
}
开发者ID:pekingduck,项目名称:metadsf,代码行数:11,代码来源:metadsf.cpp

示例2: deletePictures

int MetaDSF::deletePictures(const TagLib::String &ptype) 
{
  TagLib::ID3v2::FrameList l = _i->_file.ID3v2Tag()->frameList("APIC");
  TagLib::ID3v2::FrameList dl; // a list of frames to be deleted
  TagLib::ID3v2::FrameList::ConstIterator it;
  std::string pt = ptype.toCString();
  // retrieve a list of frames that matches the given type
  for (it = l.begin(); it != l.end(); it++) {
    TagLib::ID3v2::AttachedPictureFrame *f = 
      static_cast<TagLib::ID3v2::AttachedPictureFrame *>(*it);
    TagLib::ID3v2::AttachedPictureFrame::Type t = 
      static_cast<TagLib::ID3v2::AttachedPictureFrame::Type>(std::stoi(pt, 
								       0, 16));
    if (f->type() == t) {
      dl.append(f);
    }
  }  

  _i->deleteFrames(dl);
  _i->_changed = true;
  return dl.size();
}
开发者ID:pekingduck,项目名称:metadsf,代码行数:22,代码来源:metadsf.cpp

示例3: desc

static Meta::ReplayGainTagMap readID3v2Tags( TagLib::ID3v2::Tag *tag )
{
    Meta::ReplayGainTagMap map;
    {   // ID3v2.4.0 native replay gain tag support (as written by Quod Libet, for example).
        TagLib::ID3v2::FrameList frames = tag->frameListMap()["RVA2"];
        frames.append(tag->frameListMap()["XRVA"]);
        if ( !frames.isEmpty() )
        {
            for ( unsigned int i = 0; i < frames.size(); ++i )
            {
                // we have to parse this frame ourselves
                // ID3v2 frame header is 10 bytes, so skip that
                TagLib::ByteVector data = frames[i]->render().mid( 10 );
                unsigned int offset = 0;
                QString desc( data.data() );
                offset += desc.count() + 1;
                unsigned int channel = data.mid( offset, 1 ).toUInt( true );
                // channel 1 is the main volume - the only one we care about
                if ( channel == 1 )
                {
                    ++offset;
                    qint16 adjustment512 = data.mid( offset, 2 ).toShort( true );
                    qreal adjustment = ( (qreal)adjustment512 ) / 512.0;
                    offset += 2;
                    unsigned int peakBits = data.mid( offset, 1 ).toUInt( true );
                    ++offset;
                    bool ok = false;
                    qreal peak = readRVA2PeakValue( data.mid( offset ), peakBits, &ok );
                    if ( ok )
                    {
                        if ( desc.toLower() == "album" )
                        {
                            map[Meta::ReplayGain_Album_Gain] = adjustment;
                            map[Meta::ReplayGain_Album_Peak] = peakToDecibels( peak );
                        }
                        else if ( desc.toLower() == "track" || !map.contains( Meta::ReplayGain_Track_Gain ) )
                        {
                            map[Meta::ReplayGain_Track_Gain] = adjustment;
                            map[Meta::ReplayGain_Track_Peak] = peakToDecibels( peak );
                        }
                    }
                }
            }
            if ( !map.isEmpty() )
                return map;
        }
    }

    {   // Foobar2000-style ID3v2.3.0 tags
        TagLib::ID3v2::FrameList frames = tag->frameListMap()["TXXX"];
        for ( TagLib::ID3v2::FrameList::Iterator it = frames.begin(); it != frames.end(); ++it ) {
            TagLib::ID3v2::UserTextIdentificationFrame* frame =
                dynamic_cast<TagLib::ID3v2::UserTextIdentificationFrame*>( *it );
            if ( frame && frame->fieldList().size() >= 2 )
            {
                QString desc = TStringToQString( frame->description() ).toLower();
                if ( desc == "replaygain_album_gain" )
                    maybeAddGain( frame->fieldList()[1], Meta::ReplayGain_Album_Gain, &map );
                if ( desc == "replaygain_album_peak" )
                    maybeAddPeak( frame->fieldList()[1], Meta::ReplayGain_Album_Peak, &map );
                if ( desc == "replaygain_track_gain" )
                    maybeAddGain( frame->fieldList()[1], Meta::ReplayGain_Track_Gain, &map );
                if ( desc == "replaygain_track_peak" )
                    maybeAddPeak( frame->fieldList()[1], Meta::ReplayGain_Track_Peak, &map );
            }
        }
    }
    return map;
}
开发者ID:cancamilo,项目名称:amarok,代码行数:69,代码来源:MetaReplayGain.cpp


注:本文中的taglib::id3v2::FrameList::append方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。