From 27919ee969866b68fc95b327a047a9989e4b4153 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 27 Jan 2002 18:00:00 +0100 Subject: Version 0.99pre2 - Fixed setting the OSD size in the 'Confirm' interface call (thanks to Deti Fliegl). - Removed the 'read incomplete section...' error message in the EIT processor. - Fixed channel data for "DW TV" (thanks to Axel Gruber). - Added DPID to "PREMIERE MOVIE 1" in channels.conf.cable (thanks to Stephan Schreiber). - Prepared the OSD functions for multiple overlapping windows. - Removed the check to see whether the system time is running linearly. - Improved performance of SVDRP command entry. - Removed EPGBugfixLevel '3' - after more than a year Pro-7 finally managed to broadcast the correct timestamps for EPG events between 0:00 and 6:00! - Fixed failing watchdog timer if program hangs in OSD activities (thanks to Carsten Koch). - No longer requiring 'libncurses' if compiling without DEBUG_OSD=1 and REMOTE=KBD (thanks to Lauri Pesonen). - The "Recordings" menu now displays a hierarchical structure if there are subdirectories for the recordings. This can be controlled through the "RecordingDirs" parameter in the "Setup" menu. See "MANUAL/Replaying a Recording" for details. - Improved speed of setting the Help button texts. - Fixed handling file names that contain single quotes (') or dollar signs ($) in the call to the shutdown command (option '-s') and the recording command (option '-r'). - Improved error handling in the editing process; the resulting file will be deleted if an error occured. - A message is now prompted at the end of the editing process, indicating whether the process succeeded or failed. - Fixed setting the LastActivity timestamp after a shutdown prompt (thanks to Sergei Haller). - A message is now prompted if free disk space becomes low during recording. - The editing process now calls AssertFreeDiskSpace() to remove deleted recordings if the disk becomes full. - The "Main" menu now displays in its title the used disk space (in percent) and the estimated free disk space (in hh:mm), assuming a data rate of 30 MB per minute. - Activating the "Recordings" menu now displays "scanning recordings..." to give the user some feedback in case this takes longer. - Status messages are now displayed centered. - Removed the 'Tools' subdirectory from the VDR archive. All contributed tools can now be found at ftp://ftp.cadsoft.de/pub/people/kls/vdr/Tools. --- dvbosd.h | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 65 insertions(+), 6 deletions(-) (limited to 'dvbosd.h') diff --git a/dvbosd.h b/dvbosd.h index 5039a91..ceac507 100644 --- a/dvbosd.h +++ b/dvbosd.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: dvbosd.h 1.8 2001/07/28 16:22:32 kls Exp $ + * $Id: dvbosd.h 1.9 2001/12/09 15:11:05 kls Exp $ */ #ifndef __DVBOSD_H @@ -75,6 +75,7 @@ protected: public: cBitmap(int Width, int Height, int Bpp, bool ClearWithBackground = true); virtual ~cBitmap(); + bool ClearWithBackground(void) { return clearWithBackground; } eDvbFont SetFont(eDvbFont Font); bool Dirty(int &x1, int &y1, int &x2, int &y2); void SetPixel(int x, int y, eDvbColor Color); @@ -93,26 +94,84 @@ public: class cWindow; +typedef int tWindowHandle; + +// '-1' is used as an error return value! +#define ALL_WINDOWS (-2) +#define ALL_TILED_WINDOWS (-3) +#define LAST_CREATED_WINDOW (-4) + class cDvbOsd { private: int videoDev; int numWindows; int x0, y0; cWindow *window[MAXNUMWINDOWS]; + bool SetWindow(cWindow *Window); void Cmd(OSD_Command cmd, int color = 0, int x0 = 0, int y0 = 0, int x1 = 0, int y1 = 0, const void *data = NULL); cWindow *GetWindow(int x, int y); + cWindow *GetWindow(tWindowHandle Window); public: cDvbOsd(int VideoDev, int x, int y, int w = -1, int h = -1, int Bpp = -1); + // Initializes the OSD on the given VideoDev, starting at screen coordinates + // (x, y). If w, h and Bpp are given, one window with that width, height and + // color depth will be created - otherwise the actual windows will have to + // be created by separate calls to Create(). ~cDvbOsd(); - bool Create(int x, int y, int w, int h, int Bpp, bool ClearWithBackground = true, eDvbColor Color0 = clrTransparent, eDvbColor Color1 = clrTransparent, eDvbColor Color2 = clrTransparent, eDvbColor Color3 = clrTransparent); + // Destroys all windows and shuts down the OSD. + tWindowHandle Create(int x, int y, int w, int h, int Bpp, bool ClearWithBackground = true, bool Tiled = true); + // Creates a window at coordinates (x, y), which are relative to the OSD's + // origin given in the constructor, with the given width, height and color + // depth. ClearWithBackground controls whether the window will be filled with + // clrBackground when it is cleared. Setting this to 'false' may be useful + // for windows that don't need clrBackground but want to save this color + // palette entry for a different color. Tiled controls whether this will + // be part of a multi section OSD (with several windows that all have + // different color depths and palettes and form one large OSD area), or + // whether this is a "standalone" window that will be drawn "in front" + // of any windows defined *after* this one (this can be used for highlighting + // certain parts of the OSD, as would be done in a 'cursor'). + // Returns a handle that can be used to identify this window. + void AddColor(eDvbColor Color, tWindowHandle Window = LAST_CREATED_WINDOW); + // Adds the Color to the color palette of the given window if it is not + // already contained in the palette (and if the palette still has free + // slots for new colors). The default value LAST_CREATED_WINDOW will + // access the most recently created window, without the need of explicitly + // using a window handle. void Flush(void); - void Clear(void); - void Fill(int x1, int y1, int x2, int y2, eDvbColor Color); - void SetBitmap(int x, int y, const cBitmap &Bitmap); + // Actually commits all data of all windows to the OSD. + void Clear(tWindowHandle Window = ALL_TILED_WINDOWS); + // Clears the given window. If ALL_TILED_WINDOWS is given, only the tiled + // windows will be cleared, leaving the standalone windows untouched. If + // ALL_WINDOWS is given, the standalone windows will also be cleared. + void Fill(int x1, int y1, int x2, int y2, eDvbColor Color, tWindowHandle Window = ALL_TILED_WINDOWS); + // Fills the rectangle defined by the upper left (x1, y2) and lower right + // (x2, y2) corners with the given Color. If a specific window is given, + // the coordinates are relative to that window's upper left corner. + // Otherwise they are relative to the upper left corner of the entire OSD. + // If all tiled windows are selected, only that window which contains the + // point (x1, y1) will actually be filled. + void SetBitmap(int x, int y, const cBitmap &Bitmap, tWindowHandle Window = ALL_TILED_WINDOWS); + // Sets the pixels within the given window with the data from the given + // Bitmap. See Fill() for details about the coordinates. int Width(unsigned char c); + // Returns the width (in pixels) of the given character in the current font. int Width(const char *s); + // Returns the width (in pixels) of the given string in the current font. eDvbFont SetFont(eDvbFont Font); - void Text(int x, int y, const char *s, eDvbColor ColorFg = clrWhite, eDvbColor ColorBg = clrBackground); + // Sets the current font for subsequent Width() and Text() operations. + void Text(int x, int y, const char *s, eDvbColor ColorFg = clrWhite, eDvbColor ColorBg = clrBackground, tWindowHandle Window = ALL_TILED_WINDOWS); + // Writes the given string at coordinates (x, y) with the given foreground + // and background color into the given window (see Fill() for details + // about the coordinates). + void Relocate(tWindowHandle Window, int x, int y, int NewWidth = -1, int NewHeight = -1); + // Moves the given window to the new location at (x, y). If NewWidth and + // NewHeight are also given, the window will also be resized to the new + // width and height. + void Hide(tWindowHandle Window); + // Hides the given window. + void Show(tWindowHandle Window); + // Shows the given window. }; #endif //__DVBOSD_H -- cgit v1.2.3