本文整理汇总了C++中CEncoder::SetArtist方法的典型用法代码示例。如果您正苦于以下问题:C++ CEncoder::SetArtist方法的具体用法?C++ CEncoder::SetArtist怎么用?C++ CEncoder::SetArtist使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CEncoder
的用法示例。
在下文中一共展示了CEncoder::SetArtist方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetupEncoder
CEncoder* CCDDARipJob::SetupEncoder(CFile& reader)
{
CEncoder* encoder = NULL;
if (CSettings::Get().GetString("audiocds.encoder") == "audioencoder.xbmc.builtin.aac" ||
CSettings::Get().GetString("audiocds.encoder") == "audioencoder.xbmc.builtin.wma")
{
std::shared_ptr<IEncoder> enc(new CEncoderFFmpeg());
encoder = new CEncoder(enc);
}
else
{
AddonPtr addon;
CAddonMgr::Get().GetAddon(CSettings::Get().GetString("audiocds.encoder"), addon);
if (addon)
{
std::shared_ptr<CAudioEncoder> aud = std::static_pointer_cast<CAudioEncoder>(addon);
aud->Create();
std::shared_ptr<IEncoder> enc = std::static_pointer_cast<IEncoder>(aud);
encoder = new CEncoder(enc);
}
}
if (!encoder)
return NULL;
// we have to set the tags before we init the Encoder
std::string strTrack = StringUtils::Format("%li", strtol(m_input.substr(13, m_input.size() - 13 - 5).c_str(),NULL,10));
encoder->SetComment(std::string("Ripped with ") + CSysInfo::GetAppName());
encoder->SetArtist(StringUtils::Join(m_tag.GetArtist(),
g_advancedSettings.m_musicItemSeparator));
encoder->SetTitle(m_tag.GetTitle());
encoder->SetAlbum(m_tag.GetAlbum());
encoder->SetAlbumArtist(StringUtils::Join(m_tag.GetAlbumArtist(),
g_advancedSettings.m_musicItemSeparator));
encoder->SetGenre(StringUtils::Join(m_tag.GetGenre(),
g_advancedSettings.m_musicItemSeparator));
encoder->SetTrack(strTrack);
encoder->SetTrackLength(static_cast<int>(reader.GetLength()));
encoder->SetYear(m_tag.GetYearString());
// init encoder
if (!encoder->Init(m_output.c_str(), m_channels, m_rate, m_bps))
delete encoder, encoder = NULL;
return encoder;
}
示例2: SetupEncoder
CEncoder* CCDDARipJob::SetupEncoder(CFile& reader)
{
CEncoder* encoder = nullptr;
const std::string audioEncoder = CServiceBroker::GetSettingsComponent()->GetSettings()->GetString(CSettings::SETTING_AUDIOCDS_ENCODER);
if (audioEncoder == "audioencoder.kodi.builtin.aac" || audioEncoder == "audioencoder.kodi.builtin.wma")
{
std::shared_ptr<IEncoder> enc(new CEncoderFFmpeg());
encoder = new CEncoder(enc);
}
else
{
const BinaryAddonBasePtr addonInfo = CServiceBroker::GetBinaryAddonManager().GetInstalledAddonInfo(audioEncoder, ADDON_AUDIOENCODER);
if (addonInfo)
{
std::shared_ptr<IEncoder> enc = std::make_shared<CAudioEncoder>(addonInfo);
encoder = new CEncoder(enc);
}
}
if (!encoder)
return NULL;
// we have to set the tags before we init the Encoder
const std::string strTrack = StringUtils::Format("%li", strtol(m_input.substr(13, m_input.size() - 13 - 5).c_str(), nullptr, 10));
const std::string itemSeparator = CServiceBroker::GetSettingsComponent()->GetAdvancedSettings()->m_musicItemSeparator;
encoder->SetComment(std::string("Ripped with ") + CSysInfo::GetAppName());
encoder->SetArtist(StringUtils::Join(m_tag.GetArtist(), itemSeparator));
encoder->SetTitle(m_tag.GetTitle());
encoder->SetAlbum(m_tag.GetAlbum());
encoder->SetAlbumArtist(StringUtils::Join(m_tag.GetAlbumArtist(), itemSeparator));
encoder->SetGenre(StringUtils::Join(m_tag.GetGenre(), itemSeparator));
encoder->SetTrack(strTrack);
encoder->SetTrackLength(static_cast<int>(reader.GetLength()));
encoder->SetYear(m_tag.GetYearString());
// init encoder
if (!encoder->Init(m_output.c_str(), m_channels, m_rate, m_bps))
delete encoder, encoder = nullptr;
return encoder;
}