summaryrefslogtreecommitdiff
path: root/sourceparams.h
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2010-02-28 12:19:50 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2010-02-28 12:19:50 +0100
commit1eb033576f1829b4466ac27825af91e662e7b17f (patch)
treee02d623302de293070fe381db71f712207372606 /sourceparams.h
parentd255ad785d7a9f258097e6bba55c950d516b6a67 (diff)
downloadvdr-1eb033576f1829b4466ac27825af91e662e7b17f.tar.gz
vdr-1eb033576f1829b4466ac27825af91e662e7b17f.tar.bz2
Added plugin-defined sources
Diffstat (limited to 'sourceparams.h')
-rw-r--r--sourceparams.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/sourceparams.h b/sourceparams.h
new file mode 100644
index 00000000..be04b567
--- /dev/null
+++ b/sourceparams.h
@@ -0,0 +1,53 @@
+/*
+ * sourceparams.h: Source parameter handling
+ *
+ * See the main source file 'vdr.c' for copyright information and
+ * how to reach the author.
+ *
+ * $Id: sourceparams.h 1.1 2010/02/28 11:58:03 kls Exp $
+ */
+
+#ifndef __SOURCEPARAMS_H
+#define __SOURCEPARAMS_H
+
+#include "channels.h"
+#include "osdbase.h"
+#include "tools.h"
+
+class cSourceParam : public cListObject {
+private:
+ char source;
+public:
+ cSourceParam(char Source, const char *Description);
+ ///< Sets up a parameter handler for the given Source.
+ ///< Source must be in the range 'A'...'Z', and there can only
+ ///< be one cSourceParam for any given source.
+ ///< Description contains a short, one line description of this source.
+ ///< If a plugin sets up a new cSourceParam, this will also trigger
+ ///< defining the appropriate cSource automatically.
+ ///< Objects of cSourceParam shall only be created on the heap, and
+ ///< shall never be deleted (they will be deleted automatically when
+ ///< the program ends).
+ char Source(void) const { return source; }
+ virtual void SetData(cChannel *Channel) = 0;
+ ///< Sets all source specific parameters to those of the given Channel.
+ ///< Must also reset a counter to use with later calls to GetOsdItem().
+ virtual void GetData(cChannel *Channel) = 0;
+ ///< Copies all source specific parameters to the given Channel.
+ virtual cOsdItem *GetOsdItem(void) = 0;
+ ///< Returns all the OSD items necessary for editing the source
+ ///< specific parameters of the channel that was given in the last
+ ///< call to SetData(). Each call to GetOsdItem() returns exactly
+ ///< one such item. After all items have been fetched, any further
+ ///< calls to GetOsdItem() return NULL. After another call to
+ ///< SetData(), the OSD items can be fetched again.
+ };
+
+class cSourceParams : public cList<cSourceParam> {
+public:
+ cSourceParam *Get(char Source) const;
+ };
+
+extern cSourceParams SourceParams;
+
+#endif //__SOURCEPARAMS_H