Permalink
Browse files

[bookmarks] adds IsSet() and IsPartWay() to CBookmark

  • Loading branch information...
1 parent ba01989 commit 6ba6095020b910b901aaa07a8a700c7b38a1ddd1 Jonathan Marshall committed Jul 8, 2012
Showing with 20 additions and 0 deletions.
  1. +9 −0 xbmc/video/Bookmark.cpp
  2. +11 −0 xbmc/video/Bookmark.h
View
@@ -36,3 +36,12 @@ void CBookmark::Reset()
type = STANDARD;
}
+bool CBookmark::IsSet() const
+{
+ return totalTimeInSeconds > 0.0f;
+}
+
+bool CBookmark::IsPartWay() const
+{
+ return totalTimeInSeconds > 0.0f && timeInSeconds > 0.0f;
+}
View
@@ -29,6 +29,17 @@ class CBookmark
public:
CBookmark();
void Reset();
+
+ /*! \brief returns true if this bookmark has been set.
+ \return true if totalTimeInSeconds is positive.
+ */
+ bool IsSet() const;
+
+ /*! \brief returns true if this bookmark is part way through the video file
+ \return true if both totalTimeInSeconds and timeInSeconds are positive.
+ */
+ bool IsPartWay() const;
+
double timeInSeconds;
double totalTimeInSeconds;
long partNumber;

0 comments on commit 6ba6095

Please sign in to comment.