summaryrefslogtreecommitdiff
path: root/dvbapi.h
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2000-03-11 18:00:00 +0100
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2000-03-11 18:00:00 +0100
commit6feebe674c09b65e43012bf439c201cfb65aa82c (patch)
tree85cf564cd0f48e44431a93ea2f22bba7fc924e98 /dvbapi.h
parentc475c637aba78366763cb122673ff836dd9e7e85 (diff)
downloadvdr-patch-lnbsharing-6feebe674c09b65e43012bf439c201cfb65aa82c.tar.gz
vdr-patch-lnbsharing-6feebe674c09b65e43012bf439c201cfb65aa82c.tar.bz2
Version 0.02vdr_osm-0.02
- Fixed compilation with only DEBUG_REMOTE=1. - Menus now use colors. - Support for "Red", "Green", "Yellow", "Blue" buttons. - Channels and Timers can now be added, deleted and moved. - Basic record/play file handling support (no actual record/playback yet).
Diffstat (limited to 'dvbapi.h')
-rw-r--r--dvbapi.h70
1 files changed, 59 insertions, 11 deletions
diff --git a/dvbapi.h b/dvbapi.h
index 6a8f040..2e8406e 100644
--- a/dvbapi.h
+++ b/dvbapi.h
@@ -4,23 +4,51 @@
* See the main source file 'osm.c' for copyright information and
* how to reach the author.
*
- * $Id: dvbapi.h 1.1 2000/02/19 13:36:48 kls Exp $
+ * $Id: dvbapi.h 1.2 2000/03/06 19:47:20 kls Exp $
*/
#ifndef __DVBAPI_H
#define __DVBAPI_H
-const int DvbOsdCharWidth = 12; //XXX
-const int DvbOsdLineHeight = 25;
+// FIXME: these should be defined in ../DVB/driver/dvb.h!!!
+typedef unsigned int u32;
+typedef unsigned short u16;
+typedef unsigned char u8;
+#if defined(DEBUG_OSD) || defined(DEBUG_REMOTE)
+#include <ncurses.h>
+#endif
+#include "../DVB/driver/dvb.h"
+
+enum eDvbColor { clrBackground,
+#ifndef DEBUG_OSD
+ clrOBSOLETE, //FIXME apparently color '1' can't be used as FgColor with e.g. clrRed as BgColor???
+ clrBlack,
+#else
+ clrBlack = clrBackground,
+#endif
+ clrRed,
+ clrGreen,
+ clrYellow,
+ clrBlue,
+ clrMagenta,
+ clrCyan,
+ clrWhite,
+ };
+
extern const char *DvbQuality; // Low, Medium, High
bool DvbSetChannel(int FrequencyMHz, char Polarization, int Diseqc, int Srate, int Vpid, int Apid);
class cDvbRecorder {
+private:
+ bool recording;
public:
cDvbRecorder(void);
~cDvbRecorder();
+ bool Recording(void);
+ // Returns true if this recorder is currently recording, false if it
+ // is playing back or does nothing.
bool Record(const char *FileName, char Quality);
// Starts recording the current channel into the given file, with the
// given quality level. Any existing file will be overwritten.
@@ -30,8 +58,9 @@ public:
bool Play(const char *FileName, int Frame = 0);
// Starts playback of the given file, at the optional Frame (default
// is the beginning of the file). If Frame is beyond the last recorded
- // frame in the file, or if it is negative, playback will be positioned
- // to the last frame in the file and will do an implicit Pause() there.
+ // frame in the file (or if it is negative), playback will be positioned
+ // to the last frame in the file (or the frame with the absolute value of
+ // Frame) and will do an implicit Pause() there.
// If there is already a playback session active, it will be stopped
// and the new file or frame (which may be in the same file) will
// be played back.
@@ -56,10 +85,29 @@ public:
// The very first frame has the number 1.
};
-void DvbOsdOpen(int x, int y, int w, int h);
-void DvbOsdClose(void);
-void DvbOsdClear(void);
-void DvbOsdClrEol(int x, int y);
-void DvbOsdText(int x, int y, char *s);
-
+class cDvbOsd {
+private:
+ enum { charWidth = 12, // average character width
+ lineHeight = 27 // smallest text height
+ };
+#ifdef DEBUG_OSD
+ WINDOW *window;
+ enum { MaxColorPairs = 16 };
+ int colorPairs[MaxColorPairs];
+ void SetColor(eDvbColor colorFg, eDvbColor colorBg = clrBackground);
+#else
+ void Cmd(OSD_Command cmd, int color = 0, int x0 = 0, int y0 = 0, int x1 = 0, int y1 = 0, const void *data = NULL);
+#endif
+ int cols, rows;
+public:
+ cDvbOsd(void);
+ ~cDvbOsd();
+ void Open(int w, int h);
+ void Close(void);
+ void Clear(void);
+ void Fill(int x, int y, int w, int h, eDvbColor color = clrBackground);
+ void ClrEol(int x, int y, eDvbColor color = clrBackground);
+ void Text(int x, int y, const char *s, eDvbColor colorFg = clrWhite, eDvbColor colorBg = clrBackground);
+ };
+
#endif //__DVBAPI_H