Permalink
Browse files

Allow localized date from exif data to be obtained by skin

This changeset add the ability for a skin to request a localized
date (no time) for the currently active slideshow picture. This
will be used to show the date a picture was taken based on the exif
data embedded by most digital cameras into .jpg files.
  • Loading branch information...
1 parent e48a897 commit d9ce56ebd1927da5d7bc441078164175b38d1afe Ross Stutterheim committed with spiff May 28, 2012
Showing with 60 additions and 51 deletions.
  1. +1 −0 xbmc/GUIInfoManager.cpp
  2. +51 −50 xbmc/GUIInfoManager.h
  3. +6 −1 xbmc/pictures/PictureInfoTag.cpp
  4. +2 −0 xbmc/pictures/PictureInfoTag.h
View
@@ -532,6 +532,7 @@ const infomap slideshow[] = {{ "ispaused", SLIDESHOW_ISPAUSED },
{ "israndom", SLIDESHOW_ISRANDOM }};
const int picture_slide_map[] = {/* LISTITEM_PICTURE_RESOLUTION => */ SLIDE_RESOLUTION,
+ /* LISTITEM_PICTURE_DATE => */ SLIDE_EXIF_DATE,
/* LISTITEM_PICTURE_DATETIME => */ SLIDE_EXIF_DATE_TIME,
/* LISTITEM_PICTURE_COMMENT => */ SLIDE_COMMENT,
/* LISTITEM_PICTURE_CAPTION => */ SLIDE_IPTC_CAPTION,
View
@@ -461,57 +461,58 @@ namespace INFO
// the ordering of LISTITEM_PICTURE_* is important as they're mapped to SLIDE_* items in GUIInfoManager.cpp
#define LISTITEM_PICTURE_START (LISTITEM_START + 30)
#define LISTITEM_PICTURE_RESOLUTION (LISTITEM_PICTURE_START) // => SLIDE_RESOLUTION
-#define LISTITEM_PICTURE_DATETIME (LISTITEM_START + 31) // => SLIDE_EXIF_DATE_TIME
-#define LISTITEM_PICTURE_COMMENT (LISTITEM_START + 32) // => SLIDE_COMMENT
-#define LISTITEM_PICTURE_CAPTION (LISTITEM_START + 33) // => SLIDE_IPTC_CAPTION
-#define LISTITEM_PICTURE_DESC (LISTITEM_START + 34) // => SLIDE_EXIF_DESCRIPTION
-#define LISTITEM_PICTURE_KEYWORDS (LISTITEM_START + 35) // => SLIDE_IPTC_KEYWORDS
-#define LISTITEM_PICTURE_CAM_MAKE (LISTITEM_START + 36) // => SLIDE_EXIF_CAMERA_MAKE
-#define LISTITEM_PICTURE_CAM_MODEL (LISTITEM_START + 37) // => SLIDE_EXIF_CAMERA_MODEL
-#define LISTITEM_PICTURE_APERTURE (LISTITEM_START + 38) // => SLIDE_EXIF_APERTURE
-#define LISTITEM_PICTURE_FOCAL_LEN (LISTITEM_START + 39) // => SLIDE_EXIF_FOCAL_LENGTH
-#define LISTITEM_PICTURE_FOCUS_DIST (LISTITEM_START + 40) // => SLIDE_EXIF_FOCUS_DIST
-#define LISTITEM_PICTURE_EXP_MODE (LISTITEM_START + 41) // => SLIDE_EXIF_EXPOSURE_MODE
-#define LISTITEM_PICTURE_EXP_TIME (LISTITEM_START + 42) // => SLIDE_EXIF_EXPOSURE_TIME
-#define LISTITEM_PICTURE_ISO (LISTITEM_START + 43) // => SLIDE_EXIF_ISO_EQUIV
-#define LISTITEM_PICTURE_GPS_LAT (LISTITEM_START + 44) // => SLIDE_EXIF_GPS_LATITUDE
-#define LISTITEM_PICTURE_GPS_LON (LISTITEM_START + 45) // => SLIDE_EXIF_GPS_LONGITUDE
-#define LISTITEM_PICTURE_GPS_ALT (LISTITEM_START + 46) // => SLIDE_EXIF_GPS_ALTITUDE
+#define LISTITEM_PICTURE_DATE (LISTITEM_START + 31) // => SLIDE_EXIF_DATE
+#define LISTITEM_PICTURE_DATETIME (LISTITEM_START + 32) // => SLIDE_EXIF_DATE_TIME
+#define LISTITEM_PICTURE_COMMENT (LISTITEM_START + 33) // => SLIDE_COMMENT
+#define LISTITEM_PICTURE_CAPTION (LISTITEM_START + 34) // => SLIDE_IPTC_CAPTION
+#define LISTITEM_PICTURE_DESC (LISTITEM_START + 35) // => SLIDE_EXIF_DESCRIPTION
+#define LISTITEM_PICTURE_KEYWORDS (LISTITEM_START + 36) // => SLIDE_IPTC_KEYWORDS
+#define LISTITEM_PICTURE_CAM_MAKE (LISTITEM_START + 37) // => SLIDE_EXIF_CAMERA_MAKE
+#define LISTITEM_PICTURE_CAM_MODEL (LISTITEM_START + 38) // => SLIDE_EXIF_CAMERA_MODEL
+#define LISTITEM_PICTURE_APERTURE (LISTITEM_START + 39) // => SLIDE_EXIF_APERTURE
+#define LISTITEM_PICTURE_FOCAL_LEN (LISTITEM_START + 40) // => SLIDE_EXIF_FOCAL_LENGTH
+#define LISTITEM_PICTURE_FOCUS_DIST (LISTITEM_START + 41) // => SLIDE_EXIF_FOCUS_DIST
+#define LISTITEM_PICTURE_EXP_MODE (LISTITEM_START + 42) // => SLIDE_EXIF_EXPOSURE_MODE
+#define LISTITEM_PICTURE_EXP_TIME (LISTITEM_START + 43) // => SLIDE_EXIF_EXPOSURE_TIME
+#define LISTITEM_PICTURE_ISO (LISTITEM_START + 44) // => SLIDE_EXIF_ISO_EQUIV
+#define LISTITEM_PICTURE_GPS_LAT (LISTITEM_START + 45) // => SLIDE_EXIF_GPS_LATITUDE
+#define LISTITEM_PICTURE_GPS_LON (LISTITEM_START + 46) // => SLIDE_EXIF_GPS_LONGITUDE
+#define LISTITEM_PICTURE_GPS_ALT (LISTITEM_START + 47) // => SLIDE_EXIF_GPS_ALTITUDE
#define LISTITEM_PICTURE_END (LISTITEM_PICTURE_GPS_ALT)
-#define LISTITEM_STUDIO (LISTITEM_START + 47)
-#define LISTITEM_MPAA (LISTITEM_START + 48)
-#define LISTITEM_CAST (LISTITEM_START + 49)
-#define LISTITEM_CAST_AND_ROLE (LISTITEM_START + 50)
-#define LISTITEM_WRITER (LISTITEM_START + 51)
-#define LISTITEM_TAGLINE (LISTITEM_START + 52)
-#define LISTITEM_TOP250 (LISTITEM_START + 53)
-#define LISTITEM_RATING_AND_VOTES (LISTITEM_START + 54)
-#define LISTITEM_TRAILER (LISTITEM_START + 55)
-#define LISTITEM_STAR_RATING (LISTITEM_START + 56)
-#define LISTITEM_FILENAME_AND_PATH (LISTITEM_START + 57)
-#define LISTITEM_SORT_LETTER (LISTITEM_START + 58)
-#define LISTITEM_ALBUM_ARTIST (LISTITEM_START + 59)
-#define LISTITEM_FOLDERNAME (LISTITEM_START + 60)
-#define LISTITEM_VIDEO_CODEC (LISTITEM_START + 61)
-#define LISTITEM_VIDEO_RESOLUTION (LISTITEM_START + 62)
-#define LISTITEM_VIDEO_ASPECT (LISTITEM_START + 63)
-#define LISTITEM_AUDIO_CODEC (LISTITEM_START + 64)
-#define LISTITEM_AUDIO_CHANNELS (LISTITEM_START + 65)
-#define LISTITEM_AUDIO_LANGUAGE (LISTITEM_START + 66)
-#define LISTITEM_SUBTITLE_LANGUAGE (LISTITEM_START + 67)
-#define LISTITEM_IS_FOLDER (LISTITEM_START + 68)
-#define LISTITEM_ORIGINALTITLE (LISTITEM_START + 69)
-#define LISTITEM_COUNTRY (LISTITEM_START + 70)
-#define LISTITEM_PLAYCOUNT (LISTITEM_START + 71)
-#define LISTITEM_LASTPLAYED (LISTITEM_START + 72)
-#define LISTITEM_FOLDERPATH (LISTITEM_START + 73)
-#define LISTITEM_DISC_NUMBER (LISTITEM_START + 74)
-#define LISTITEM_FILE_EXTENSION (LISTITEM_START + 75)
-#define LISTITEM_IS_RESUMABLE (LISTITEM_START + 76)
-#define LISTITEM_PERCENT_PLAYED (LISTITEM_START + 77)
-#define LISTITEM_DATE_ADDED (LISTITEM_START + 78)
-#define LISTITEM_DBTYPE (LISTITEM_START + 79)
-#define LISTITEM_DBID (LISTITEM_START + 80)
+#define LISTITEM_STUDIO (LISTITEM_START + 48)
+#define LISTITEM_MPAA (LISTITEM_START + 49)
+#define LISTITEM_CAST (LISTITEM_START + 50)
+#define LISTITEM_CAST_AND_ROLE (LISTITEM_START + 51)
+#define LISTITEM_WRITER (LISTITEM_START + 52)
+#define LISTITEM_TAGLINE (LISTITEM_START + 53)
+#define LISTITEM_TOP250 (LISTITEM_START + 54)
+#define LISTITEM_RATING_AND_VOTES (LISTITEM_START + 55)
+#define LISTITEM_TRAILER (LISTITEM_START + 56)
+#define LISTITEM_STAR_RATING (LISTITEM_START + 57)
+#define LISTITEM_FILENAME_AND_PATH (LISTITEM_START + 58)
+#define LISTITEM_SORT_LETTER (LISTITEM_START + 59)
+#define LISTITEM_ALBUM_ARTIST (LISTITEM_START + 60)
+#define LISTITEM_FOLDERNAME (LISTITEM_START + 61)
+#define LISTITEM_VIDEO_CODEC (LISTITEM_START + 62)
+#define LISTITEM_VIDEO_RESOLUTION (LISTITEM_START + 63)
+#define LISTITEM_VIDEO_ASPECT (LISTITEM_START + 64)
+#define LISTITEM_AUDIO_CODEC (LISTITEM_START + 65)
+#define LISTITEM_AUDIO_CHANNELS (LISTITEM_START + 66)
+#define LISTITEM_AUDIO_LANGUAGE (LISTITEM_START + 67)
+#define LISTITEM_SUBTITLE_LANGUAGE (LISTITEM_START + 68)
+#define LISTITEM_IS_FOLDER (LISTITEM_START + 69)
+#define LISTITEM_ORIGINALTITLE (LISTITEM_START + 70)
+#define LISTITEM_COUNTRY (LISTITEM_START + 71)
+#define LISTITEM_PLAYCOUNT (LISTITEM_START + 72)
+#define LISTITEM_LASTPLAYED (LISTITEM_START + 73)
+#define LISTITEM_FOLDERPATH (LISTITEM_START + 74)
+#define LISTITEM_DISC_NUMBER (LISTITEM_START + 75)
+#define LISTITEM_FILE_EXTENSION (LISTITEM_START + 76)
+#define LISTITEM_IS_RESUMABLE (LISTITEM_START + 77)
+#define LISTITEM_PERCENT_PLAYED (LISTITEM_START + 78)
+#define LISTITEM_DATE_ADDED (LISTITEM_START + 79)
+#define LISTITEM_DBTYPE (LISTITEM_START + 80)
+#define LISTITEM_DBID (LISTITEM_START + 81)
#define LISTITEM_PROPERTY_START (LISTITEM_START + 200)
#define LISTITEM_PROPERTY_END (LISTITEM_PROPERTY_START + 1000)
@@ -306,6 +306,7 @@ const CStdString CPictureInfoTag::GetInfo(int info) const
value = m_exifInfo.Comments;
break;
case SLIDE_EXIF_DATE_TIME:
+ case SLIDE_EXIF_DATE:
if (m_exifInfo.DateTime && strlen(m_exifInfo.DateTime) >= 19 && m_exifInfo.DateTime[0] != ' ')
{
CStdString dateTime = m_exifInfo.DateTime;
@@ -316,7 +317,10 @@ const CStdString CPictureInfoTag::GetInfo(int info) const
int min = atoi(dateTime.Mid(14,2).c_str());
int sec = atoi(dateTime.Mid(17,2).c_str());
CDateTime date(year, month, day, hour, min, sec);
- value = date.GetAsLocalizedDateTime();
+ if(SLIDE_EXIF_DATE_TIME == info)
+ value = date.GetAsLocalizedDateTime();
+ else
+ value = date.GetAsLocalizedDate();
}
break;
case SLIDE_EXIF_DESCRIPTION:
@@ -512,6 +516,7 @@ int CPictureInfoTag::TranslateString(const CStdString &info)
else if (info.Equals("colour")) return SLIDE_COLOUR;
else if (info.Equals("process")) return SLIDE_PROCESS;
else if (info.Equals("exiftime")) return SLIDE_EXIF_DATE_TIME;
+ else if (info.Equals("exifdate")) return SLIDE_EXIF_DATE;
else if (info.Equals("exifdescription")) return SLIDE_EXIF_DESCRIPTION;
else if (info.Equals("cameramake")) return SLIDE_EXIF_CAMERA_MAKE;
else if (info.Equals("cameramodel")) return SLIDE_EXIF_CAMERA_MODEL;
@@ -35,6 +35,8 @@
#define SLIDE_COLOUR 907
#define SLIDE_PROCESS 908
+#define SLIDE_EXIF_DATE 919 /* Implementation only to just get
+ localized date */
#define SLIDE_EXIF_DATE_TIME 920
#define SLIDE_EXIF_DESCRIPTION 921
#define SLIDE_EXIF_CAMERA_MAKE 922

3 comments on commit d9ce56e

Member
pieh commented on d9ce56e Aug 5, 2012

this adds 2nd row for exif date in picture info dialog (one without heading is SLIDE_EXIF_DATE added in this commit): https://dl.dropbox.com/u/28792047/xbmc/screenshot002.png

I think we shouldn't show 2x same info. Here's proposed "fix": http://pastebin.com/4pEFbS2n

Member
Member
pieh replied Aug 6, 2012

committed 1b51796

Please sign in to comment.