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"
15 #include "libmythbase/mythtypes.h"
17 
18 class PreviewGenerator;
19 class PBHEventHandler;
20 class ProgramInfo;
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:375
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:416
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:29
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:391
InfoMap
QHash< QString, QString > InfoMap
Definition: mythtypes.h:15
PlaybackBoxHelper::GetPreviewImage
QString GetPreviewImage(const ProgramInfo &pginfo, bool check_availability=true)
Definition: playbackboxhelper.cpp:478
PlaybackBoxHelper::m_lock
QMutex m_lock
Definition: playbackboxhelper.h:60
PlaybackBoxHelper::DeleteRecordings
void DeleteRecordings(const QStringList &list)
Definition: playbackboxhelper.cpp:385
kCheckForPlayAction
@ kCheckForPlayAction
Definition: playbackboxhelper.h:25
mythtypes.h
uint
unsigned int uint
Definition: compat.h:81
PlaybackBoxHelper::PlaybackBoxHelper
PlaybackBoxHelper(QObject *listener)
Definition: playbackboxhelper.cpp:341
PlaybackBoxHelper::~PlaybackBoxHelper
~PlaybackBoxHelper(void) override
Definition: playbackboxhelper.cpp:351
PlaybackBoxHelper::m_artworkCache
InfoMap m_artworkCache
Definition: playbackboxhelper.h:67
ProgramInfo
Holds information on recordings and videos.
Definition: programinfo.h:67
mythcorecontext.h
PBHEventHandler
Definition: playbackboxhelper.cpp:34
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:399
kCheckForMenuAction
@ kCheckForMenuAction
Definition: playbackboxhelper.h:24
PlaybackBoxHelper::StopRecording
void StopRecording(const ProgramInfo &pginfo)
Definition: playbackboxhelper.cpp:367
PlaybackBoxHelper::LocateArtwork
QString LocateArtwork(const QString &inetref, uint season, VideoArtworkType type, const ProgramInfo *pginfo, const QString &groupname=nullptr)
Definition: playbackboxhelper.cpp:450
PlaybackBoxHelper::GetFreeSpaceUsedMB
uint64_t GetFreeSpaceUsedMB(void) const
Definition: playbackboxhelper.cpp:422
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:428
PlaybackBoxHelper::ForceFreeSpaceUpdate
void ForceFreeSpaceUpdate(void)
Definition: playbackboxhelper.cpp:361