diff options
author | Martin Prochnow <nordlicht@martins-kabuff.de> | 2007-10-08 20:36:03 +0200 |
---|---|---|
committer | Andreas Mair <andreas@vdr-developer.org> | 2007-10-08 20:36:03 +0200 |
commit | 57e0533f20b14e208e41e56f80fd15b3d18f90f1 (patch) | |
tree | 2e75d86377b4fbc29c9fd76fabd2a5e291a9f204 /tools.h | |
parent | 8adfaaf81b104b8e981026da593e40f9d780c251 (diff) | |
download | vdr-plugin-extrecmenu-57e0533f20b14e208e41e56f80fd15b3d18f90f1.tar.gz vdr-plugin-extrecmenu-57e0533f20b14e208e41e56f80fd15b3d18f90f1.tar.bz2 |
Version 1.0v1.0
- it is now possible to cancel a moving-between-filesystems-process
- applied changes for MainMenuHooksPatch
- added MainMenuHooksPatch to contrib/-dir; removed old one, which is now obsolete
- free disk space is shown for the filesystem of the current directory (can be switched of in plugin's setup menu)
- added support for hidding PIN-protected recordings in co-work with PIN-Plugin
- added queue for moving recordings between filesystems
- added cutter queue
- added #ifdef's to switch of font patching for vdr >= 1.5.3
- added setup option to switch of font patching
Diffstat (limited to 'tools.h')
-rw-r--r-- | tools.h | 95 |
1 files changed, 76 insertions, 19 deletions
@@ -5,8 +5,8 @@ class SortListItem:public cListObject private: std::string path; public: - SortListItem(const char *Path){path=Path;}; - const char *Path(){return path.c_str();} + SortListItem(std::string Path){path=Path;}; + std::string Path(){return path;} }; class SortList:public cList<SortListItem> @@ -14,25 +14,10 @@ class SortList:public cList<SortListItem> public: void ReadConfigFile(); void WriteConfigFile(); - bool Find(char *Path); + bool Find(std::string Path); }; -class MoveBetweenFileSystems:public cThread -{ - private: - std::string oldname; - std::string newname; - cRecording *recording; - bool Move(std::string From,std::string To,cRecording *Recording); - protected: - virtual void Action(); - public: - MoveBetweenFileSystems(); - bool Start(std::string OldName,std::string NewName,cRecording *Recording); - bool IsMoving(std::string Path); -}; - -extern MoveBetweenFileSystems MoveThread; +extern SortList *mySortList; bool MoveRename(const char *OldName,const char *NewName,cRecording *Recording,bool Move); @@ -55,3 +40,75 @@ class myRecList:public cList<myRecListItem> public: void Sort(bool SortByName); }; + +// --- MoveListItem ----------------------------------------------------------- +class MoveListItem:public cListObject +{ + private: + bool moveinprogress; + bool movecanceled; + std::string from; + std::string to; + public: + MoveListItem(std::string From,std::string To){from=From;to=To;moveinprogress=false;movecanceled=false;} + std::string From(){return from;} + std::string To(){return to;} + void SetMoveInProgress(){moveinprogress=true;} + bool GetMoveInProgress(){return moveinprogress;} + void SetMoveCanceled(){movecanceled=true;} + bool GetMoveCanceled(){return movecanceled;} +}; + +// --- MoveList --------------------------------------------------------------- +class MoveList:public cList<MoveListItem> +{ +}; + +// --- CutterListItem --------------------------------------------------------- +class CutterListItem:public cListObject +{ + private: + bool cutinprogress; + std::string filename; + std::string newfilename; + public: + CutterListItem(std::string FileName){filename=FileName;cutinprogress=false;}; + void SetNewFileName(std::string NewFileName){newfilename=NewFileName;} + std::string FileName(){return filename;} + std::string NewFileName(){return newfilename;} + void SetCutInProgress(){cutinprogress=true;} + bool GetCutInProgress(){return cutinprogress;} +}; + +// --- CutterList ------------------------------------------------------------- +class CutterList:public cList<CutterListItem> +{ +}; + +// --- WorkerThread ----------------------------------------------------------- +class WorkerThread:public cThread +{ + private: + bool cancelmove,cancelcut; + MoveList *MoveBetweenFileSystemsList; + CutterList *CutterQueue; + void Cut(std::string From,std::string To); + bool Move(std::string From,std::string To); + protected: + virtual void Action(); + public: + WorkerThread(); + ~WorkerThread(); + const char *Working(); + bool IsCutting(std::string Path); + bool IsMoving(std::string Path); + void CancelCut(std::string Path); + void CancelMove(std::string Path); + void AddToCutterQueue(std::string Path); + void AddToMoveList(std::string From,std::string To); + bool IsCutterQueueEmpty(){return CutterQueue->First();} + bool IsMoveListEmpty(){return MoveBetweenFileSystemsList->First();} +}; + +extern WorkerThread *MoveCutterThread; + |