MythTV  master
playbackboxhelper.h
Go to the documentation of this file.
1 #ifndef PLAYBACKBOXHELPER_H
2 #define PLAYBACKBOXHELPER_H
3 
4 // C++
5 #include <cstdint>
6 
7 // Qt
8 #include <QStringList>
9 #include <QDateTime>
10 #include <QMutex>
11 
12 // MythTV
13 #include "libmythbase/mthread.h"
14 #include "libmythbase/mythtypes.h"
16 
17 class PreviewGenerator;
18 class PBHEventHandler;
19 class ProgramInfo;
20 
21 enum CheckAvailabilityType : std::uint8_t {
26 };
27 
28 class PlaybackBoxHelper : public MThread
29 {
30  friend class PBHEventHandler;
31 
32  public:
33  explicit PlaybackBoxHelper(QObject *listener);
34  ~PlaybackBoxHelper(void) override;
35 
36  void ForceFreeSpaceUpdate(void);
37  void StopRecording(const ProgramInfo &pginfo);
38  void DeleteRecording( uint recordingID, bool forceDelete,
39  bool forgetHistory);
40  void DeleteRecordings(const QStringList &list);
41  void UndeleteRecording(uint recordingID);
42  void CheckAvailability(const ProgramInfo &pginfo,
44  QString GetPreviewImage(const ProgramInfo &pginfo, bool check_availability = true);
45 
46  QString LocateArtwork(const QString &inetref, uint season,
47  VideoArtworkType type, const ProgramInfo *pginfo,
48  const QString &groupname = nullptr);
49 
50  uint64_t GetFreeSpaceTotalMB(void) const;
51  uint64_t GetFreeSpaceUsedMB(void) const;
52 
53  private:
54  void UpdateFreeSpace(void);
55 
56  private:
57  QObject *m_listener {nullptr};
59  mutable QMutex m_lock;
60 
61  // Free disk space tracking
62  uint64_t m_freeSpaceTotalMB {0LL};
63  uint64_t m_freeSpaceUsedMB {0LL};
64 
65  // Artwork Variables //////////////////////////////////////////////////////
67 };
68 
69 #endif // PLAYBACKBOXHELPER_H
PlaybackBoxHelper::DeleteRecording
void DeleteRecording(uint recordingID, bool forceDelete, bool forgetHistory)
Definition: playbackboxhelper.cpp:376
PlaybackBoxHelper::m_freeSpaceUsedMB
uint64_t m_freeSpaceUsedMB
Definition: playbackboxhelper.h:63
kCheckForPlaylistAction
@ kCheckForPlaylistAction
Definition: playbackboxhelper.h:25
PlaybackBoxHelper::m_eventHandler
PBHEventHandler * m_eventHandler
Definition: playbackboxhelper.h:58
PlaybackBoxHelper::GetFreeSpaceTotalMB
uint64_t GetFreeSpaceTotalMB(void) const
Definition: playbackboxhelper.cpp:417
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:28
PlaybackBoxHelper::m_freeSpaceTotalMB
uint64_t m_freeSpaceTotalMB
Definition: playbackboxhelper.h:62
PlaybackBoxHelper::UndeleteRecording
void UndeleteRecording(uint recordingID)
Definition: playbackboxhelper.cpp:392
VideoArtworkType
VideoArtworkType
Definition: metadataimagehelper.h:10
kCheckForPlayAction
@ kCheckForPlayAction
Definition: playbackboxhelper.h:24
kCheckForMenuAction
@ kCheckForMenuAction
Definition: playbackboxhelper.h:23
InfoMap
QHash< QString, QString > InfoMap
Definition: mythtypes.h:15
CheckAvailabilityType
CheckAvailabilityType
Definition: playbackboxhelper.h:21
PlaybackBoxHelper::GetPreviewImage
QString GetPreviewImage(const ProgramInfo &pginfo, bool check_availability=true)
Definition: playbackboxhelper.cpp:479
PlaybackBoxHelper::m_lock
QMutex m_lock
Definition: playbackboxhelper.h:59
PlaybackBoxHelper::DeleteRecordings
void DeleteRecordings(const QStringList &list)
Definition: playbackboxhelper.cpp:386
mythtypes.h
PlaybackBoxHelper::PlaybackBoxHelper
PlaybackBoxHelper(QObject *listener)
Definition: playbackboxhelper.cpp:342
PlaybackBoxHelper::~PlaybackBoxHelper
~PlaybackBoxHelper(void) override
Definition: playbackboxhelper.cpp:352
PlaybackBoxHelper::m_artworkCache
InfoMap m_artworkCache
Definition: playbackboxhelper.h:66
ProgramInfo
Holds information on recordings and videos.
Definition: programinfo.h:67
PBHEventHandler
Definition: playbackboxhelper.cpp:33
MThread
This is a wrapper around QThread that does several additional things.
Definition: mthread.h:48
mthread.h
PlaybackBoxHelper::UpdateFreeSpace
void UpdateFreeSpace(void)
Definition: playbackboxhelper.cpp:400
PlaybackBoxHelper::StopRecording
void StopRecording(const ProgramInfo &pginfo)
Definition: playbackboxhelper.cpp:368
PlaybackBoxHelper::LocateArtwork
QString LocateArtwork(const QString &inetref, uint season, VideoArtworkType type, const ProgramInfo *pginfo, const QString &groupname=nullptr)
Definition: playbackboxhelper.cpp:451
PlaybackBoxHelper::GetFreeSpaceUsedMB
uint64_t GetFreeSpaceUsedMB(void) const
Definition: playbackboxhelper.cpp:423
PlaybackBoxHelper::m_listener
QObject * m_listener
Definition: playbackboxhelper.h:57
metadatacommon.h
PlaybackBoxHelper::CheckAvailability
void CheckAvailability(const ProgramInfo &pginfo, CheckAvailabilityType cat=kCheckForCache)
Definition: playbackboxhelper.cpp:429
PlaybackBoxHelper::ForceFreeSpaceUpdate
void ForceFreeSpaceUpdate(void)
Definition: playbackboxhelper.cpp:362
uint
unsigned int uint
Definition: freesurround.h:24
kCheckForCache
@ kCheckForCache
Definition: playbackboxhelper.h:22