diff options
author | Dieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de> | 2007-01-06 02:24:11 +0000 |
---|---|---|
committer | Dieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de> | 2007-01-06 02:24:11 +0000 |
commit | 8f9342e733730ac36f296140367e7b6b21d941c6 (patch) | |
tree | 5050953f2d5e3f0a6b97fa1918a1b71061f3cbec /recordings.cpp | |
parent | a92938f1dfcaf9b3be3258e46ab984c863153d58 (diff) | |
download | vdr-plugin-live-8f9342e733730ac36f296140367e7b6b21d941c6.tar.gz vdr-plugin-live-8f9342e733730ac36f296140367e7b6b21d941c6.tar.bz2 |
added recordings_items.ecpp; Updated html structure for recordings
Diffstat (limited to 'recordings.cpp')
-rw-r--r-- | recordings.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/recordings.cpp b/recordings.cpp index 08dd4cc..8290f80 100644 --- a/recordings.cpp +++ b/recordings.cpp @@ -4,12 +4,18 @@ namespace vdrlive { + RecordingsTree::RecordingsTree* RecordingsTree::globalInstance = 0; + RecordingsTree::RecordingsTree() : m_maxLevel(0), m_root(new RecordingsItemDir()), m_recordingsLock(&Recordings) { + if (globalInstance != 0) { + // TODO: report ERROR and fail. + } + for ( cRecording* recording = Recordings.First(); recording != 0; recording = Recordings.Next( recording ) ) { if (m_maxLevel < recording->HierarchyLevels()) { m_maxLevel = recording->HierarchyLevels(); @@ -39,10 +45,17 @@ namespace vdrlive { } } while (pos != string::npos); } + + globalInstance = this; } RecordingsTree::~RecordingsTree() { + if (globalInstance != this) + { + // TODO: report ERROR and fail + } + globalInstance = 0; } RecordingsTree::RecordingsItem::RecordingsItem() : @@ -84,4 +97,13 @@ namespace vdrlive { return m_recording->start; } + RecordingsTree& LiveRecordingsTree() + { + if (RecordingsTree::globalInstance == 0) + { + // TODO: report ERROR and fail! + } + return *RecordingsTree::globalInstance; + } + } // namespace vdrlive |