本文整理汇总了C++中id3v2::FrameList::end方法的典型用法代码示例。如果您正苦于以下问题:C++ FrameList::end方法的具体用法?C++ FrameList::end怎么用?C++ FrameList::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类id3v2::FrameList
的用法示例。
在下文中一共展示了FrameList::end方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
UnsynchronizedLyricsFrame *UnsynchronizedLyricsFrame::findByDescription(const ID3v2::Tag *tag, const String &d) // static
{
ID3v2::FrameList lyrics = tag->frameList("USLT");
for(ID3v2::FrameList::ConstIterator it = lyrics.begin(); it != lyrics.end(); ++it){
UnsynchronizedLyricsFrame *frame = dynamic_cast<UnsynchronizedLyricsFrame *>(*it);
if(frame && frame->description() == d)
return frame;
}
return 0;
}
示例2:
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;
}
示例3:
ChapterFrame *ChapterFrame::findByElementID(const ID3v2::Tag *tag, const ByteVector &eID) // static
{
ID3v2::FrameList comments = tag->frameList("CHAP");
for(ID3v2::FrameList::ConstIterator it = comments.begin();
it != comments.end();
++it)
{
ChapterFrame *frame = dynamic_cast<ChapterFrame *>(*it);
if(frame && frame->elementID() == eID)
return frame;
}
return 0;
}
示例4:
TableOfContentsFrame *TableOfContentsFrame::findTopLevel(const ID3v2::Tag *tag) // static
{
ID3v2::FrameList tablesOfContents = tag->frameList("CTOC");
for(ID3v2::FrameList::ConstIterator it = tablesOfContents.begin();
it != tablesOfContents.end();
++it)
{
TableOfContentsFrame *frame = dynamic_cast<TableOfContentsFrame *>(*it);
if(frame && frame->isTopLevel() == true)
return frame;
}
return 0;
}
示例5:
UniqueFileIdentifierFrame *UniqueFileIdentifierFrame::findByOwner(const ID3v2::Tag *tag, const String &o) // static
{
ID3v2::FrameList comments = tag->frameList("UFID");
for(ID3v2::FrameList::ConstIterator it = comments.begin();
it != comments.end();
++it)
{
UniqueFileIdentifierFrame *frame = dynamic_cast<UniqueFileIdentifierFrame *>(*it);
if(frame && frame->owner() == o)
return frame;
}
return 0;
}
示例6:
TableOfContentsFrame *TableOfContentsFrame::findByElementID(const ID3v2::Tag *tag, const ByteVector &eID) // static
{
ID3v2::FrameList tablesOfContents = tag->frameList("CTOC");
for(ID3v2::FrameList::ConstIterator it = tablesOfContents.begin();
it != tablesOfContents.end();
++it)
{
TableOfContentsFrame *frame = dynamic_cast<TableOfContentsFrame *>(*it);
if(frame && frame->elementID() == eID)
return frame;
}
return 0;
}
示例7: save
//.........这里部分代码省略.........
FLAC::File &flacF = ( FLAC::File & )file;
flacF.removePictures();
if ( hasPicture )
{
FLAC::Picture *flacPicture = new FLAC::Picture;
flacPicture->setMimeType( pictureMimeType.data() );
flacPicture->setType( FLAC::Picture::FrontCover );
flacPicture->setData( *picture );
flacF.addPicture( flacPicture );
}
mustSave = true;
}
else if ( instanceOf( file, MP4::File ) )
{
MP4::ItemListMap &itemListMap = ( ( MP4::File & )file ).tag()->itemListMap();
if ( itemListMap.contains( "covr" ) )
itemListMap.erase( "covr" );
if ( hasPicture )
{
MP4::CoverArt::Format format = ( MP4::CoverArt::Format )0;
if ( pictureMimeType == "image/jpeg" )
format = MP4::CoverArt::JPEG;
else if ( pictureMimeType == "image/png" )
format = MP4::CoverArt::PNG;
#if TAGLIB18
else if ( pictureMimeType == "image/bmp" )
format = MP4::CoverArt::BMP;
else if ( pictureMimeType == "image/gif" )
format = MP4::CoverArt::GIF;
#endif
if ( format )
{
MP4::CoverArtList coverArtList;
coverArtList.append( MP4::CoverArt( format, *picture ) );
itemListMap.insert( "covr", coverArtList );
}
}
mustSave = true;
}
else if ( isOgg( file ) )
{
Ogg::XiphComment *xiphComment = getXiphComment( file );
if ( xiphComment )
{
xiphComment->removeField( "METADATA_BLOCK_PICTURE" );
if ( hasPicture )
{
FLAC::Picture flacPicture;
flacPicture.setMimeType( pictureMimeType.data() );
flacPicture.setType( FLAC::Picture::FrontCover );
flacPicture.setData( *picture );
const ByteVector pict_data = flacPicture.render();
xiphComment->addField( "METADATA_BLOCK_PICTURE", QByteArray::fromRawData( pict_data.data(), pict_data.size() ).toBase64().data() );
}
mustSave = true;
}
}
}
else if ( !isChecked() ) //Usuwanie wszystkich znanych tagów
{
mustSave = true;
if ( instanceOf( file, MPEG::File ) )
( ( MPEG::File & )file ).strip();
else if ( instanceOf( file, MPC::File ) )
( ( MPC::File & )file ).strip();
示例8: strncpy
/**
* Read meta information from id3v2 tags
* @param tag: the id3v2 tag
* @param p_demux; the demux object
* @param p_demux_meta: the demuxer meta
* @param p_meta: the meta
*/
static void ReadMetaFromId3v2( ID3v2::Tag* tag, demux_t* p_demux, demux_meta_t* p_demux_meta, vlc_meta_t* p_meta )
{
// Get the unique file identifier
ID3v2::FrameList list = tag->frameListMap()["UFID"];
ID3v2::FrameList::Iterator iter;
for( iter = list.begin(); iter != list.end(); iter++ )
{
ID3v2::UniqueFileIdentifierFrame* p_ufid =
dynamic_cast<ID3v2::UniqueFileIdentifierFrame*>(*iter);
const char *owner = p_ufid->owner().toCString();
if (!strcmp( owner, "http://musicbrainz.org" ))
{
/* ID3v2 UFID contains up to 64 bytes binary data
* but in our case it will be a '\0'
* terminated string */
char psz_ufid[64];
int max_size = __MIN( p_ufid->identifier().size(), 63);
strncpy( psz_ufid, p_ufid->identifier().data(), max_size );
psz_ufid[max_size] = '\0';
vlc_meta_SetTrackID( p_meta, psz_ufid );
}
}
// Get the use text
list = tag->frameListMap()["TXXX"];
for( iter = list.begin(); iter != list.end(); iter++ )
{
ID3v2::UserTextIdentificationFrame* p_txxx =
dynamic_cast<ID3v2::UserTextIdentificationFrame*>(*iter);
vlc_meta_AddExtra( p_meta, p_txxx->description().toCString( true ),
p_txxx->fieldList().toString().toCString( true ) );
}
// Get some more informations
#define SET( tagName, metaName ) \
list = tag->frameListMap()[tagName]; \
if( !list.isEmpty() ) \
vlc_meta_Set##metaName( p_meta, \
(*list.begin())->toString().toCString( true ) );
SET( "TCOP", Copyright );
SET( "TENC", EncodedBy );
SET( "TLAN", Language );
SET( "TPUB", Publisher );
#undef SET
/* Preferred type of image
* The 21 types are defined in id3v2 standard:
* http://www.id3.org/id3v2.4.0-frames */
static const int pi_cover_score[] = {
0, /* Other */
5, /* 32x32 PNG image that should be used as the file icon */
4, /* File icon of a different size or format. */
20, /* Front cover image of the album. */
19, /* Back cover image of the album. */
13, /* Inside leaflet page of the album. */
18, /* Image from the album itself. */
17, /* Picture of the lead artist or soloist. */
16, /* Picture of the artist or performer. */
14, /* Picture of the conductor. */
15, /* Picture of the band or orchestra. */
9, /* Picture of the composer. */
8, /* Picture of the lyricist or text writer. */
7, /* Picture of the recording location or studio. */
10, /* Picture of the artists during recording. */
11, /* Picture of the artists during performance. */
6, /* Picture from a movie or video related to the track. */
1, /* Picture of a large, coloured fish. */
12, /* Illustration related to the track. */
3, /* Logo of the band or performer. */
2 /* Logo of the publisher (record company). */
};
int i_score = -1;
// Try now to get embedded art
list = tag->frameListMap()[ "APIC" ];
if( list.isEmpty() )
return;
TAB_INIT( p_demux_meta->i_attachments, p_demux_meta->attachments );
for( iter = list.begin(); iter != list.end(); iter++ )
{
ID3v2::AttachedPictureFrame* p_apic =
dynamic_cast<ID3v2::AttachedPictureFrame*>(*iter);
input_attachment_t *p_attachment;
const char *psz_mime;
char *psz_name, *psz_description;
// Get the mime and description of the image.
// If the description is empty, take the type as a description
psz_mime = p_apic->mimeType().toCString( true );
//.........这里部分代码省略.........