| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 void cancel(); | 49 void cancel(); |
| 50 double currentTime() const; | 50 double currentTime() const; |
| 51 void setCurrentTime(double); | 51 void setCurrentTime(double); |
| 52 bool paused() const { return !isNull(m_pauseStartTime); } | 52 bool paused() const { return !isNull(m_pauseStartTime); } |
| 53 void setPaused(bool); | 53 void setPaused(bool); |
| 54 double playbackRate() const { return m_playbackRate; } | 54 double playbackRate() const { return m_playbackRate; } |
| 55 void setPlaybackRate(double); | 55 void setPlaybackRate(double); |
| 56 double startTime() const { return m_startTime; } | 56 double startTime() const { return m_startTime; } |
| 57 double timeDrift() const; | 57 double timeDrift() const; |
| 58 DocumentTimeline* timeline() { return m_timeline; } | 58 DocumentTimeline* timeline() { return m_timeline; } |
| 59 TimedItem* source() { return m_content.get(); } |
| 59 | 60 |
| 60 private: | 61 private: |
| 61 Player(DocumentTimeline*, TimedItem*); | 62 Player(DocumentTimeline*, TimedItem*); |
| 62 static double effectiveTime(double time) { return isNull(time) ? 0 : time; } | 63 static double effectiveTime(double time) { return isNull(time) ? 0 : time; } |
| 63 inline double pausedTimeDrift() const; | 64 inline double pausedTimeDrift() const; |
| 64 inline double currentTimeBeforeDrift() const; | 65 inline double currentTimeBeforeDrift() const; |
| 65 | 66 |
| 66 double m_pauseStartTime; | 67 double m_pauseStartTime; |
| 67 double m_playbackRate; | 68 double m_playbackRate; |
| 68 double m_timeDrift; | 69 double m_timeDrift; |
| 69 const double m_startTime; | 70 const double m_startTime; |
| 70 | 71 |
| 71 RefPtr<TimedItem> m_content; | 72 RefPtr<TimedItem> m_content; |
| 72 DocumentTimeline* const m_timeline; | 73 DocumentTimeline* const m_timeline; |
| 73 }; | 74 }; |
| 74 | 75 |
| 75 } // namespace | 76 } // namespace |
| 76 | 77 |
| 77 #endif | 78 #endif |
| OLD | NEW |