summaryrefslogtreecommitdiff
path: root/PLUGINS
diff options
context:
space:
mode:
Diffstat (limited to 'PLUGINS')
-rw-r--r--PLUGINS/src/dvbhddevice/dvbhdffdevice.c173
-rw-r--r--PLUGINS/src/dvbhddevice/hdffosd.c104
-rw-r--r--PLUGINS/src/pictures/HISTORY4
-rw-r--r--PLUGINS/src/pictures/pictures.c4
-rw-r--r--PLUGINS/src/pictures/player.c7
-rw-r--r--PLUGINS/src/pictures/player.h3
-rw-r--r--PLUGINS/src/skincurses/HISTORY5
-rw-r--r--PLUGINS/src/skincurses/skincurses.c20
8 files changed, 172 insertions, 148 deletions
diff --git a/PLUGINS/src/dvbhddevice/dvbhdffdevice.c b/PLUGINS/src/dvbhddevice/dvbhdffdevice.c
index ced24f5..f8b47bd 100644
--- a/PLUGINS/src/dvbhddevice/dvbhdffdevice.c
+++ b/PLUGINS/src/dvbhddevice/dvbhdffdevice.c
@@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
- * $Id: dvbhdffdevice.c 1.41 2012/03/07 13:52:41 kls Exp $
+ * $Id: dvbhdffdevice.c 1.43 2012/05/08 11:40:32 kls Exp $
*/
#include <stdint.h>
@@ -50,7 +50,7 @@ cDvbHdFfDevice::cDvbHdFfDevice(int Adapter, int Frontend)
mHdffCmdIf = new HDFF::cHdffCmdIf(fd_osd);
/* reset some stuff in case the VDR was killed before and had no chance
- to clean up. */
+ to clean up. */
mHdffCmdIf->CmdOsdReset();
mHdffCmdIf->CmdAvSetVideoSpeed(0, 100);
@@ -183,68 +183,72 @@ void cDvbHdFfDevice::GetOsdSize(int &Width, int &Height, double &PixelAspect)
gHdffSetup.GetOsdSize(Width, Height, PixelAspect);
}
-/*TODO obsolete?
-bool cDvbHdFfDevice::SetAudioBypass(bool On)
-{
- if (setTransferModeForDolbyDigital != 1)
- return false;
- return ioctl(fd_audio, AUDIO_SET_BYPASS_MODE, On) == 0;
-}
-TODO*/
-
bool cDvbHdFfDevice::SetPid(cPidHandle *Handle, int Type, bool On)
{
- if (Handle->pid) {
- dmx_pes_filter_params pesFilterParams;
- memset(&pesFilterParams, 0, sizeof(pesFilterParams));
- if (On) {
- if (Handle->handle < 0) {
- Handle->handle = DvbOpen(DEV_DVB_DEMUX, adapter, frontend, O_RDWR | O_NONBLOCK, true);
- if (Handle->handle < 0) {
- LOG_ERROR;
- return false;
- }
- }
- if (Type == ptPcr)
- mHdffCmdIf->CmdAvSetPcrPid(0, Handle->pid);
- else if (Type == ptVideo) {
- if (Handle->streamType == 0x1B)
- mHdffCmdIf->CmdAvSetVideoPid(0, Handle->pid, HDFF_VIDEO_STREAM_H264);
- else
- mHdffCmdIf->CmdAvSetVideoPid(0, Handle->pid, HDFF_VIDEO_STREAM_MPEG2);
- }
- else if (Type == ptAudio)
- mHdffCmdIf->CmdAvSetAudioPid(0, Handle->pid, HDFF_AUDIO_STREAM_MPEG1);
- else if (Type == ptDolby)
- mHdffCmdIf->CmdAvSetAudioPid(0, Handle->pid, HDFF_AUDIO_STREAM_AC3);
- if (!(Type <= ptDolby && Handle->used <= 1)) {
- pesFilterParams.pid = Handle->pid;
- pesFilterParams.input = DMX_IN_FRONTEND;
- pesFilterParams.output = DMX_OUT_TS_TAP;
- pesFilterParams.pes_type= DMX_PES_OTHER;
- pesFilterParams.flags = DMX_IMMEDIATE_START;
- if (ioctl(Handle->handle, DMX_SET_PES_FILTER, &pesFilterParams) < 0) {
- LOG_ERROR;
- return false;
- }
- }
+ //printf("SetPid Type %d, On %d, PID %5d, streamtype %d, handle %d, used %d\n", Type, On, Handle->pid, Handle->streamType, Handle->handle, Handle->used);
+ if (Handle->pid) {
+ dmx_pes_filter_params pesFilterParams;
+ memset(&pesFilterParams, 0, sizeof(pesFilterParams));
+ if (On) {
+ if (Handle->handle < 0) {
+ Handle->handle = DvbOpen(DEV_DVB_DEMUX, adapter, frontend, O_RDWR | O_NONBLOCK, true);
+ if (Handle->handle < 0) {
+ LOG_ERROR;
+ return false;
+ }
+ }
+ if (Type == ptPcr)
+ mHdffCmdIf->CmdAvSetPcrPid(0, Handle->pid);
+ else if (Type == ptVideo) {
+ if (Handle->streamType == 0x1B)
+ mHdffCmdIf->CmdAvSetVideoPid(0, Handle->pid, HDFF_VIDEO_STREAM_H264);
+ else
+ mHdffCmdIf->CmdAvSetVideoPid(0, Handle->pid, HDFF_VIDEO_STREAM_MPEG2);
+ }
+ else if (Type == ptAudio) {
+ if (Handle->streamType == 0x03)
+ mHdffCmdIf->CmdAvSetAudioPid(0, Handle->pid, HDFF_AUDIO_STREAM_MPEG1);
+ else if (Handle->streamType == 0x04)
+ mHdffCmdIf->CmdAvSetAudioPid(0, Handle->pid, HDFF_AUDIO_STREAM_MPEG2);
+ else if (Handle->streamType == SI::AC3DescriptorTag)
+ mHdffCmdIf->CmdAvSetAudioPid(0, Handle->pid, HDFF_AUDIO_STREAM_AC3);
+ else if (Handle->streamType == SI::EnhancedAC3DescriptorTag)
+ mHdffCmdIf->CmdAvSetAudioPid(0, Handle->pid, HDFF_AUDIO_STREAM_EAC3);
+ else if (Handle->streamType == 0x0F)
+ mHdffCmdIf->CmdAvSetAudioPid(0, Handle->pid, HDFF_AUDIO_STREAM_AAC);
+ else if (Handle->streamType == 0x11)
+ mHdffCmdIf->CmdAvSetAudioPid(0, Handle->pid, HDFF_AUDIO_STREAM_HE_AAC);
+ else
+ mHdffCmdIf->CmdAvSetAudioPid(0, Handle->pid, HDFF_AUDIO_STREAM_MPEG1);
+ }
+ if (!(Type <= ptDolby && Handle->used <= 1)) {
+ pesFilterParams.pid = Handle->pid;
+ pesFilterParams.input = DMX_IN_FRONTEND;
+ pesFilterParams.output = DMX_OUT_TS_TAP;
+ pesFilterParams.pes_type= DMX_PES_OTHER;
+ pesFilterParams.flags = DMX_IMMEDIATE_START;
+ if (ioctl(Handle->handle, DMX_SET_PES_FILTER, &pesFilterParams) < 0) {
+ LOG_ERROR;
+ return false;
+ }
+ }
}
- else if (!Handle->used) {
- CHECK(ioctl(Handle->handle, DMX_STOP));
- if (Type == ptPcr)
- mHdffCmdIf->CmdAvSetPcrPid(0, 0);
- else if (Type == ptVideo)
- mHdffCmdIf->CmdAvSetVideoPid(0, 0, HDFF_VIDEO_STREAM_MPEG1);
- else if (Type == ptAudio)
- mHdffCmdIf->CmdAvSetAudioPid(0, 0, HDFF_AUDIO_STREAM_MPEG1);
- else if (Type == ptDolby)
- mHdffCmdIf->CmdAvSetAudioPid(0, 0, HDFF_AUDIO_STREAM_AC3);
- //TODO missing setting to 0x1FFF??? see cDvbDevice::SetPid()
- close(Handle->handle);
- Handle->handle = -1;
+ else if (!Handle->used) {
+ CHECK(ioctl(Handle->handle, DMX_STOP));
+ if (Type == ptPcr)
+ mHdffCmdIf->CmdAvSetPcrPid(0, 0);
+ else if (Type == ptVideo)
+ mHdffCmdIf->CmdAvSetVideoPid(0, 0, HDFF_VIDEO_STREAM_MPEG1);
+ else if (Type == ptAudio)
+ mHdffCmdIf->CmdAvSetAudioPid(0, 0, HDFF_AUDIO_STREAM_MPEG1);
+ else if (Type == ptDolby)
+ mHdffCmdIf->CmdAvSetAudioPid(0, 0, HDFF_AUDIO_STREAM_AC3);
+ //TODO missing setting to 0x1FFF??? see cDvbDevice::SetPid()
+ close(Handle->handle);
+ Handle->handle = -1;
}
- }
- return true;
+ }
+ return true;
}
void cDvbHdFfDevice::TurnOffLiveMode(bool LiveView)
@@ -286,6 +290,8 @@ bool cDvbHdFfDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
if (CamSlot() && !ChannelCamRelations.CamDecrypt(Channel->GetChannelID(), CamSlot()->SlotNumber()))
StartTransferMode |= LiveView && IsPrimaryDevice() && Channel->Ca() >= CA_ENCRYPTED_MIN;
+ //printf("SetChannelDevice Transfer %d, Live %d\n", StartTransferMode, LiveView);
+
bool TurnOnLivePIDs = !StartTransferMode && LiveView;
// Turn off live PIDs if necessary:
@@ -301,13 +307,10 @@ bool cDvbHdFfDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
// PID settings:
if (TurnOnLivePIDs) {
- //SetAudioBypass(false);//TODO obsolete?
- if (!(AddPid(Channel->Ppid(), ptPcr) && AddPid(vpid, ptVideo, Channel->Vtype()) && AddPid(apid, ptAudio))) {
+ if (!(AddPid(Channel->Ppid(), ptPcr) && AddPid(vpid, ptVideo, Channel->Vtype()) && AddPid(apid ? apid : dpid, ptAudio, apid ? 0 : Channel->Dtype(0)))) {
esyslog("ERROR: failed to set PIDs for channel %d on device %d", Channel->Number(), CardIndex() + 1);
return false;
}
- if (IsPrimaryDevice())
- AddPid(Channel->Tpid(), ptTeletext);//TODO obsolete?
}
else if (StartTransferMode)
cControl::Launch(new cTransferControl(this, Channel));
@@ -338,27 +341,31 @@ void cDvbHdFfDevice::SetDigitalAudioDevice(bool On)
void cDvbHdFfDevice::SetAudioTrackDevice(eTrackType Type)
{
- //printf("SetAudioTrackDevice %d\n", Type);
- const tTrackId *TrackId = GetTrack(Type);
- if (TrackId && TrackId->id) {
- if (IS_AUDIO_TRACK(Type)) {
+ //printf("SetAudioTrackDevice %d\n", Type);
+ const tTrackId *TrackId = GetTrack(Type);
+ if (TrackId && TrackId->id) {
+ int streamType = 0;
+ cChannel * channel = Channels.GetByNumber(CurrentChannel());
+ if (channel) {
+ if (IS_AUDIO_TRACK(Type))
+ streamType = channel->Atype(Type - ttAudioFirst);
+ else if (IS_DOLBY_TRACK(Type))
+ streamType = channel->Dtype(Type - ttDolbyFirst);
+ }
+ //printf("SetAudioTrackDevice new %d %d, current %d\n", TrackId->id, streamType, pidHandles[ptAudio].pid);
if (pidHandles[ptAudio].pid && pidHandles[ptAudio].pid != TrackId->id) {
- DetachAll(pidHandles[ptAudio].pid);
- if (CamSlot())
- CamSlot()->SetPid(pidHandles[ptAudio].pid, false);
- pidHandles[ptAudio].pid = TrackId->id;
- SetPid(&pidHandles[ptAudio], ptAudio, true);
- if (CamSlot()) {
- CamSlot()->SetPid(pidHandles[ptAudio].pid, true);
- CamSlot()->StartDecrypting();
- }
- }
- }
- else if (IS_DOLBY_TRACK(Type)) {
- pidHandles[ptDolby].pid = TrackId->id;
- SetPid(&pidHandles[ptDolby], ptDolby, true);
+ DetachAll(pidHandles[ptAudio].pid);
+ if (CamSlot())
+ CamSlot()->SetPid(pidHandles[ptAudio].pid, false);
+ pidHandles[ptAudio].pid = TrackId->id;
+ pidHandles[ptAudio].streamType = streamType;
+ SetPid(&pidHandles[ptAudio], ptAudio, true);
+ if (CamSlot()) {
+ CamSlot()->SetPid(pidHandles[ptAudio].pid, true);
+ CamSlot()->StartDecrypting();
+ }
}
- }
+ }
}
bool cDvbHdFfDevice::CanReplay(void) const
diff --git a/PLUGINS/src/dvbhddevice/hdffosd.c b/PLUGINS/src/dvbhddevice/hdffosd.c
index a492275..0b95707 100644
--- a/PLUGINS/src/dvbhddevice/hdffosd.c
+++ b/PLUGINS/src/dvbhddevice/hdffosd.c
@@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
- * $Id: hdffosd.c 1.12 2011/12/04 15:31:41 kls Exp $
+ * $Id: hdffosd.c 1.15 2012/05/17 13:29:50 kls Exp $
*/
#include "hdffosd.h"
@@ -40,7 +40,6 @@ private:
int mDispHeight;
bool shown;
bool mChanged;
- bool mBitmapModified;
uint32_t mDisplay;
tFontFace mFontFaces[MAX_NUM_FONTFACES];
tFont mFonts[MAX_NUM_FONTS];
@@ -53,7 +52,6 @@ protected:
public:
cHdffOsd(int Left, int Top, HDFF::cHdffCmdIf * pHdffCmdIf, uint Level);
virtual ~cHdffOsd();
- cBitmap *GetBitmap(int Area);
virtual eOsdError CanHandleAreas(const tArea *Areas, int NumAreas);
virtual eOsdError SetAreas(const tArea *Areas, int NumAreas);
virtual void SaveRegion(int x1, int y1, int x2, int y2);
@@ -79,9 +77,8 @@ cHdffOsd::cHdffOsd(int Left, int Top, HDFF::cHdffCmdIf * pHdffCmdIf, uint Level)
mTop = Top;
shown = false;
mChanged = false;
- mBitmapModified = false;
mBitmapPalette = HDFF_INVALID_HANDLE;
- config.FontKerning = false;
+ config.FontKerning = true;
config.FontAntialiasing = Setup.AntiAlias ? true : false;
mHdffCmdIf->CmdOsdConfigure(&config);
@@ -126,14 +123,6 @@ cHdffOsd::~cHdffOsd()
mHdffCmdIf->CmdOsdDeleteDisplay(mDisplay);
}
-cBitmap * cHdffOsd::GetBitmap(int Area)
-{
- //printf("GetBitmap %d\n", Area);
- mChanged = true;
- mBitmapModified = true;
- return cOsd::GetBitmap(Area);
-}
-
eOsdError cHdffOsd::CanHandleAreas(const tArea *Areas, int NumAreas)
{
eOsdError Result = cOsd::CanHandleAreas(Areas, NumAreas);
@@ -150,6 +139,9 @@ eOsdError cHdffOsd::CanHandleAreas(const tArea *Areas, int NumAreas)
eOsdError cHdffOsd::SetAreas(const tArea *Areas, int NumAreas)
{
+ eOsdError error;
+ cBitmap * bitmap;
+
for (int i = 0; i < NumAreas; i++)
{
//printf("SetAreas %d: %d %d %d %d %d\n", i, Areas[i].x1, Areas[i].y1, Areas[i].x2, Areas[i].y2, Areas[i].bpp);
@@ -160,7 +152,14 @@ eOsdError cHdffOsd::SetAreas(const tArea *Areas, int NumAreas)
mHdffCmdIf->CmdOsdRenderDisplay(mDisplay);
shown = false;
}
- return cOsd::SetAreas(Areas, NumAreas);
+ error = cOsd::SetAreas(Areas, NumAreas);
+
+ for (int i = 0; (bitmap = GetBitmap(i)) != NULL; i++)
+ {
+ bitmap->Clean();
+ }
+
+ return error;
}
void cHdffOsd::SetActive(bool On)
@@ -186,25 +185,22 @@ void cHdffOsd::SaveRegion(int x1, int y1, int x2, int y2)
{
mHdffCmdIf->CmdOsdSaveRegion(mDisplay, mLeft + x1, mTop + y1, x2 - x1 + 1, y2 - y1 + 1);
mChanged = true;
- mBitmapModified = false;
}
void cHdffOsd::RestoreRegion(void)
{
mHdffCmdIf->CmdOsdRestoreRegion(mDisplay);
mChanged = true;
- mBitmapModified = false;
}
void cHdffOsd::DrawPixel(int x, int y, tColor Color)
{
//printf("DrawPixel\n");
- mBitmapModified = false;
}
void cHdffOsd::DrawBitmap(int x, int y, const cBitmap &Bitmap, tColor ColorFg, tColor ColorBg, bool ReplacePalette, bool Overlay)
{
- //printf("DrawBitmap %d %d %d\n", x, y, Overlay);
+ //printf("DrawBitmap %d %d %d x %d\n", x, y, Bitmap.Width(), Bitmap.Height());
int i;
int numColors;
const tColor * colors = Bitmap.Colors(numColors);
@@ -230,37 +226,21 @@ void cHdffOsd::DrawBitmap(int x, int y, const cBitmap &Bitmap, tColor ColorFg, t
mHdffCmdIf->CmdOsdSetPaletteColors(mBitmapPalette,
HDFF_COLOR_FORMAT_ARGB, 0, numColors, mBitmapColors);
}
- mHdffCmdIf->CmdOsdDrawBitmap(mDisplay, mLeft + x, mTop + y,
- (uint8_t *) Bitmap.Data(0, 0), Bitmap.Width(), Bitmap.Height(),
- Bitmap.Width() * Bitmap.Height(), HDFF_COLOR_TYPE_CLUT8, mBitmapPalette);
-#if 0
- uint32_t * tmpBitmap = new uint32_t[Bitmap.Width() * Bitmap.Height()];
- for (int ix = 0; ix < Bitmap.Width(); ix++)
+ int width = Bitmap.Width();
+ int height = Bitmap.Height();
+ int chunk = MAX_BITMAP_SIZE / width;
+ if (chunk > height)
+ chunk = height;
+ for (int yc = 0; yc < height; yc += chunk)
{
- for (int iy = 0; iy < Bitmap.Height(); iy++)
- {
- const tIndex * pixel = Bitmap.Data(ix, iy);
- tColor color = Bitmap.Color(*pixel);
- if (!Overlay || *pixel != 0)
- {
- if (ColorFg || ColorBg)
- {
- if (*pixel == 0)
- color = ColorBg;
- else if (*pixel == 1)
- color = ColorFg;
- }
- tmpBitmap[Bitmap.Width() * iy + ix] = color;
- }
- }
+ int hc = chunk;
+ if (yc + hc > height)
+ hc = height - yc;
+ mHdffCmdIf->CmdOsdDrawBitmap(mDisplay, mLeft + x, mTop + y + yc,
+ (uint8_t *) Bitmap.Data(0, yc), width, hc,
+ width * hc, HDFF_COLOR_TYPE_CLUT8, mBitmapPalette);
}
- mHdffCmdIf->CmdOsdDrawBitmap(mDisplay, mLeft + x, mTop + y,
- (uint8_t *) tmpBitmap, Bitmap.Width(), Bitmap.Height(),
- Bitmap.Width() * Bitmap.Height() * 4, HDFF::colorTypeARGB8888, InvalidHandle);
- delete[] tmpBitmap;
-#endif
mChanged = true;
- mBitmapModified = false;
}
void cHdffOsd::DrawText(int x, int y, const char *s, tColor ColorFg, tColor ColorBg, const cFont *Font, int Width, int Height, int Alignment)
@@ -365,11 +345,16 @@ void cHdffOsd::DrawText(int x, int y, const char *s, tColor ColorFg, tColor Colo
if (Width)
{
if ((Alignment & taLeft) != 0)
- ;
+ {
+ if ((Alignment & taBorder) != 0)
+ x += max(h / TEXT_ALIGN_BORDER, 1);
+ }
else if ((Alignment & taRight) != 0)
{
if (w < Width)
x += Width - w;
+ if ((Alignment & taBorder) != 0)
+ x -= max(h / TEXT_ALIGN_BORDER, 1);
}
else
{ // taCentered
@@ -413,14 +398,12 @@ void cHdffOsd::DrawText(int x, int y, const char *s, tColor ColorFg, tColor Colo
mHdffCmdIf->CmdOsdSetDisplayClippingArea(mDisplay, false, 0, 0, 0, 0);
//Font->DrawText(this, x, y, s, ColorFg, ColorBg, limit);
mChanged = true;
- mBitmapModified = false;
}
void cHdffOsd::DrawRectangle(int x1, int y1, int x2, int y2, tColor Color)
{
mHdffCmdIf->CmdOsdDrawRectangle(mDisplay, mLeft + x1, mTop + y1, x2 - x1 + 1, y2 - y1 + 1, Color);
mChanged = true;
- mBitmapModified = false;
}
void cHdffOsd::DrawEllipse(int x1, int y1, int x2, int y2, tColor Color, int Quadrants)
@@ -511,14 +494,12 @@ void cHdffOsd::DrawEllipse(int x1, int y1, int x2, int y2, tColor Color, int Qua
}
mHdffCmdIf->CmdOsdDrawEllipse(mDisplay, mLeft + cx, mTop + cy, rx, ry, Color, flags);
mChanged = true;
- mBitmapModified = false;
}
void cHdffOsd::DrawSlope(int x1, int y1, int x2, int y2, tColor Color, int Type)
{
//printf("DrawSlope\n");
mChanged = true;
- mBitmapModified = false;
}
void cHdffOsd::Flush(void)
@@ -526,23 +507,30 @@ void cHdffOsd::Flush(void)
if (!Active())
return;
- if (!mChanged)
- return;
-
//printf("Flush\n");
- if (mBitmapModified)
+ cBitmap * Bitmap;
+
+ for (int i = 0; (Bitmap = GetBitmap(i)) != NULL; i++)
{
- cBitmap *Bitmap;
- for (int i = 0; (Bitmap = GetBitmap(i)) != NULL; i++)
+ int x1;
+ int y1;
+ int x2;
+ int y2;
+
+ if (Bitmap->Dirty(x1, y1, x2, y2))
{
+ //printf("dirty %d %d, %d %d\n", x1, y1, x2, y2);
DrawBitmap(0, 0, *Bitmap);
+ Bitmap->Clean();
}
}
+ if (!mChanged)
+ return;
+
mHdffCmdIf->CmdOsdRenderDisplay(mDisplay);
mChanged = false;
- mBitmapModified = false;
}
diff --git a/PLUGINS/src/pictures/HISTORY b/PLUGINS/src/pictures/HISTORY
index e0826ee..9426283 100644
--- a/PLUGINS/src/pictures/HISTORY
+++ b/PLUGINS/src/pictures/HISTORY
@@ -71,3 +71,7 @@ VDR Plugin 'pictures' Revision History
2012-02-27: Version 0.1.2
- Removed an obsolete command line option.
+
+2012-04-2r8 Version 0.1.3
+
+- Added cPictureControl::GetHeader().
diff --git a/PLUGINS/src/pictures/pictures.c b/PLUGINS/src/pictures/pictures.c
index 27febdf..77df0d9 100644
--- a/PLUGINS/src/pictures/pictures.c
+++ b/PLUGINS/src/pictures/pictures.c
@@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
- * $Id: pictures.c 2.5 2012/02/27 11:40:15 kls Exp $
+ * $Id: pictures.c 2.6 2012/04/28 11:58:42 kls Exp $
*/
#include <getopt.h>
@@ -11,7 +11,7 @@
#include "menu.h"
#include "player.h"
-static const char *VERSION = "0.1.2";
+static const char *VERSION = "0.1.3";
static const char *DESCRIPTION = trNOOP("A simple picture viewer");
static const char *MAINMENUENTRY = trNOOP("Pictures");
diff --git a/PLUGINS/src/pictures/player.c b/PLUGINS/src/pictures/player.c
index 4b289ac..6048d4c 100644
--- a/PLUGINS/src/pictures/player.c
+++ b/PLUGINS/src/pictures/player.c
@@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
- * $Id: player.c 2.1 2011/02/20 17:15:25 kls Exp $
+ * $Id: player.c 2.2 2012/04/28 11:58:15 kls Exp $
*/
#include "player.h"
@@ -204,6 +204,11 @@ void cPictureControl::DisplayCaption(void)
osd->Flush();
}
+cString cPictureControl::GetHeader(void)
+{
+ return tr("Pictures");
+}
+
eOSState cPictureControl::ProcessKey(eKeys Key)
{
switch (Key) {
diff --git a/PLUGINS/src/pictures/player.h b/PLUGINS/src/pictures/player.h
index 67a274d..7a0b401 100644
--- a/PLUGINS/src/pictures/player.h
+++ b/PLUGINS/src/pictures/player.h
@@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
- * $Id: player.h 2.0 2008/01/12 16:21:57 kls Exp $
+ * $Id: player.h 2.1 2012/04/28 11:56:01 kls Exp $
*/
#ifndef _PLAYER_H
@@ -39,6 +39,7 @@ private:
public:
cPictureControl(cPictureEntry *Pictures, const cPictureEntry *PictureEntry, bool SlideShow = false);
virtual ~cPictureControl();
+ virtual cString GetHeader(void);
virtual eOSState ProcessKey(eKeys Key);
static bool Active(void) { return active > 0; }
static const char *LastDisplayed(void);
diff --git a/PLUGINS/src/skincurses/HISTORY b/PLUGINS/src/skincurses/HISTORY
index 0ba892e..deb011b 100644
--- a/PLUGINS/src/skincurses/HISTORY
+++ b/PLUGINS/src/skincurses/HISTORY
@@ -96,3 +96,8 @@ VDR Plugin 'skincurses' Revision History
2012-03-11: Version 0.1.11
- Adapted menu column widths of 'skincurses' to the wider HD OSD sizes.
+
+2012-04-23: Version 0.1.12
+
+- Now displaying disk usage in the title of the main and "Recordings" menu,
+ which is no longer done by the VDR core.
diff --git a/PLUGINS/src/skincurses/skincurses.c b/PLUGINS/src/skincurses/skincurses.c
index 1f120c7..587d0b9 100644
--- a/PLUGINS/src/skincurses/skincurses.c
+++ b/PLUGINS/src/skincurses/skincurses.c
@@ -3,15 +3,16 @@
*
* See the README file for copyright information and how to reach the author.
*
- * $Id: skincurses.c 2.8 2012/03/11 14:42:52 kls Exp $
+ * $Id: skincurses.c 2.9 2012/04/23 08:53:13 kls Exp $
*/
#include <ncurses.h>
#include <vdr/osd.h>
#include <vdr/plugin.h>
#include <vdr/skins.h>
+#include <vdr/videodir.h>
-static const char *VERSION = "0.1.11";
+static const char *VERSION = "0.1.12";
static const char *DESCRIPTION = trNOOP("A text only skin");
static const char *MAINMENUENTRY = NULL;
@@ -262,6 +263,9 @@ void cSkinCursesDisplayChannel::Flush(void)
class cSkinCursesDisplayMenu : public cSkinDisplayMenu {
private:
cOsd *osd;
+ cString title;
+ int lastDiskUsageState;
+ void DrawTitle(void);
void DrawScrollbar(int Total, int Offset, int Shown, int Top, int Height, bool CanScrollUp, bool CanScrollDown);
void SetTextScrollbar(void);
public:
@@ -285,6 +289,7 @@ public:
cSkinCursesDisplayMenu::cSkinCursesDisplayMenu(void)
{
osd = new cCursesOsd(0, 0);
+ lastDiskUsageState = -1;
osd->DrawRectangle(0, 0, ScOsdWidth - 1, ScOsdHeight - 1, clrBackground);
}
@@ -332,9 +337,16 @@ void cSkinCursesDisplayMenu::Clear(void)
textScroller.Reset();
}
+void cSkinCursesDisplayMenu::DrawTitle(void)
+{
+ bool WithDisk = MenuCategory() == mcMain || MenuCategory() == mcRecording;
+ osd->DrawText(0, 0, WithDisk ? cString::sprintf("%s - %s", *title, *cVideoDiskUsage::String()) : title, clrBlack, clrCyan, &Font, ScOsdWidth);
+}
+
void cSkinCursesDisplayMenu::SetTitle(const char *Title)
{
- osd->DrawText(0, 0, Title, clrBlack, clrCyan, &Font, ScOsdWidth);
+ title = Title;
+ DrawTitle();
}
void cSkinCursesDisplayMenu::SetButtons(const char *Red, const char *Green, const char *Yellow, const char *Blue)
@@ -475,6 +487,8 @@ void cSkinCursesDisplayMenu::SetText(const char *Text, bool FixedFont)
void cSkinCursesDisplayMenu::Flush(void)
{
+ if (cVideoDiskUsage::HasChanged(lastDiskUsageState))
+ DrawTitle();
cString date = DayDateTime();
osd->DrawText(ScOsdWidth - Utf8StrLen(date) - 2, 0, date, clrBlack, clrCyan, &Font);
osd->Flush();