本文整理汇总了C++中CPVRDatabase::GetChannelSettings方法的典型用法代码示例。如果您正苦于以下问题:C++ CPVRDatabase::GetChannelSettings方法的具体用法?C++ CPVRDatabase::GetChannelSettings怎么用?C++ CPVRDatabase::GetChannelSettings使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPVRDatabase
的用法示例。
在下文中一共展示了CPVRDatabase::GetChannelSettings方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadCurrentChannelSettings
void CPVRClients::LoadCurrentChannelSettings(void)
{
CPVRChannelPtr channel;
{
CSingleLock lock(m_critSection);
if (!GetPlayingChannel(channel))
return;
}
CPVRDatabase *database = GetPVRDatabase();
if (!database)
return;
if (g_application.m_pPlayer)
{
/* set the default settings first */
CVideoSettings loadedChannelSettings = g_settings.m_defaultVideoSettings;
/* try to load the settings from the database */
database->GetChannelSettings(*channel, loadedChannelSettings);
g_settings.m_currentVideoSettings = g_settings.m_defaultVideoSettings;
g_settings.m_currentVideoSettings.m_Brightness = loadedChannelSettings.m_Brightness;
g_settings.m_currentVideoSettings.m_Contrast = loadedChannelSettings.m_Contrast;
g_settings.m_currentVideoSettings.m_Gamma = loadedChannelSettings.m_Gamma;
g_settings.m_currentVideoSettings.m_Crop = loadedChannelSettings.m_Crop;
g_settings.m_currentVideoSettings.m_CropLeft = loadedChannelSettings.m_CropLeft;
g_settings.m_currentVideoSettings.m_CropRight = loadedChannelSettings.m_CropRight;
g_settings.m_currentVideoSettings.m_CropTop = loadedChannelSettings.m_CropTop;
g_settings.m_currentVideoSettings.m_CropBottom = loadedChannelSettings.m_CropBottom;
g_settings.m_currentVideoSettings.m_CustomPixelRatio = loadedChannelSettings.m_CustomPixelRatio;
g_settings.m_currentVideoSettings.m_CustomZoomAmount = loadedChannelSettings.m_CustomZoomAmount;
g_settings.m_currentVideoSettings.m_CustomVerticalShift = loadedChannelSettings.m_CustomVerticalShift;
g_settings.m_currentVideoSettings.m_NoiseReduction = loadedChannelSettings.m_NoiseReduction;
g_settings.m_currentVideoSettings.m_Sharpness = loadedChannelSettings.m_Sharpness;
g_settings.m_currentVideoSettings.m_InterlaceMethod = loadedChannelSettings.m_InterlaceMethod;
g_settings.m_currentVideoSettings.m_OutputToAllSpeakers = loadedChannelSettings.m_OutputToAllSpeakers;
g_settings.m_currentVideoSettings.m_AudioDelay = loadedChannelSettings.m_AudioDelay;
g_settings.m_currentVideoSettings.m_AudioStream = loadedChannelSettings.m_AudioStream;
g_settings.m_currentVideoSettings.m_SubtitleOn = loadedChannelSettings.m_SubtitleOn;
g_settings.m_currentVideoSettings.m_SubtitleDelay = loadedChannelSettings.m_SubtitleDelay;
g_settings.m_currentVideoSettings.m_CustomNonLinStretch = loadedChannelSettings.m_CustomNonLinStretch;
g_settings.m_currentVideoSettings.m_ScalingMethod = loadedChannelSettings.m_ScalingMethod;
g_settings.m_currentVideoSettings.m_PostProcess = loadedChannelSettings.m_PostProcess;
g_settings.m_currentVideoSettings.m_DeinterlaceMode = loadedChannelSettings.m_DeinterlaceMode;
/* only change the view mode if it's different */
if (g_settings.m_currentVideoSettings.m_ViewMode != loadedChannelSettings.m_ViewMode)
{
g_settings.m_currentVideoSettings.m_ViewMode = loadedChannelSettings.m_ViewMode;
g_renderManager.SetViewMode(g_settings.m_currentVideoSettings.m_ViewMode);
g_settings.m_currentVideoSettings.m_CustomZoomAmount = g_settings.m_fZoomAmount;
g_settings.m_currentVideoSettings.m_CustomPixelRatio = g_settings.m_fPixelRatio;
}
/* only change the subtitle stream, if it's different */
if (g_settings.m_currentVideoSettings.m_SubtitleStream != loadedChannelSettings.m_SubtitleStream)
{
g_settings.m_currentVideoSettings.m_SubtitleStream = loadedChannelSettings.m_SubtitleStream;
g_application.m_pPlayer->SetSubtitle(g_settings.m_currentVideoSettings.m_SubtitleStream);
}
/* only change the audio stream if it's different */
if (g_application.m_pPlayer->GetAudioStream() != g_settings.m_currentVideoSettings.m_AudioStream &&
g_settings.m_currentVideoSettings.m_AudioStream >= 0)
g_application.m_pPlayer->SetAudioStream(g_settings.m_currentVideoSettings.m_AudioStream);
g_application.m_pPlayer->SetAVDelay(g_settings.m_currentVideoSettings.m_AudioDelay);
g_application.m_pPlayer->SetDynamicRangeCompression((long)(g_settings.m_currentVideoSettings.m_VolumeAmplification * 100));
g_application.m_pPlayer->SetSubtitleVisible(g_settings.m_currentVideoSettings.m_SubtitleOn);
g_application.m_pPlayer->SetSubTitleDelay(g_settings.m_currentVideoSettings.m_SubtitleDelay);
/* settings can be saved on next channel switch */
m_bIsValidChannelSettings = true;
}
}