本文整理汇总了C++中id3v2::FrameList::size方法的典型用法代码示例。如果您正苦于以下问题:C++ FrameList::size方法的具体用法?C++ FrameList::size怎么用?C++ FrameList::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类id3v2::FrameList
的用法示例。
在下文中一共展示了FrameList::size方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: save
void QMPlay_Tag::save( bool clearID3 )
{
if ( dontUse )
return;
using namespace TagLib;
//ID3v2
{
Load_MPEG_File
if ( !canWriteID3 || clearID3 )
f->save( MPEG::File::NoTags );
else
{
ID3v2::Tag *id3v2 = f->ID3v2Tag();
if ( id3v2 )
{
ID3v2::FrameList pict = id3v2->frameList( "APIC" );
while ( pict.size() )
id3v2->removeFrame( pict[ 0 ] );
if ( !picture.isEmpty() )
{
ID3v2::AttachedPictureFrame *pictFrame = new ID3v2::AttachedPictureFrame;
pictFrame->setPicture( picture );
QString mimeType = "image/" + QImageReader( QDataStream( QByteArray( picture.data(), picture.size() ) ).device() ).format();
pictFrame->setMimeType( mimeType.toAscii().data() );
id3v2->addFrame( pictFrame );
}
f->save();
}
}
delete f;
}
if ( isFLAC )
{
Load_FLAC_File
if ( f->pictureList().size() )
f->removePictures();
if ( !picture.isEmpty() )
{
FLAC::Picture *pict = new FLAC::Picture;
pict->setData( picture );
QString mimeType = "image/" + QImageReader( QDataStream( QByteArray( picture.data(), picture.size() ) ).device() ).format();
pict->setMimeType( mimeType.toAscii().data() );
f->addPicture( pict );
}
f->save();
delete f;
}
//General tag
{
Load_FileRef
if ( !f->isNull() && f->tag() )
{
Tag *tag = f->tag();
tag->setTitle( title );
tag->setArtist( artist );
tag->setAlbum( album );
tag->setComment( comment );
tag->setGenre( genre );
tag->setYear( year );
tag->setTrack( track );
f->save();
}
delete f;
}
}