MythTV  master
playbackboxhelper.h
Go to the documentation of this file.
1 #ifndef PLAYBACKBOXHELPER_H
2 #define PLAYBACKBOXHELPER_H
3 
4 #include <cstdint>
5 
6 #include <QStringList>
7 #include <QDateTime>
8 #include <QMutex>
9 
10 #include "mythcorecontext.h"
11 #include "metadatacommon.h"
12 #include "mthread.h"
13 #include "mythtypes.h"
14 
15 class PreviewGenerator;
16 class PBHEventHandler;
17 class ProgramInfo;
18 class QStringList;
19 class QObject;
20 class QTimer;
21 
27 };
28 
29 class PlaybackBoxHelper : public MThread
30 {
31  friend class PBHEventHandler;
32 
33  public:
34  explicit PlaybackBoxHelper(QObject *listener);
35  ~PlaybackBoxHelper(void) override;
36 
37  void ForceFreeSpaceUpdate(void);
38  void StopRecording(const ProgramInfo &pginfo);
39  void DeleteRecording( uint recordingID, bool forceDelete,
40  bool forgetHistory);
41  void DeleteRecordings(const QStringList &list);
42  void UndeleteRecording(uint recordingID);
43  void CheckAvailability(const ProgramInfo &pginfo,
45  QString GetPreviewImage(const ProgramInfo &pginfo, bool check_availability = true);
46 
47  QString LocateArtwork(const QString &inetref, uint season,
48  VideoArtworkType type, const ProgramInfo *pginfo,
49  const QString &groupname = nullptr);
50 
51  uint64_t GetFreeSpaceTotalMB(void) const;
52  uint64_t GetFreeSpaceUsedMB(void) const;
53 
54  private:
55  void UpdateFreeSpace(void);
56 
57  private:
58  QObject *m_listener {nullptr};
60  mutable QMutex m_lock;
61 
62  // Free disk space tracking
63  uint64_t m_freeSpaceTotalMB {0LL};
64  uint64_t m_freeSpaceUsedMB {0LL};
65 
66  // Artwork Variables //////////////////////////////////////////////////////
68 };
69 
70 #endif // PLAYBACKBOXHELPER_H
PlaybackBoxHelper::DeleteRecording
void DeleteRecording(uint recordingID, bool forceDelete, bool forgetHistory)
Definition: playbackboxhelper.cpp:363
PlaybackBoxHelper::m_freeSpaceUsedMB
uint64_t m_freeSpaceUsedMB
Definition: playbackboxhelper.h:64
VideoArtworkType
VideoArtworkType
Definition: metadataimagehelper.h:10
kCheckForCache
@ kCheckForCache
Definition: playbackboxhelper.h:23
PlaybackBoxHelper::m_eventHandler
PBHEventHandler * m_eventHandler
Definition: playbackboxhelper.h:59
PlaybackBoxHelper::GetFreeSpaceTotalMB
uint64_t GetFreeSpaceTotalMB(void) const
Definition: playbackboxhelper.cpp:404
kCheckForPlaylistAction
@ kCheckForPlaylistAction
Definition: playbackboxhelper.h:26
hardwareprofile.devicelist.cat
def cat(file_name)
Definition: devicelist.py:95
PreviewGenerator
This class creates a preview image of a recording.
Definition: previewgenerator.h:27
PlaybackBoxHelper
Definition: playbackboxhelper.h:30
CheckAvailabilityType
CheckAvailabilityType
Definition: playbackboxhelper.h:22
PlaybackBoxHelper::m_freeSpaceTotalMB
uint64_t m_freeSpaceTotalMB
Definition: playbackboxhelper.h:63
PlaybackBoxHelper::UndeleteRecording
void UndeleteRecording(uint recordingID)
Definition: playbackboxhelper.cpp:379
InfoMap
QHash< QString, QString > InfoMap
Definition: mythtypes.h:15
PlaybackBoxHelper::GetPreviewImage
QString GetPreviewImage(const ProgramInfo &pginfo, bool check_availability=true)
Definition: playbackboxhelper.cpp:466
PlaybackBoxHelper::m_lock
QMutex m_lock
Definition: playbackboxhelper.h:60
PlaybackBoxHelper::DeleteRecordings
void DeleteRecordings(const QStringList &list)
Definition: playbackboxhelper.cpp:373
kCheckForPlayAction
@ kCheckForPlayAction
Definition: playbackboxhelper.h:25
mythtypes.h
uint
unsigned int uint
Definition: compat.h:140
PlaybackBoxHelper::PlaybackBoxHelper
PlaybackBoxHelper(QObject *listener)
Definition: playbackboxhelper.cpp:329
PlaybackBoxHelper::~PlaybackBoxHelper
~PlaybackBoxHelper(void) override
Definition: playbackboxhelper.cpp:339
PlaybackBoxHelper::m_artworkCache
InfoMap m_artworkCache
Definition: playbackboxhelper.h:67
ProgramInfo
Holds information on recordings and videos.
Definition: programinfo.h:68
mythcorecontext.h
PBHEventHandler
Definition: playbackboxhelper.cpp:31
MThread
This is a wrapper around QThread that does several additional things.
Definition: mthread.h:49
mthread.h
PlaybackBoxHelper::UpdateFreeSpace
void UpdateFreeSpace(void)
Definition: playbackboxhelper.cpp:387
kCheckForMenuAction
@ kCheckForMenuAction
Definition: playbackboxhelper.h:24
PlaybackBoxHelper::StopRecording
void StopRecording(const ProgramInfo &pginfo)
Definition: playbackboxhelper.cpp:355
PlaybackBoxHelper::LocateArtwork
QString LocateArtwork(const QString &inetref, uint season, VideoArtworkType type, const ProgramInfo *pginfo, const QString &groupname=nullptr)
Definition: playbackboxhelper.cpp:438
PlaybackBoxHelper::GetFreeSpaceUsedMB
uint64_t GetFreeSpaceUsedMB(void) const
Definition: playbackboxhelper.cpp:410
PlaybackBoxHelper::m_listener
QObject * m_listener
Definition: playbackboxhelper.h:58
metadatacommon.h
PlaybackBoxHelper::CheckAvailability
void CheckAvailability(const ProgramInfo &pginfo, CheckAvailabilityType cat=kCheckForCache)
Definition: playbackboxhelper.cpp:416
PlaybackBoxHelper::ForceFreeSpaceUpdate
void ForceFreeSpaceUpdate(void)
Definition: playbackboxhelper.cpp:349