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; } }