-
Notifications
You must be signed in to change notification settings - Fork 341
/
commbreakmap.h
69 lines (54 loc) · 1.97 KB
/
commbreakmap.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef BREAKMAP_H
#define BREAKMAP_H
// MythTV headers
#include "tv.h"
#include "programtypes.h"
#include "playercontext.h"
// Qt headers
#include <QMutex>
#include <QMap>
#include <QCoreApplication>
#include <compat.h>
#include <stdint.h>
class NuppelVideoPlayer;
class CommBreakMap
{
Q_DECLARE_TR_FUNCTIONS(CommBreakMap)
public:
CommBreakMap(void);
bool HasMap(void) const { return hascommbreaktable; }
CommSkipMode GetAutoCommercialSkip(void) const;
void SetAutoCommercialSkip(CommSkipMode autoskip, uint64_t framesPlayed);
int GetSkipCommercials(void) const { return skipcommercials; }
void SkipCommercials(int direction);
void ResetLastSkip(void);
void SetTracker(uint64_t framesPlayed);
void GetMap(frm_dir_map_t &map) const;
void SetMap(const frm_dir_map_t &newMap, uint64_t framesPlayed);
void LoadMap(PlayerContext *player_ctx, uint64_t framesPlayed);
bool IsInCommBreak(uint64_t frameNumber) const;
bool AutoCommercialSkip(uint64_t &jumpToFrame, uint64_t framesPlayed,
double video_frame_rate, uint64_t totalFrames,
QString &comm_msg);
bool DoSkipCommercials(uint64_t &jumpToFrame, uint64_t framesPlayed,
double video_frame_rate, uint64_t totalFrames,
QString &comm_msg);
private:
void MergeShortCommercials(double video_frame_rate);
mutable QMutex commBreakMapLock;
int skipcommercials;
CommSkipMode autocommercialskip;
int commrewindamount;
int commnotifyamount;
int lastCommSkipDirection;
time_t lastCommSkipTime;
uint64_t lastCommSkipStart;
time_t lastSkipTime;
bool hascommbreaktable;
QDateTime lastIgnoredManualSkip;
int maxskip;
int maxShortMerge;
frm_dir_map_t commBreakMap;
frm_dir_map_t::Iterator commBreakIter;
};
#endif // BREAKMAP_H