Skip to content

Commit

Permalink
added: InfoLabels ListItem.PlayCount and VideoPlayer.PlayCount (closes
Browse files Browse the repository at this point in the history
  • Loading branch information
vdrfan committed Feb 9, 2011
1 parent 36b01be commit 44fcce6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
17 changes: 17 additions & 0 deletions xbmc/GUIInfoManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,7 @@ int CGUIInfoManager::TranslateSingleString(const CStdString &strCondition)
else if (strTest.Equals("videoplayer.audiocodec")) return VIDEOPLAYER_AUDIO_CODEC;
else if (strTest.Equals("videoplayer.audiochannels")) return VIDEOPLAYER_AUDIO_CHANNELS;
else if (strTest.Equals("videoplayer.hasteletext")) return VIDEOPLAYER_HASTELETEXT;
else if (strTest.Equals("videoplayer.playcount")) return VIDEOPLAYER_PLAYCOUNT;
}
else if (strCategory.Equals("playlist"))
{
Expand Down Expand Up @@ -947,6 +948,7 @@ int CGUIInfoManager::TranslateListItem(const CStdString &info)
else if (info.Equals("subtitlelanguage")) return LISTITEM_SUBTITLE_LANGUAGE;
else if (info.Equals("isfolder")) return LISTITEM_IS_FOLDER;
else if (info.Equals("originaltitle")) return LISTITEM_ORIGINALTITLE;
else if (info.Equals("playcount")) return LISTITEM_PLAYCOUNT;
else if (info.Left(9).Equals("property(")) return AddListItemProp(info.Mid(9, info.GetLength() - 10));
return 0;
}
Expand Down Expand Up @@ -1153,6 +1155,7 @@ CStdString CGUIInfoManager::GetLabel(int info, int contextWindow)
case VIDEOPLAYER_WRITER:
case VIDEOPLAYER_TAGLINE:
case VIDEOPLAYER_TRAILER:
case VIDEOPLAYER_PLAYCOUNT:
strLabel = GetVideoLabel(info);
break;
case VIDEOPLAYER_VIDEO_CODEC:
Expand Down Expand Up @@ -3205,6 +3208,13 @@ CStdString CGUIInfoManager::GetVideoLabel(int item)
return m_currentFile->GetVideoInfoTag()->m_strWritingCredits;
case VIDEOPLAYER_TAGLINE:
return m_currentFile->GetVideoInfoTag()->m_strTagLine;
case VIDEOPLAYER_PLAYCOUNT:
{
CStdString strPlayCount;
if (m_currentFile->GetVideoInfoTag()->m_playCount > 0)
strPlayCount.Format("%i", m_currentFile->GetVideoInfoTag()->m_playCount);
return strPlayCount;
}
}
}
return "";
Expand Down Expand Up @@ -3720,6 +3730,13 @@ CStdString CGUIInfoManager::GetItemLabel(const CFileItem *item, int info) const
if (item->HasVideoInfoTag())
return item->GetVideoInfoTag()->m_strOriginalTitle;
break;
case LISTITEM_PLAYCOUNT:
{
CStdString strPlayCount;
if (item->HasVideoInfoTag() && item->GetVideoInfoTag()->m_playCount > 0)
strPlayCount.Format("%i", item->GetVideoInfoTag()->m_playCount);
return strPlayCount;
}
case LISTITEM_TRACKNUMBER:
{
CStdString track;
Expand Down
2 changes: 2 additions & 0 deletions xbmc/GUIInfoManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ class CDateTime;
#define VIDEOPLAYER_VIDEO_ASPECT 290
#define VIDEOPLAYER_HASTELETEXT 291
#define VIDEOPLAYER_COUNTRY 292
#define VIDEOPLAYER_PLAYCOUNT 293

#define AUDIOSCROBBLER_ENABLED 300
#define AUDIOSCROBBLER_CONN_STATE 301
Expand Down Expand Up @@ -493,6 +494,7 @@ class CDateTime;
#define LISTITEM_IS_FOLDER (LISTITEM_START + 53)
#define LISTITEM_ORIGINALTITLE (LISTITEM_START + 54)
#define LISTITEM_COUNTRY (LISTITEM_START + 55)
#define LISTITEM_PLAYCOUNT (LISTITEM_START + 56)

#define LISTITEM_PROPERTY_START (LISTITEM_START + 200)
#define LISTITEM_PROPERTY_END (LISTITEM_PROPERTY_START + 1000)
Expand Down

0 comments on commit 44fcce6

Please sign in to comment.