00001 #ifndef _FREE_SPACE_H_
00002 #define _FREE_SPACE_H_
00003
00004 #include <stdint.h>
00005
00006 #include <QStringList>
00007 #include <QDateTime>
00008 #include <QMutex>
00009 #include <QHash>
00010 #include <QMap>
00011
00012 #include "mythcorecontext.h"
00013 #include "metadatacommon.h"
00014 #include "mthread.h"
00015
00016 class PreviewGenerator;
00017 class PBHEventHandler;
00018 class ProgramInfo;
00019 class QStringList;
00020 class QObject;
00021 class QTimer;
00022
00023 typedef enum CheckAvailabilityType {
00024 kCheckForCache,
00025 kCheckForMenuAction,
00026 kCheckForPlayAction,
00027 kCheckForPlaylistAction,
00028 } CheckAvailabilityType;
00029
00030 class PlaybackBoxHelper : public MThread
00031 {
00032 friend class PBHEventHandler;
00033
00034 public:
00035 PlaybackBoxHelper(QObject *listener);
00036 ~PlaybackBoxHelper(void);
00037
00038 void ForceFreeSpaceUpdate(void);
00039 void StopRecording(const ProgramInfo&);
00040 void DeleteRecording(
00041 uint chanid, const QDateTime &recstartts,
00042 bool forceDelete, bool forgetHistory);
00043 void DeleteRecordings(const QStringList&);
00044 void UndeleteRecording(uint chanid, const QDateTime &recstartts);
00045 void CheckAvailability(const ProgramInfo&,
00046 CheckAvailabilityType cat = kCheckForCache);
00047 QString GetPreviewImage(const ProgramInfo&, bool check_availibility = true);
00048
00049 QString LocateArtwork(const QString &inetref, uint season,
00050 VideoArtworkType type, const ProgramInfo *pginfo,
00051 const QString &groupname = NULL);
00052
00053 uint64_t GetFreeSpaceTotalMB(void) const;
00054 uint64_t GetFreeSpaceUsedMB(void) const;
00055
00056 private:
00057 void UpdateFreeSpace(void);
00058
00059 private:
00060 QObject *m_listener;
00061 PBHEventHandler *m_eventHandler;
00062 mutable QMutex m_lock;
00063
00064
00065 uint64_t m_freeSpaceTotalMB;
00066 uint64_t m_freeSpaceUsedMB;
00067
00068
00069 QHash<QString, QString> m_artworkFilenameCache;
00070 };
00071
00072 #endif // _FREE_SPACE_H_