From 2bb3252b70f1982e12e3ceba5fbec4216ff87e16 Mon Sep 17 00:00:00 2001 From: Joakim Plate Date: Mon, 12 Nov 2012 20:50:44 +0100 Subject: gui: add generic Player.Title info label This is prepatory to allow display of metadata for non av players in the future and allowing skins to maintain compatibility with frodo. --- xbmc/GUIInfoManager.cpp | 9 +++++++++ xbmc/GUIInfoManager.h | 1 + 2 files changed, 10 insertions(+) diff --git a/xbmc/GUIInfoManager.cpp b/xbmc/GUIInfoManager.cpp index 7d26cb94d8..54e56d5110 100644 --- a/xbmc/GUIInfoManager.cpp +++ b/xbmc/GUIInfoManager.cpp @@ -182,6 +182,7 @@ const infomap player_labels[] = {{ "hasmedia", PLAYER_HAS_MEDIA }, { "showtime", PLAYER_SHOWTIME }, { "showcodec", PLAYER_SHOWCODEC }, { "showinfo", PLAYER_SHOWINFO }, + { "title", PLAYER_TITLE }, { "muted", PLAYER_MUTED }, { "hasduration", PLAYER_HASDURATION }, { "passthrough", PLAYER_PASSTHROUGH }, @@ -1377,6 +1378,14 @@ CStdString CGUIInfoManager::GetLabel(int info, int contextWindow, CStdString *fa strLabel = URIUtils::GetParentPath(strLabel); } break; + case PLAYER_TITLE: + { + if (g_application.IsPlayingVideo()) + strLabel = GetLabel(VIDEOPLAYER_TITLE); + else + strLabel = GetLabel(MUSICPLAYER_TITLE); + } + break; case MUSICPLAYER_TITLE: case MUSICPLAYER_ALBUM: case MUSICPLAYER_ARTIST: diff --git a/xbmc/GUIInfoManager.h b/xbmc/GUIInfoManager.h index 63f906095c..f551029595 100644 --- a/xbmc/GUIInfoManager.h +++ b/xbmc/GUIInfoManager.h @@ -107,6 +107,7 @@ namespace INFO #define PLAYER_CAN_PAUSE 50 #define PLAYER_CAN_SEEK 51 #define PLAYER_START_TIME 52 +#define PLAYER_TITLE 53 #define WEATHER_CONDITIONS 100 #define WEATHER_TEMPERATURE 101 -- cgit v1.2.3