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


C++ Metadata::GetDiscNumber方法代码示例

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


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

示例1:

void SFB::Audio::Metadata::CopyMetadata(const Metadata& metadata, unsigned kind)
{
	if(Basic & kind) {
		SetValue(kTitleKey, metadata.GetTitle());
		SetValue(kAlbumTitleKey, metadata.GetAlbumTitle());
		SetValue(kArtistKey, metadata.GetArtist());
		SetValue(kAlbumArtistKey, metadata.GetAlbumArtist());
		SetValue(kGenreKey, metadata.GetGenre());
		SetValue(kComposerKey, metadata.GetComposer());
		SetValue(kReleaseDateKey, metadata.GetReleaseDate());
		SetValue(kCompilationKey, metadata.GetCompilation());
		SetValue(kTrackNumberKey, metadata.GetTrackNumber());
		SetValue(kTrackTotalKey, metadata.GetTrackTotal());
		SetValue(kDiscNumberKey, metadata.GetDiscNumber());
		SetValue(kDiscTotalKey, metadata.GetDiscTotal());
		SetValue(kLyricsKey, metadata.GetLyrics());
		SetValue(kBPMKey, metadata.GetBPM());
		SetValue(kRatingKey, metadata.GetRating());
		SetValue(kCommentKey, metadata.GetComment());
		SetValue(kISRCKey, metadata.GetISRC());
		SetValue(kMCNKey, metadata.GetMCN());
		SetValue(kMusicBrainzReleaseIDKey, metadata.GetMusicBrainzReleaseID());
		SetValue(kMusicBrainzRecordingIDKey, metadata.GetMusicBrainzRecordingID());
	}

	if(Sorting & kind) {
		SetValue(kTitleSortOrderKey, metadata.GetTitleSortOrder());
		SetValue(kAlbumTitleSortOrderKey, metadata.GetAlbumTitleSortOrder());
		SetValue(kArtistSortOrderKey, metadata.GetArtistSortOrder());
		SetValue(kAlbumArtistSortOrderKey, metadata.GetAlbumArtistSortOrder());
		SetValue(kComposerSortOrderKey, metadata.GetComposer());
	}

	if(Grouping & kind)
		SetValue(kGroupingKey, metadata.GetGrouping());

	if(Additional & kind)
		SetValue(kAdditionalMetadataKey, metadata.GetAdditionalMetadata());

	if(ReplayGain & kind) {
		SetValue(kReferenceLoudnessKey, metadata.GetReplayGainReferenceLoudness());
		SetValue(kTrackGainKey, metadata.GetReplayGainTrackGain());
		SetValue(kTrackPeakKey, metadata.GetReplayGainTrackPeak());
		SetValue(kAlbumGainKey, metadata.GetReplayGainAlbumGain());
		SetValue(kAlbumPeakKey, metadata.GetReplayGainAlbumPeak());
	}
}
开发者ID:JanX2,项目名称:SFBAudioEngine,代码行数:47,代码来源:AudioMetadata.cpp

示例2: if


//.........这里部分代码省略.........
	if(trackNumber && trackTotal) {
		SFB::CFString str = CFStringCreateWithFormat(kCFAllocatorDefault, nullptr, CFSTR("%@/%@"), trackNumber, trackTotal);

		auto frame = new TagLib::ID3v2::TextIdentificationFrame("TRCK", TagLib::String::Latin1);
		frame->setText(TagLib::StringFromCFString(str));
		tag->addFrame(frame);
	}
	else if(trackNumber) {		
		SFB::CFString str = CFStringCreateWithFormat(kCFAllocatorDefault, nullptr, CFSTR("%@"), trackNumber);
		
		auto frame = new TagLib::ID3v2::TextIdentificationFrame("TRCK", TagLib::String::Latin1);
		frame->setText(TagLib::StringFromCFString(str));
		tag->addFrame(frame);
	}
	else if(trackTotal) {		
		SFB::CFString str = CFStringCreateWithFormat(kCFAllocatorDefault, nullptr, CFSTR("/%@"), trackTotal);
		
		auto frame = new TagLib::ID3v2::TextIdentificationFrame("TRCK", TagLib::String::Latin1);
		frame->setText(TagLib::StringFromCFString(str));
		tag->addFrame(frame);
	}
	
	// Compilation
	// iTunes uses the TCMP frame for this, which isn't in the standard, but we'll use it for compatibility
	tag->removeFrames("TCMP");
	if(metadata.GetCompilation()) {
		auto frame = new TagLib::ID3v2::TextIdentificationFrame("TCMP", TagLib::String::Latin1);
		frame->setText(CFBooleanGetValue(metadata.GetCompilation()) ? "1" : "0");
		tag->addFrame(frame);
	}
	
	// Disc number and total discs
	tag->removeFrames("TPOS");
	CFNumberRef discNumber	= metadata.GetDiscNumber();
	CFNumberRef discTotal	= metadata.GetDiscTotal();
	if(discNumber && discTotal) {
		SFB::CFString str = CFStringCreateWithFormat(kCFAllocatorDefault, nullptr, CFSTR("%@/%@"), discNumber, discTotal);
		
		auto frame = new TagLib::ID3v2::TextIdentificationFrame("TPOS", TagLib::String::Latin1);
		frame->setText(TagLib::StringFromCFString(str));
		tag->addFrame(frame);
	}
	else if(discNumber) {		
		SFB::CFString str = CFStringCreateWithFormat(kCFAllocatorDefault, nullptr, CFSTR("%@"), discNumber);
		
		auto frame = new TagLib::ID3v2::TextIdentificationFrame("TPOS", TagLib::String::Latin1);
		frame->setText(TagLib::StringFromCFString(str));
		tag->addFrame(frame);
	}
	else if(discTotal) {		
		SFB::CFString str = CFStringCreateWithFormat(kCFAllocatorDefault, nullptr, CFSTR("/%@"), discTotal);
		
		auto frame = new TagLib::ID3v2::TextIdentificationFrame("TPOS", TagLib::String::Latin1);
		frame->setText(TagLib::StringFromCFString(str));
		tag->addFrame(frame);
	}
	
	// Lyrics
	tag->removeFrames("USLT");
	if(metadata.GetLyrics()) {
		auto frame = new TagLib::ID3v2::UnsynchronizedLyricsFrame(TagLib::String::UTF8);
		frame->setText(TagLib::StringFromCFString(metadata.GetLyrics()));
		tag->addFrame(frame);
	}

	tag->removeFrames("TSRC");
开发者ID:xdpsee,项目名称:SFBAudioEngine,代码行数:67,代码来源:SetID3v2TagFromMetadata.cpp


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