diff options
author | Dieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de> | 2007-01-05 22:26:58 +0000 |
---|---|---|
committer | Dieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de> | 2007-01-05 22:26:58 +0000 |
commit | 2f4711bc0484ceba4db8472408f71c0b3d32bab3 (patch) | |
tree | 66fc0fb00755984e4faaaa202997103a8d35815f /recordings.h | |
parent | 1101d20f95fc86e0e1e20e69467cb152632b4fc4 (diff) | |
download | vdr-plugin-live-2f4711bc0484ceba4db8472408f71c0b3d32bab3.tar.gz vdr-plugin-live-2f4711bc0484ceba4db8472408f71c0b3d32bab3.tar.bz2 |
Added recordings (not very functional now) to cvs
Diffstat (limited to 'recordings.h')
-rw-r--r-- | recordings.h | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/recordings.h b/recordings.h new file mode 100644 index 0000000..d350bbd --- /dev/null +++ b/recordings.h @@ -0,0 +1,86 @@ +#ifndef VDR_LIVE_RECORDINGS_H +#define VDR_LIVE_RECORDINGS_H + +#include <ctime> +#include <map> +#include <boost/shared_ptr.hpp> +#include <vdr/recording.h> + +namespace vdrlive { + + using namespace boost; + using namespace std; + + class RecordingsTree + { + public: + + class RecordingsItem; + + typedef shared_ptr< RecordingsItem > RecordingsItemPtr; + typedef map< string, RecordingsItemPtr > Map; + + class RecordingsItem + { + friend class RecordingsTree; + + public: + virtual ~RecordingsItem(); + virtual time_t StartTime() const = 0; + virtual bool IsDir() const = 0; + virtual const char* Name() const = 0; + + protected: + RecordingsItem(); + + private: + Map m_entries; + }; + + class RecordingsItemDir : public RecordingsItem + { + public: + RecordingsItemDir(); + virtual ~RecordingsItemDir(); + RecordingsItemDir(const string& name, int level); + + virtual time_t StartTime() const { return 0; } + virtual bool IsDir() const { return true; } + virtual const char* Name() const { return m_name.c_str(); } + + private: + string m_name; + int m_level; + }; + + class RecordingsItemRec : public RecordingsItem + { + public: + RecordingsItemRec(cRecording* recording); + virtual ~RecordingsItemRec(); + + virtual time_t StartTime() const; + virtual bool IsDir() const { return false; } + virtual const char* Name() const { return m_recording->Name(); } + + private: + cRecording *m_recording; + }; + + RecordingsTree(); + virtual ~RecordingsTree(); + + Map::iterator begin() { return m_root->m_entries.begin(); } + Map::iterator end() { return m_root->m_entries.end(); } + + int MaxLevel() const { return m_maxLevel; } + + private: + int m_maxLevel; + RecordingsItemPtr m_root; + cThreadLock m_recordingsLock; + }; + +} // namespace vdrlive + +#endif // VDR_LIVE_RECORDINGS_H |