const infomap pvr[] = {{ "isrecording", PVR_IS_RECORDING },
{ "hastimer", PVR_HAS_TIMER },
+ { "hastvchannels", PVR_HAS_TV_CHANNELS },
+ { "hasradiochannels", PVR_HAS_RADIO_CHANNELS },
{ "hasnonrecordingtimer", PVR_HAS_NONRECORDING_TIMER },
{ "nowrecordingtitle", PVR_NOW_RECORDING_TITLE },
{ "nowrecordingdatetime", PVR_NOW_RECORDING_DATETIME },
#define PVR_IS_PLAYING_RADIO (PVR_CONDITIONS_START + 7)
#define PVR_IS_PLAYING_RECORDING (PVR_CONDITIONS_START + 8)
#define PVR_ACTUAL_STREAM_ENCRYPTED (PVR_CONDITIONS_START + 9)
-#define PVR_CONDITIONS_END PVR_ACTUAL_STREAM_ENCRYPTED
+#define PVR_HAS_TV_CHANNELS (PVR_CONDITIONS_START + 10)
+#define PVR_HAS_RADIO_CHANNELS (PVR_CONDITIONS_START + 11)
+#define PVR_CONDITIONS_END PVR_HAS_RADIO_CHANNELS
#define PVR_STRINGS_START 1200
#define PVR_NEXT_RECORDING_CHANNEL (PVR_STRINGS_START)
#include "pvr/timers/PVRTimers.h"
#include "pvr/recordings/PVRRecordings.h"
#include "pvr/channels/PVRChannel.h"
+#include "pvr/channels/PVRChannelGroupsContainer.h"
#include "epg/EpgInfoTag.h"
#include "settings/AdvancedSettings.h"
#include "settings/Settings.h"
bool bIsPlayingRadio = bStarted && g_PVRClients->IsPlayingRadio();
bool bIsPlayingRecording = bStarted && g_PVRClients->IsPlayingRecording();
bool bIsPlayingEncryptedStream = bStarted && g_PVRClients->IsEncrypted();
+ bool bHasTVChannels = bStarted && g_PVRChannelGroups->GetGroupAllTV()->HasChannels();
+ bool bHasRadioChannels = bStarted && g_PVRChannelGroups->GetGroupAllRadio()->HasChannels();
+
/* safe to fetch these unlocked, since they're updated from the same thread as this one */
bool bHasNonRecordingTimers = bStarted && m_iTimerAmount - m_iRecordingTimerAmount > 0;
m_bIsPlayingRadio = bIsPlayingRadio;
m_bIsPlayingRecording = bIsPlayingRecording;
m_bIsPlayingEncryptedStream = bIsPlayingEncryptedStream;
+ m_bHasTVChannels = bHasTVChannels;
+ m_bHasRadioChannels = bHasRadioChannels;
}
bool CPVRGUIInfo::TranslateCharInfo(DWORD dwInfo, CStdString &strValue) const
case PVR_HAS_TIMER:
bReturn = m_iTimerAmount > 0;
break;
+ case PVR_HAS_TV_CHANNELS:
+ bReturn = m_bHasTVChannels;
+ break;
+ case PVR_HAS_RADIO_CHANNELS:
+ bReturn = m_bHasRadioChannels;
+ break;
case PVR_HAS_NONRECORDING_TIMER:
bReturn = m_bHasNonRecordingTimers;
break;
bool m_bIsPlayingRadio;
bool m_bIsPlayingRecording;
bool m_bIsPlayingEncryptedStream;
+ bool m_bHasTVChannels;
+ bool m_bHasRadioChannels;
//@}
PVR_SIGNAL_STATUS m_qualityInfo; /*!< stream quality information */
return true;
}
+int CPVRChannelGroup::GetNumChannels() const
+{
+ return m_members.size();
+}
+
+bool CPVRChannelGroup::HasChannels() const
+{
+ return !m_members.empty();
+}
+
bool CPVRChannelGroup::ToggleChannelLocked(const CFileItem &item)
{
if (!item.HasPVRChannelInfoTag())
* @return The amount of hidden channels in this container.
*/
virtual int GetNumHiddenChannels(void) const { return 0; }
+
+ /*!
+ * @brief The amount of channels in this container.
+ * @return The amount of channels in this container.
+ */
+ int GetNumChannels(void) const;
+
+ /*!
+ * @brief Does this container holds channels.
+ * @return True if there is at least one channel in this container, otherwise false.
+ */
+ bool HasChannels(void) const;
/*!
* @return True if there is at least one channel in this group with changes that haven't been persisted, false otherwise.