From 49242e7abd824d13fbc8ddb5cbd4be60b095420c Mon Sep 17 00:00:00 2001 From: phintuka Date: Sun, 30 Nov 2008 10:56:27 +0000 Subject: Added wrappers for SetPalette, Move and Flush. --- osd.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/osd.c b/osd.c index 4202432c..cb3ea99a 100644 --- a/osd.c +++ b/osd.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: osd.c,v 1.27 2008-11-30 10:38:39 phintuka Exp $ + * $Id: osd.c,v 1.28 2008-11-30 10:56:27 phintuka Exp $ * */ @@ -136,7 +136,10 @@ class cXinelibOsd : public cOsd, public cListObject int W, int H, unsigned char *Data, int Colors, unsigned int *Palette, osd_rect_t *DirtyArea); + void CmdPalette(int Wnd, int Colors, unsigned int *Palette); + void CmdMove(int Wnd, int Width, int Height); void CmdClose(int Wnd); + void CmdFlush(void); protected: static cMutex m_Lock; @@ -182,6 +185,41 @@ void cXinelibOsd::CmdSize(int Width, int Height) } } +void cXinelibOsd::CmdMove(int Wnd, int NewX, int NewY) +{ + TRACEF("cXinelibOsd::CmdMove"); + + if (m_Device) { + osd_command_t osdcmd = {0}; + + osdcmd.cmd = OSD_Move; + osdcmd.wnd = Wnd; + osdcmd.x = NewX; + osdcmd.y = NewY; + + m_Device->OsdCmd((void*)&osdcmd); + } +} + +void cXinelibOsd::CmdPalette(int Wnd, int Colors, unsigned int *Palette) +{ + TRACEF("cXinelibOsd::CmdPalette"); + + if (m_Device) { + xine_clut_t clut[Colors]; + osd_command_t osdcmd = {0}; + + osdcmd.cmd = OSD_SetPalette; + osdcmd.wnd = Wnd; + osdcmd.palette = clut; + osdcmd.colors = Colors; + + prepare_palette(&clut[0], Palette, Colors, /*Top*/(Prev() == NULL), true); + + m_Device->OsdCmd((void*)&osdcmd); + } +} + void cXinelibOsd::CmdClose(int Wnd) { TRACEF("cXinelibOsd::CmdClose"); @@ -199,6 +237,19 @@ void cXinelibOsd::CmdClose(int Wnd) } } +void cXinelibOsd::CmdFlush(void) +{ + TRACEF("cXinelibOsd::CmdFlush"); + + if (m_Device) { + osd_command_t osdcmd = {0}; + + osdcmd.cmd = OSD_Flush; + + m_Device->OsdCmd((void*)&osdcmd); + } +} + void cXinelibOsd::CmdRle(int Wnd, int X0, int Y0, int W, int H, unsigned char *Data, int Colors, unsigned int *Palette, @@ -388,6 +439,9 @@ void cXinelibOsd::CloseWindows(void) CmdClose(i); } } + + if (!m_Refresh) + CmdFlush(); } void cXinelibOsd::Hide(void) -- cgit v1.2.3