[videodb] remove unused seasons table from episode_view
[xbmc.git] / xbmc / cores / VideoPlayer / DVDClock.h
blob3c3f67371e11d2e2c51460b7b4eb3ab8ad84385b
1 /*
2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #pragma once
11 #include "threads/CriticalSection.h"
13 #include <memory>
14 #include <stdint.h>
16 class CVideoReferenceClock;
18 class CDVDClock
20 public:
22 CDVDClock();
23 ~CDVDClock();
25 double GetClock(bool interpolated = true);
26 double GetClock(double& absolute, bool interpolated = true);
28 double ErrorAdjust(double error, const char* log);
29 void Discontinuity(double clock, double absolute);
30 void Discontinuity(double clock = 0LL)
32 Discontinuity(clock, GetAbsoluteClock());
35 void Reset() { m_bReset = true; }
36 void SetSpeed(int iSpeed);
37 void SetSpeedAdjust(double adjust);
38 double GetSpeedAdjust();
40 double GetClockSpeed(); /**< get the current speed of the clock relative normal system time */
42 /* tells clock at what framerate video is, to *
43 * allow it to adjust speed for a better match */
44 int UpdateFramerate(double fps, double* interval = NULL);
46 void SetMaxSpeedAdjust(double speed);
48 double GetAbsoluteClock(bool interpolated = true);
49 double GetFrequency() { return (double)m_systemFrequency ; }
51 bool GetClockInfo(int& MissedVblanks, double& ClockSpeed, double& RefreshRate) const;
52 void SetVsyncAdjust(double adjustment);
53 double GetVsyncAdjust();
55 void Pause(bool pause);
56 void Advance(double time);
58 protected:
59 double SystemToAbsolute(int64_t system);
60 int64_t AbsoluteToSystem(double absolute);
61 double SystemToPlaying(int64_t system);
63 CCriticalSection m_critSection;
64 int64_t m_systemUsed;
65 int64_t m_startClock;
66 int64_t m_pauseClock;
67 double m_iDisc;
68 bool m_bReset;
69 bool m_paused;
70 int m_speedAfterPause;
71 std::unique_ptr<CVideoReferenceClock> m_videoRefClock;
73 int64_t m_systemFrequency;
74 int64_t m_systemOffset;
75 CCriticalSection m_systemsection;
77 int64_t m_systemAdjust;
78 int64_t m_lastSystemTime;
79 double m_speedAdjust;
80 double m_vSyncAdjust;
81 double m_frameTime;
83 double m_maxspeedadjust;
84 CCriticalSection m_speedsection;