From 9279cb21cd311cbb141d506ba9d17c3a057b4d3c Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 17 Feb 2008 18:00:00 +0100 Subject: =?UTF-8?q?Version=201.5.15=20-=20Updated=20the=20Italian=20OSD=20?= =?UTF-8?q?texts=20(thanks=20to=20Diego=20Pierotto).=20-=20Added=20option?= =?UTF-8?q?=20-i=20to=20the=20pictures=20plugin's=20pic2mpg=20to=20ignore?= =?UTF-8?q?=20unknown=20file=20types.=20-=20Revoked=20the=20switch=20to=20?= =?UTF-8?q?the=20"multiproto"=20driver=20in=20order=20to=20make=20a=20new?= =?UTF-8?q?=20stable=20=20=20version=20before=20making=20this=20big=20swit?= =?UTF-8?q?ch=20and=20forcing=20all=20users=20to=20install=20a=20=20=20dri?= =?UTF-8?q?ver=20that=20is=20not=20yet=20in=20the=20kernel=20source.=20The?= =?UTF-8?q?=20removed=20code=20will=20reappear=20=20=20in=20version=201.7.?= =?UTF-8?q?0.=20=20=20Note=20that=20you=20may=20need=20to=20switch=20back?= =?UTF-8?q?=20to=20an=20older=20version=20of=20your=20channels.conf=20=20?= =?UTF-8?q?=20file=20if=20you=20have=20already=20used=20version=201.5.14,?= =?UTF-8?q?=20because=20it=20introduced=20new=20parameters.=20-=20Added=20?= =?UTF-8?q?the=20new=20command=20line=20option=20--userdump=20to=20enable?= =?UTF-8?q?=20core=20dumps=20in=20case=20VDR=20=20=20is=20run=20as=20root?= =?UTF-8?q?=20with=20option=20-u=20(thanks=20to=20Hans-Werner=20Hilse).=20?= =?UTF-8?q?-=20Speeded=20up=20anti-aliased=20font=20rendering=20by=20cachi?= =?UTF-8?q?ng=20the=20blend=20indexes=20(based=20on=20=20=20a=20suggestion?= =?UTF-8?q?=20by=20Martin=20Wache).=20-=20Fixed=20setting=20the=20OSD=20ar?= =?UTF-8?q?ea=20in=20the=20pictures=20plugin.=20-=20Ignoring=20"repeat"=20?= =?UTF-8?q?and=20"release"=20keys=20in=20the=20time=20search=20entry=20mod?= =?UTF-8?q?e=20during=20replay,=20=20=20to=20avoid=20inadvertently=20leavi?= =?UTF-8?q?ng=20it=20in=20case=20a=20key=20is=20pressed=20too=20long=20(su?= =?UTF-8?q?ggested=20=20=20by=20Andreas=20Brugger).=20-=20Improved=20sendi?= =?UTF-8?q?ng=20all=20frames=20to=20devices=20that=20can=20handle=20them?= =?UTF-8?q?=20in=20fast=20forward=20=20=20trick=20speeds,=20including=20su?= =?UTF-8?q?btitles=20(thanks=20to=20Timo=20Eskola).=20-=20The=20section=20?= =?UTF-8?q?handler=20is=20now=20stopped=20before=20the=20device=20is=20des?= =?UTF-8?q?troyed,=20to=20avoid=20=20=20accessing=20file=20handles=20after?= =?UTF-8?q?=20they=20have=20become=20invalid=20(thanks=20to=20Reinhard=20?= =?UTF-8?q?=20=20Nissl=20for=20reporting=20an=20invalid=20access=20when=20?= =?UTF-8?q?ending=20VDR,=20and=20to=20Deti=20Fliegl=20for=20=20=20a=20patc?= =?UTF-8?q?h=20that=20was=20used=20to=20implement=20StopSectionHandler()).?= =?UTF-8?q?=20-=20Fixed=20setting=20the=20date=20in=20the=20channel=20disp?= =?UTF-8?q?lay=20of=20the=20classic=20and=20sttng=20skins,=20=20=20to=20av?= =?UTF-8?q?oid=20unnecessary=20OSD=20access=20(thanks=20to=20Marco=20Schl?= =?UTF-8?q?=C3=BC=C3=9Fler).=20-=20The=20free=20disk=20space=20is=20now=20?= =?UTF-8?q?also=20displayed=20in=20the=20title=20of=20the=20"Recordings"?= =?UTF-8?q?=20=20=20menu=20(suggested=20by=20Walter=20Koch).=20-=20Changed?= =?UTF-8?q?=20the=20message=20"Upcoming=20VPS=20recording!"=20to=20"Upcomi?= =?UTF-8?q?ng=20recording!"=20because=20=20=20it=20applies=20to=20non-VPS?= =?UTF-8?q?=20recordings=20as=20well.=20-=20Fixed=20a=20loss=20of=20a=20ti?= =?UTF-8?q?mer's=20'recording'=20flag=20after=20modifying=20it=20via=20MOD?= =?UTF-8?q?T.=20-=20Fixed=20detecting=20directories=20in=20cFileNameList::?= =?UTF-8?q?Load().=20-=20Running=20the=20thread=20that=20removes=20deleted?= =?UTF-8?q?=20recordings=20at=20a=20low=20priority=20to=20(maybe)=20=20=20?= =?UTF-8?q?avoid=20stuttering=20replay=20in=20case=20the=20thread=20is=20r?= =?UTF-8?q?un=20during=20replay.=20-=20Limiting=20the=20length=20of=20the?= =?UTF-8?q?=20recording=20name=20in=20timers=20in=20case=20VDR=20is=20run?= =?UTF-8?q?=20with=20=20=20--vfat,=20in=20order=20to=20avoid=20names=20tha?= =?UTF-8?q?t=20are=20too=20long=20for=20Windows=20(suggested=20by=20Rolf?= =?UTF-8?q?=20=20=20Ahrenberg).=20-=20Using=20cString::sprintf()=20instead?= =?UTF-8?q?=20of=20asprintf()=20(thanks=20to=20Wolfgang=20Rohdewald=20=20?= =?UTF-8?q?=20for=20pointing=20out=20a=20possible=20problem=20if=20the=20r?= =?UTF-8?q?eturn=20value=20is=20not=20checked).=20=20=20Plugin=20authors?= =?UTF-8?q?=20may=20want=20to=20consider=20doing=20the=20same.=20For=20con?= =?UTF-8?q?venience=20there=20is=20now=20=20=20an=20additional=20version?= =?UTF-8?q?=20of=20cString::sprintf()=20that=20accepts=20a=20va=5Flist=20p?= =?UTF-8?q?arameter.=20-=20When=20deleting=20the=20recording=20that=20is?= =?UTF-8?q?=20currently=20replayed,=20the=20replay=20is=20now=20=20=20stop?= =?UTF-8?q?ped=20immediately=20(thanks=20to=20Mikko=20Matilainen=20for=20r?= =?UTF-8?q?eporting=20a=20possible=20crash=20=20=20if=20the=20Info=20key?= =?UTF-8?q?=20is=20pressed=20after=20deleting=20the=20currently=20replayed?= =?UTF-8?q?=20recording).=20-=20Updated=20the=20Russian=20OSD=20texts=20(t?= =?UTF-8?q?hanks=20to=20Oleg=20Roitburd).=20-=20When=20determining=20the?= =?UTF-8?q?=20amount=20of=20free=20disk=20space,=20any=20deleted=20(but=20?= =?UTF-8?q?not=20yet=20removed)=20=20=20recordings=20on=20different=20file?= =?UTF-8?q?=20systems=20(that=20are=20mounted=20under=20the=20video=20dire?= =?UTF-8?q?ctory)=20=20=20are=20no=20longer=20taken=20into=20account.=20-?= =?UTF-8?q?=20When=20running=20out=20of=20disk=20space=20during=20a=20reco?= =?UTF-8?q?rding,=20only=20such=20deleted=20or=20old=20=20=20recordings=20?= =?UTF-8?q?are=20removed,=20that=20actually=20are=20on=20the=20video=20dir?= =?UTF-8?q?ectory=20file=20system(s).=20=20=20This=20prevents=20VDR=20from?= =?UTF-8?q?=20accidentally=20deleting=20recordings=20on=20other=20file=20s?= =?UTF-8?q?ystems,=20=20=20which=20would=20not=20add=20any=20free=20space?= =?UTF-8?q?=20to=20the=20video=20directory.=20-=20Implemented=20the=20cSta?= =?UTF-8?q?tus,=20cDevice=20and=20cPlayer=20functions=20for=20setting=20su?= =?UTF-8?q?btitle=20tracks=20=20=20in=20plugins=20(thanks=20to=20Petri=20H?= =?UTF-8?q?intukainen).=20-=20Added=20cStatus::TimerChange()=20to=20inform?= =?UTF-8?q?=20plugins=20about=20changes=20to=20the=20list=20of=20timers=20?= =?UTF-8?q?=20=20(based=20on=20a=20patch=20from=20Benedikt=20Elser).=20-?= =?UTF-8?q?=20Added=20new=20cStatus=20functions=20to=20the=20'status'=20pl?= =?UTF-8?q?ugin.=20-=20Added=20missing=20#include=20=20to=20epg.?= =?UTF-8?q?c=20and=20menuitems.h=20(thanks=20to=20Ville=20Skytt=C3=A4).=20?= =?UTF-8?q?-=20The=20new=20function=20cSkin::SetScrollbar()=20can=20be=20i?= =?UTF-8?q?mplemented=20by=20skins=20to=20display=20=20=20a=20scrollbar=20?= =?UTF-8?q?in=20every=20list=20menu.=20The=20'classic'=20and=20'sttng'=20s?= =?UTF-8?q?kins=20have=20been=20=20=20changed=20accordingly,=20as=20well?= =?UTF-8?q?=20as=20the=20'skincurses'=20plugin.=20-=20Introduced=20'operat?= =?UTF-8?q?or=20const=20void=20*=20()'=20in=20cString=20to=20catch=20cases?= =?UTF-8?q?=20where=20operator*()=20=20=20should=20be=20used.=20-=20Fixed?= =?UTF-8?q?=20calculating=20the=20scrollbar=20sizes=20in=20the=20skins.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PLUGINS/src/hello/po/it_IT.po | 22 +++++++-------- PLUGINS/src/pictures/HISTORY | 14 ++++++++++ PLUGINS/src/pictures/entry.c | 4 +-- PLUGINS/src/pictures/pic2mpg | 13 ++++++--- PLUGINS/src/pictures/pictures.c | 4 +-- PLUGINS/src/pictures/player.c | 6 ++--- PLUGINS/src/pictures/po/fr_FR.po | 32 ++++++++++++++++++++++ PLUGINS/src/pictures/po/it_IT.po | 32 ++++++++++++++++++++++ PLUGINS/src/skincurses/HISTORY | 5 ++++ PLUGINS/src/skincurses/po/it_IT.po | 28 ++++++++++++++++++++ PLUGINS/src/skincurses/skincurses.c | 53 ++++++++++++++++++++++--------------- PLUGINS/src/status/HISTORY | 4 +++ PLUGINS/src/status/status.c | 34 ++++++++++++++++++++++-- 13 files changed, 205 insertions(+), 46 deletions(-) create mode 100644 PLUGINS/src/pictures/po/fr_FR.po create mode 100755 PLUGINS/src/pictures/po/it_IT.po create mode 100755 PLUGINS/src/skincurses/po/it_IT.po (limited to 'PLUGINS/src') diff --git a/PLUGINS/src/hello/po/it_IT.po b/PLUGINS/src/hello/po/it_IT.po index f3f0509..c6fbdb1 100644 --- a/PLUGINS/src/hello/po/it_IT.po +++ b/PLUGINS/src/hello/po/it_IT.po @@ -1,36 +1,34 @@ # VDR plugin language source file. # Copyright (C) 2007 Klaus Schmidinger # This file is distributed under the same license as the VDR package. -# Alberto Carraro , 2001 -# Antonio Ospite , 2003 -# Sean Carlos , 2005 +# Diego Pierotto , 2008 # msgid "" msgstr "" "Project-Id-Version: VDR 1.5.7\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2007-10-13 11:52+0200\n" -"PO-Revision-Date: 2007-08-11 12:34+0200\n" -"Last-Translator: Sean Carlos \n" -"Language-Team: \n" +"PO-Revision-Date: 2008-01-27 20:11+0100\n" +"Last-Translator: Diego Pierotto \n" +"Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-15\n" "Content-Transfer-Encoding: 8bit\n" msgid "A friendly greeting" -msgstr "" +msgstr "Un saluto cordiale" msgid "Hello" -msgstr "" +msgstr "Ciao" msgid "Greeting time (s)" -msgstr "" +msgstr "Tempo saluto (s)" msgid "Use alternate greeting" -msgstr "" +msgstr "Utilizza saluto alternativo" msgid "Howdy folks!" -msgstr "" +msgstr "Come state gente!" msgid "Hello world!" -msgstr "" +msgstr "Ciao mondo!" diff --git a/PLUGINS/src/pictures/HISTORY b/PLUGINS/src/pictures/HISTORY index 462c02f..174fd30 100644 --- a/PLUGINS/src/pictures/HISTORY +++ b/PLUGINS/src/pictures/HISTORY @@ -10,3 +10,17 @@ VDR Plugin 'pictures' Revision History - Fixed the Play function (when used from a directory in the pictures menu it always started with the next directory). - Added Finnish texts (thanks to Rolf Ahrenberg ). + +2008-01-27: Version 0.0.3 + +- Added French texts (thanks to Patrice Staudt ). + +2008-02-02: Version 0.0.4 + +- Added option -i to pic2mpg to ignore unknown file types. + +2008-02-17: Version 0.0.5 + +- Fixed setting the OSD area. +- Introduced 'operator const void * ()' in cString to catch cases where operator*() + should be used. diff --git a/PLUGINS/src/pictures/entry.c b/PLUGINS/src/pictures/entry.c index e03858c..427585e 100644 --- a/PLUGINS/src/pictures/entry.c +++ b/PLUGINS/src/pictures/entry.c @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: entry.c 1.2 2008/01/18 15:49:51 kls Exp $ + * $Id: entry.c 1.3 2008/02/17 13:42:34 kls Exp $ */ #include "entry.h" @@ -37,7 +37,7 @@ int cPictureEntry::Compare(const cListObject &ListObject) const cString cPictureEntry::Path(void) const { - return parent ? AddDirectory(parent->Path(), name) : name; + return parent ? *AddDirectory(parent->Path(), name) : name; } void cPictureEntry::Load(void) const diff --git a/PLUGINS/src/pictures/pic2mpg b/PLUGINS/src/pictures/pic2mpg index 5791685..6cd7435 100755 --- a/PLUGINS/src/pictures/pic2mpg +++ b/PLUGINS/src/pictures/pic2mpg @@ -7,7 +7,7 @@ # # See the README file for copyright information and how to reach the author. # -# $Id: pic2mpg 1.1 2008/01/13 11:09:12 kls Exp $ +# $Id: pic2mpg 1.2 2008/02/02 11:34:43 kls Exp $ ## TODO implement HDTV (1920 x 1080) @@ -20,20 +20,22 @@ Usage: $0 [options] picture-dir mpeg-dir $0 [options] picture-file mpeg-file Options: -a Aspect ratio 4:3 (default is 16:9) - -h print Help -f Force conversion + -h print Help + -i Ignore unknown file types -n NTSC (default is PAL) -v num Verbose (0=none, 1=list files, 2=detailed) -x percent X overscan in percent -y percent Y overscan in percent }; -getopts("ahfnv:x:y:") || die $Usage; +getopts("afhinv:x:y:") || die $Usage; die $Usage if $opt_h; $Aspect = $opt_a; $Force = $opt_f; +$Ignore = $opt_i; $NTSC = $opt_n; $Verbose = $opt_v; $OverscanX = $opt_x; @@ -142,7 +144,10 @@ sub ConvertFile { my ($Pict, $Mpeg) = @_; (my $Type) = $Pict =~ /\.([^\.]*)$/; - die "unknown file type '$Type': '$Pict'\n" unless defined $PNMCONV{$Type}; + if (!defined $PNMCONV{$Type}) { + return if ($Ignore); + die "unknown file type '$Type': '$Pict'\n"; + } my ($w, $h) = imgsize($Pict); print "image size is $w x $h\n" if ($Detailed); if ($w / $h <= $ScreenRatio) { diff --git a/PLUGINS/src/pictures/pictures.c b/PLUGINS/src/pictures/pictures.c index e3015e4..6e64c4e 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 1.2 2008/01/19 11:20:03 kls Exp $ + * $Id: pictures.c 1.5 2008/02/09 12:15:52 kls Exp $ */ #include @@ -11,7 +11,7 @@ #include "menu.h" #include "player.h" -static const char *VERSION = "0.0.2"; +static const char *VERSION = "0.0.5"; 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 b942be5..8981b60 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 1.2 2008/01/19 11:01:58 kls Exp $ + * $Id: player.c 1.3 2008/02/09 12:13:10 kls Exp $ */ #include "player.h" @@ -173,11 +173,11 @@ void cPictureControl::DisplayCaption(void) int h = 2 * Font->Height(); if (!osd) { osd = cOsdProvider::NewOsd(cOsd::OsdLeft(), cOsd::OsdTop() + cOsd::OsdHeight() - h, OSD_LEVEL_SUBTITLES); - tArea Areas[] = { { 0, 0, w, h, 8 } }; + tArea Areas[] = { { 0, 0, w - 1, h - 1, 8 } }; if (Setup.AntiAlias && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk) osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); else { - tArea Areas[] = { { 0, 0, w, h, 4 } }; + tArea Areas[] = { { 0, 0, w - 1, h - 1, 4 } }; osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); } } diff --git a/PLUGINS/src/pictures/po/fr_FR.po b/PLUGINS/src/pictures/po/fr_FR.po new file mode 100644 index 0000000..54933aa --- /dev/null +++ b/PLUGINS/src/pictures/po/fr_FR.po @@ -0,0 +1,32 @@ +# VDR plugin language source file. +# Copyright (C) 2008 Klaus Schmidinger +# This file is distributed under the same license as the VDR package. +# Patrice Staudt , 2008." +# +msgid "" +msgstr "" +"Project-Id-Version: pictures 0.0.1\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2008-01-12 17:38+0100\n" +"PO-Revision-Date: 2008-01-12 17:41+0100\n" +"Last-Translator: Patrice Staudt \n" +"Language-Team: France\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-15\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "Pictures" +msgstr "Images" + +msgid "A simple picture viewer" +msgstr "Un simple visualiseur d'images" + +msgid "Picture directory" +msgstr "Dossier des images" + +msgid "Slide show delay (s)" +msgstr "Pause entre deux images (s)" + +msgid "No picture directory has been defined!" +msgstr "Aucun dossier n'est définit!" diff --git a/PLUGINS/src/pictures/po/it_IT.po b/PLUGINS/src/pictures/po/it_IT.po new file mode 100755 index 0000000..d16fc4c --- /dev/null +++ b/PLUGINS/src/pictures/po/it_IT.po @@ -0,0 +1,32 @@ +# VDR plugin language source file. +# Copyright (C) 2008 Klaus Schmidinger +# This file is distributed under the same license as the VDR package. +# Diego Pierotto , 2008 +# +msgid "" +msgstr "" +"Project-Id-Version: pictures 0.0.1\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2008-01-12 17:38+0100\n" +"PO-Revision-Date: 2008-01-27 20:22+0100\n" +"Last-Translator: Diego Pierotto \n" +"Language-Team: Italian\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-15\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "Pictures" +msgstr "Immagini" + +msgid "A simple picture viewer" +msgstr "Un semplice visualizzatore immagini" + +msgid "Picture directory" +msgstr "Directory immagini" + +msgid "Slide show delay (s)" +msgstr "Ritardo diapositive (s)" + +msgid "No picture directory has been defined!" +msgstr "Nessuna directory immagini impostata!" diff --git a/PLUGINS/src/skincurses/HISTORY b/PLUGINS/src/skincurses/HISTORY index e5bfa49..45b79bb 100644 --- a/PLUGINS/src/skincurses/HISTORY +++ b/PLUGINS/src/skincurses/HISTORY @@ -65,3 +65,8 @@ VDR Plugin 'skincurses' Revision History 2008-01-19: - Updated the Makefile of the skincurses plugin (thanks to Rolf Ahrenberg). + +2008-02-15: Version 0.1.5 + +- Using cString::sprintf() instead of asprintf(). +- Implemented cSkinCursesDisplayMenu::SetScrollbar(). diff --git a/PLUGINS/src/skincurses/po/it_IT.po b/PLUGINS/src/skincurses/po/it_IT.po new file mode 100755 index 0000000..8dc4556 --- /dev/null +++ b/PLUGINS/src/skincurses/po/it_IT.po @@ -0,0 +1,28 @@ +# VDR plugin language source file. +# Copyright (C) 2007 Klaus Schmidinger +# This file is distributed under the same license as the VDR package. +# Diego Pierotto , 2008 +# +msgid "" +msgstr "" +"Project-Id-Version: VDR 1.5.7\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-08-15 16:04+0200\n" +"PO-Revision-Date: 2008-01-27 20:35+0100\n" +"Last-Translator: Diego Pierotto \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-15\n" +"Content-Transfer-Encoding: 8bit\n" + +msgid "A text only skin" +msgstr "Una interfaccia solo testo" + +msgid "Key$Mute" +msgstr "Muto" + +msgid "Volume " +msgstr "Volume " + +msgid "Text mode" +msgstr "Modalità testo" diff --git a/PLUGINS/src/skincurses/skincurses.c b/PLUGINS/src/skincurses/skincurses.c index b9a4fc0..2f0bea9 100644 --- a/PLUGINS/src/skincurses/skincurses.c +++ b/PLUGINS/src/skincurses/skincurses.c @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: skincurses.c 1.18 2007/08/26 20:16:59 kls Exp $ + * $Id: skincurses.c 1.20 2008/02/17 14:28:19 kls Exp $ */ #include @@ -11,7 +11,7 @@ #include #include -static const char *VERSION = "0.1.4"; +static const char *VERSION = "0.1.5"; static const char *DESCRIPTION = trNOOP("A text only skin"); static const char *MAINMENUENTRY = NULL; @@ -166,7 +166,7 @@ void cCursesOsd::DrawText(int x, int y, const char *s, tColor ColorFg, tColor Co } SetColor(ColorFg, ColorBg); wmove(window, y, x); // ncurses wants 'y' before 'x'! - waddnstr(window, s, ScOsdWidth - x); + waddnstr(window, s, Width ? Width : ScOsdWidth - x); } void cCursesOsd::DrawRectangle(int x1, int y1, int x2, int y2, tColor Color) @@ -261,7 +261,8 @@ void cSkinCursesDisplayChannel::Flush(void) class cSkinCursesDisplayMenu : public cSkinDisplayMenu { private: cOsd *osd; - void SetScrollbar(void); + void DrawScrollbar(int Total, int Offset, int Shown, int Top, int Height, bool CanScrollUp, bool CanScrollDown); + void SetTextScrollbar(void); public: cSkinCursesDisplayMenu(void); virtual ~cSkinCursesDisplayMenu(); @@ -272,6 +273,7 @@ public: virtual void SetButtons(const char *Red, const char *Green = NULL, const char *Yellow = NULL, const char *Blue = NULL); virtual void SetMessage(eMessageType Type, const char *Text); virtual void SetItem(const char *Text, int Index, bool Current, bool Selectable); + virtual void SetScrollbar(int Total, int Offset); virtual void SetEvent(const cEvent *Event); virtual void SetRecording(const cRecording *Recording); virtual void SetText(const char *Text, bool FixedFont); @@ -290,25 +292,31 @@ cSkinCursesDisplayMenu::~cSkinCursesDisplayMenu() delete osd; } -void cSkinCursesDisplayMenu::SetScrollbar(void) +void cSkinCursesDisplayMenu::DrawScrollbar(int Total, int Offset, int Shown, int Top, int Height, bool CanScrollUp, bool CanScrollDown) { - if (textScroller.CanScroll()) { - int yt = textScroller.Top(); - int yb = yt + textScroller.Height() - 1; + if (Total > 0 && Total > Shown) { + int yt = Top; + int yb = yt + Height - 1; int st = yt; int sb = yb; - int tt = st + (sb - st) * textScroller.Offset() / textScroller.Total(); - int tb = tt + (sb - st) * textScroller.Shown() / textScroller.Total(); + int tt = st + (sb - st + 1) * Offset / Total; + int tb = tt + (sb - st + 1) * Shown / Total; int xl = ScOsdWidth - 1; - osd->DrawRectangle(xl, st, xl, sb, clrCyan); - osd->DrawRectangle(xl, tt, xl, tb, clrWhite); + osd->DrawRectangle(xl, st, xl, sb, clrWhite); + osd->DrawRectangle(xl, tt, xl, tb, clrCyan); } } +void cSkinCursesDisplayMenu::SetTextScrollbar(void) +{ + if (textScroller.CanScroll()) + DrawScrollbar(textScroller.Total(), textScroller.Offset(), textScroller.Shown(), textScroller.Top(), textScroller.Height(), textScroller.CanScrollUp(), textScroller.CanScrollDown()); +} + void cSkinCursesDisplayMenu::Scroll(bool Up, bool Page) { cSkinDisplayMenu::Scroll(Up, Page); - SetScrollbar(); + SetTextScrollbar(); } int cSkinCursesDisplayMenu::MaxItems(void) @@ -366,12 +374,17 @@ void cSkinCursesDisplayMenu::SetItem(const char *Text, int Index, bool Current, const char *s = GetTabbedText(Text, i); if (s) { int xt = Tab(i) / 12;// Tab() is in "pixel" - see also skins.c!!! - osd->DrawText(xt, y, s, ColorFg, ColorBg, &Font, ScOsdWidth - xt); + osd->DrawText(xt, y, s, ColorFg, ColorBg, &Font, ScOsdWidth - 2 - xt); } if (!Tab(i + 1)) break; } - SetEditableWidth(ScOsdWidth - Tab(1) / 12); // Tab() is in "pixel" - see also skins.c!!! + SetEditableWidth(ScOsdWidth - 2 - Tab(1) / 12); // Tab() is in "pixel" - see also skins.c!!! +} + +void cSkinCursesDisplayMenu::SetScrollbar(int Total, int Offset) +{ + DrawScrollbar(Total, Offset, MaxItems(), 2, MaxItems(), Offset > 0, Offset + MaxItems() < Total); } void cSkinCursesDisplayMenu::SetEvent(const cEvent *Event) @@ -384,10 +397,8 @@ void cSkinCursesDisplayMenu::SetEvent(const cEvent *Event) snprintf(t, sizeof(t), "%s %s - %s", *Event->GetDateString(), *Event->GetTimeString(), *Event->GetEndTimeString()); ts.Set(osd, 0, y, ScOsdWidth, ScOsdHeight - y - 2, t, &Font, clrYellow, clrBackground); if (Event->Vps() && Event->Vps() != Event->StartTime()) { - char *buffer; - asprintf(&buffer, " VPS: %s", *Event->GetVpsString()); + cString buffer = cString::sprintf(" VPS: %s", *Event->GetVpsString()); osd->DrawText(ScOsdWidth - Utf8StrLen(buffer), y, buffer, clrBlack, clrYellow, &Font); - free(buffer); } y += ts.Height(); y += 1; @@ -400,7 +411,7 @@ void cSkinCursesDisplayMenu::SetEvent(const cEvent *Event) y += 1; if (!isempty(Event->Description())) { textScroller.Set(osd, 0, y, ScOsdWidth - 2, ScOsdHeight - y - 2, Event->Description(), &Font, clrCyan, clrBackground); - SetScrollbar(); + SetTextScrollbar(); } } @@ -428,14 +439,14 @@ void cSkinCursesDisplayMenu::SetRecording(const cRecording *Recording) y += 1; if (!isempty(Info->Description())) { textScroller.Set(osd, 0, y, ScOsdWidth - 2, ScOsdHeight - y - 2, Info->Description(), &Font, clrCyan, clrBackground); - SetScrollbar(); + SetTextScrollbar(); } } void cSkinCursesDisplayMenu::SetText(const char *Text, bool FixedFont) { textScroller.Set(osd, 0, 2, ScOsdWidth - 2, ScOsdHeight - 4, Text, &Font, clrWhite, clrBackground); - SetScrollbar(); + SetTextScrollbar(); } void cSkinCursesDisplayMenu::Flush(void) diff --git a/PLUGINS/src/status/HISTORY b/PLUGINS/src/status/HISTORY index 97bc7e2..f652068 100644 --- a/PLUGINS/src/status/HISTORY +++ b/PLUGINS/src/status/HISTORY @@ -40,3 +40,7 @@ VDR Plugin 'status' Revision History - Moved the "all" target in the Makefile before the "Implicit rules", so that a plain "make" will compile everything. + +2008-02-16: Version 0.3.0 + +- Added new cStatus functions. diff --git a/PLUGINS/src/status/status.c b/PLUGINS/src/status/status.c index fa5f0d4..3959871 100644 --- a/PLUGINS/src/status/status.c +++ b/PLUGINS/src/status/status.c @@ -3,13 +3,13 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: status.c 1.9 2007/08/15 13:19:44 kls Exp $ + * $Id: status.c 1.10 2008/02/16 15:41:05 kls Exp $ */ #include #include -static const char *VERSION = "0.2.1"; +static const char *VERSION = "0.3.0"; static const char *DESCRIPTION = "Status monitor test"; static const char *MAINMENUENTRY = NULL; @@ -17,20 +17,30 @@ static const char *MAINMENUENTRY = NULL; class cStatusTest : public cStatus { protected: + virtual void TimerChange(const cTimer *Timer, eTimerChange Change); virtual void ChannelSwitch(const cDevice *Device, int ChannelNumber); virtual void Recording(const cDevice *Device, const char *Name, const char *FileName, bool On); virtual void Replaying(const cControl *Control, const char *Name, const char *FileName, bool On); virtual void SetVolume(int Volume, bool Absolute); + virtual void SetAudioTrack(int Index, const char * const *Tracks); + virtual void SetAudioChannel(int AudioChannel); + virtual void SetSubtitleTrack(int Index, const char * const *Tracks); virtual void OsdClear(void); virtual void OsdTitle(const char *Title); virtual void OsdStatusMessage(const char *Message); virtual void OsdHelpKeys(const char *Red, const char *Green, const char *Yellow, const char *Blue); + virtual void OsdItem(const char *Text, int Index); virtual void OsdCurrentItem(const char *Text); virtual void OsdTextItem(const char *Text, bool Scroll); virtual void OsdChannel(const char *Text); virtual void OsdProgramme(time_t PresentTime, const char *PresentTitle, const char *PresentSubtitle, time_t FollowingTime, const char *FollowingTitle, const char *FollowingSubtitle); }; +void cStatusTest::TimerChange(const cTimer *Timer, eTimerChange Change) +{ + dsyslog("status: cStatusTest::TimerChange %s %d", Timer ? *Timer->ToText(true) : "-", Change); +} + void cStatusTest::ChannelSwitch(const cDevice *Device, int ChannelNumber) { dsyslog("status: cStatusTest::ChannelSwitch %d %d", Device->CardIndex(), ChannelNumber); @@ -51,6 +61,21 @@ void cStatusTest::SetVolume(int Volume, bool Absolute) dsyslog("status: cStatusTest::SetVolume %d %d", Volume, Absolute); } +void cStatusTest::SetAudioTrack(int Index, const char * const *Tracks) +{ + dsyslog("status: cStatusTest::SetAudioTrack %d %s", Index, Tracks[Index]); +} + +void cStatusTest::SetAudioChannel(int AudioChannel) +{ + dsyslog("status: cStatusTest::SetAudioChannel %d", AudioChannel); +} + +void cStatusTest::SetSubtitleTrack(int Index, const char * const *Tracks) +{ + dsyslog("status: cStatusTest::SetSubtitleTrack %d %s", Index, Tracks[Index]); +} + void cStatusTest::OsdClear(void) { dsyslog("status: cStatusTest::OsdClear"); @@ -71,6 +96,11 @@ void cStatusTest::OsdHelpKeys(const char *Red, const char *Green, const char *Ye dsyslog("status: cStatusTest::OsdHelpKeys %s - %s - %s - %s", Red, Green, Yellow, Blue); } +void cStatusTest::OsdItem(const char *Text, int Index) +{ + //dsyslog("status: cStatusTest::OsdItem %s %d", Text, Index); +} + void cStatusTest::OsdCurrentItem(const char *Text) { dsyslog("status: cStatusTest::OsdCurrentItem %s", Text); -- cgit v1.2.3