void CPVRGUIInfo::TimerInfo::UpdateNextTimer() { std::string strNextRecordingTitle; std::string strNextRecordingChannelName; std::string strNextRecordingChannelIcon; std::string strNextRecordingTime; std::string strNextTimerInfo; CFileItemPtr tag = GetNextActiveTimer(); if (tag && tag->HasPVRTimerInfoTag()) { CPVRTimerInfoTagPtr timer = tag->GetPVRTimerInfoTag(); strNextRecordingTitle = StringUtils::Format("%s", timer->Title().c_str()); strNextRecordingChannelName = StringUtils::Format("%s", timer->ChannelName().c_str()); strNextRecordingChannelIcon = StringUtils::Format("%s", timer->ChannelIcon().c_str()); strNextRecordingTime = StringUtils::Format("%s", timer->StartAsLocalTime().GetAsLocalizedDateTime(false, false).c_str()); strNextTimerInfo = StringUtils::Format("%s %s %s %s", g_localizeStrings.Get(19106).c_str(), timer->StartAsLocalTime().GetAsLocalizedDate(true).c_str(), g_localizeStrings.Get(19107).c_str(), timer->StartAsLocalTime().GetAsLocalizedTime("HH:mm", false).c_str()); } CSingleLock lock(m_critSection); m_strNextRecordingTitle = strNextRecordingTitle; m_strNextRecordingChannelName = strNextRecordingChannelName; m_strNextRecordingChannelIcon = strNextRecordingChannelIcon; m_strNextRecordingTime = strNextRecordingTime; m_strNextTimerInfo = strNextTimerInfo; }
void CPVRGUIInfo::TimerInfo::UpdateTimersToggle() { if (!TimerInfoToggle()) return; std::string strActiveTimerTitle; std::string strActiveTimerChannelName; std::string strActiveTimerChannelIcon; std::string strActiveTimerTime; /* safe to fetch these unlocked, since they're updated from the same thread as this one */ if (m_iRecordingTimerAmount > 0) { std::vector<CFileItemPtr> activeTags = GetActiveRecordings(); if (m_iTimerInfoToggleCurrent < activeTags.size() && activeTags.at(m_iTimerInfoToggleCurrent)->HasPVRTimerInfoTag()) { CPVRTimerInfoTagPtr tag = activeTags.at(m_iTimerInfoToggleCurrent)->GetPVRTimerInfoTag(); strActiveTimerTitle = StringUtils::Format("%s", tag->Title().c_str()); strActiveTimerChannelName = StringUtils::Format("%s", tag->ChannelName().c_str()); strActiveTimerChannelIcon = StringUtils::Format("%s", tag->ChannelIcon().c_str()); strActiveTimerTime = StringUtils::Format("%s", tag->StartAsLocalTime().GetAsLocalizedDateTime(false, false).c_str()); } } CSingleLock lock(m_critSection); m_strActiveTimerTitle = strActiveTimerTitle; m_strActiveTimerChannelName = strActiveTimerChannelName; m_strActiveTimerChannelIcon = strActiveTimerChannelIcon; m_strActiveTimerTime = strActiveTimerTime; }