diff options
author | Andreas Brachold <vdr07@deltab.de> | 2005-07-28 15:41:43 +0000 |
---|---|---|
committer | Andreas Brachold <vdr07@deltab.de> | 2005-07-28 15:41:43 +0000 |
commit | 8c5bda0e344a1389cad91eef9f7e00b069ffa933 (patch) | |
tree | 305b438e155a7d69697e099a2ddbbea4b87d9eeb | |
parent | 57ff8fb8eb79adfebfaf43c884eac70e3ffb2b2c (diff) | |
download | vdr-plugin-image-8c5bda0e344a1389cad91eef9f7e00b069ffa933.tar.gz vdr-plugin-image-8c5bda0e344a1389cad91eef9f7e00b069ffa933.tar.bz2 |
- add option for border of underscan
- rename setup variables to hungarian notation
-rw-r--r-- | HISTORY | 9 | ||||
-rw-r--r-- | TODO | 2 | ||||
-rw-r--r-- | control-image.c | 16 | ||||
-rw-r--r-- | data-image.c | 15 | ||||
-rw-r--r-- | i18n.c | 38 | ||||
-rw-r--r-- | liboutput/encode.h | 6 | ||||
-rw-r--r-- | list.c | 6 | ||||
-rw-r--r-- | player-image.c | 6 | ||||
-rw-r--r-- | setup-image.c | 125 | ||||
-rw-r--r-- | setup-image.h | 38 |
10 files changed, 189 insertions, 72 deletions
@@ -1,8 +1,11 @@ VDR Plugin 'image' Revision History ----------------------------------- +2005-07-27 +- add option for border of underscan + 2005-07-26 -- rotate pictures now in several 90° steps +- rotate pictures now in several 90° steps 2005-07-18 - add alternative script (scripts/maverickplugin.sh) for image converting with imagemagick @@ -18,8 +21,8 @@ VDR Plugin 'image' Revision History - plugin: add reload image after commands execution, if image changed 2004-12-06 -- Fix missing environ variable for examples/imagecmds.conf (Reported by Thomas Günther) -- Fix wrong folder flags on distribute archives (Reported by Thomas Günther) +- Fix missing environ variable for examples/imagecmds.conf (Reported by Thomas Günther) +- Fix wrong folder flags on distribute archives (Reported by Thomas Günther) 2004-12-05 - Use now threadsafe functions replacement of strerror @@ -5,3 +5,5 @@ Exif automated rotation Change BLUE/EXIT > Stop to BLUE > Stop / EXIT > reshow Browser reload Image after commands execution, if image changed + +Add dejitter / horizontal 1px blur diff --git a/control-image.c b/control-image.c index ac707c9..fa7925c 100644 --- a/control-image.c +++ b/control-image.c @@ -99,7 +99,7 @@ cImageControl::cImageControl(cSlideShow * pNewSlideShow) m_eOSDStatusVisable = Setup.ShowReplayMode?eDisplayModeOnly:eDisplayNothing; m_ePlayMode = ePlayModeNormal; - m_bSlideShowActiv = ImageSetup.SlideShow; + m_bSlideShowActiv = ImageSetup.m_bSlideShow; m_bSlideShowBefore = false; // Support for Zoom @@ -443,13 +443,13 @@ void cImageControl::ShowProgress(void) { int t = time(NULL) - m_tStarted + 1; snprintf(szSlideShowInfo, sizeof(szSlideShowInfo), " | %d/%d", - t, ImageSetup.SSsec); + t, ImageSetup.m_nSSsec); } snprintf(sz,nMaxCharacter, "(%3d/%3d)%s", ImageCurrent(), ImageTotal(), szSlideShowInfo); Interface->Write(0, 2, sz); - if(ImageSetup.ShowDate && !IsConvertRunning()) + if(ImageSetup.m_bShowDate && !IsConvertRunning()) { struct stat stFile; if(0 != stat(szFileName, &stFile)) { @@ -1123,7 +1123,7 @@ void cImageControl::SlideImage() { if(m_bSlideShowActiv && !IsConvertRunning()) { - if(ImageSetup.SSsec <= + if(ImageSetup.m_nSSsec <= (time(NULL) - m_tStarted)) { NextImage(1); @@ -1139,14 +1139,14 @@ void cImageControl::Stop(void) void cImageControl::IncSlideTime(void) { - if(ImageSetup.SSsec < cImageSetup::m_cSSMax) { - ImageSetup.SSsec++; + if(ImageSetup.m_nSSsec < cImageSetup::m_cSSMax) { + ImageSetup.m_nSSsec++; } } void cImageControl::DecSlideTime(void) { - if(ImageSetup.SSsec > cImageSetup::m_cSSMin) { - ImageSetup.SSsec--; + if(ImageSetup.m_nSSsec > cImageSetup::m_cSSMin) { + ImageSetup.m_nSSsec--; } } diff --git a/data-image.c b/data-image.c index f99ec76..3c54f3c 100644 --- a/data-image.c +++ b/data-image.c @@ -1,7 +1,8 @@ /* * Image plugin to VDR (C++) * - * (C) 2003 Kai Tobias Burwieck <kai@burwieck.net> + * (C) 2004-2005 Andreas Brachold <vdr04 -at- deltab.de> + * based on (C) 2003 Kai Tobias Burwieck <kai -at- burwieck.net> * * This code is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -57,7 +58,7 @@ const char *cImage::NameIndex() if(ImageSetup.m_bHousekeeping) { char sz[PATH_MAX]; - strncpy(sz,ImageSetup.TempDir,sizeof(sz)); + strncpy(sz,ImageSetup.m_szTempDir,sizeof(sz)); strncat(sz,"/IXXXXXX",sizeof(sz)); mktemp(sz); strncat(sz,".pnm",sizeof(sz)); @@ -66,7 +67,7 @@ const char *cImage::NameIndex() else { asprintf(&m_szFileNameIndex, "%s%sI%s.pnm", - ImageSetup.TempDir, + ImageSetup.m_szTempDir, *m_szFileName == '/'?"":"/", m_szFileName); } @@ -81,7 +82,7 @@ const char *cImage::NamePNM() if(ImageSetup.m_bHousekeeping) { char sz[PATH_MAX]; - strncpy(sz,ImageSetup.TempDir,sizeof(sz)); + strncpy(sz,ImageSetup.m_szTempDir,sizeof(sz)); strncat(sz,"/VXXXXXX",sizeof(sz)); mktemp(sz); strncat(sz,".pnm",sizeof(sz)); @@ -90,7 +91,7 @@ const char *cImage::NamePNM() else { asprintf(&m_szFileNamePNM, "%s%s%s.pnm", - ImageSetup.TempDir, + ImageSetup.m_szTempDir, *m_szFileName == '/'?"":"/", m_szFileName); } @@ -105,7 +106,7 @@ const char *cImage::NameZoom() if(ImageSetup.m_bHousekeeping) { char sz[PATH_MAX]; - strncpy(sz,ImageSetup.TempDir,sizeof(sz)); + strncpy(sz,ImageSetup.m_szTempDir,sizeof(sz)); strncat(sz,"/ZXXXXXX",sizeof(sz)); mktemp(sz); strncat(sz,".pnm",sizeof(sz)); @@ -114,7 +115,7 @@ const char *cImage::NameZoom() else { asprintf(&m_szFileNameZoom, "%s%sZ%s.pnm", - ImageSetup.TempDir, + ImageSetup.m_szTempDir, *m_szFileName == '/'?"":"/", m_szFileName); } @@ -1,8 +1,8 @@ /* * Image plugin to VDR (C++) * - * (C) 2004 Andreas Brachold <vdr04-at-deltab.de> - * (C) 2003 Kai Tobias Burwieck <kai@burwieck.net> + * (C) 2004-2005 Andreas Brachold <vdr04-at-deltab.de> + * based on (C) 2003 Kai Tobias Burwieck <kai-at-burwieck.net> * * This code is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -621,5 +621,39 @@ const tI18nPhrase Phrases[] = { "", // TODO /*Magyar*/ "", // TODO /*Català*/ }, + { "Border for Underscan (Height)", /*English*/ + "Rand für Underscan (Höhe)", /*Deutsch*/ + "", // TODO /*Slovenski*/ + "", // TODO /*Italiano*/ + "", // TODO /*Nederlands* + "", // TODO /*Português*/ + "", // TODO /*Français*/ + "", // TODO /*Norsk*/ + "", // TODO /*suomi*/ + "", // TODO /*Polski*/ + "", // TODO /*Español*/ + "", // TODO /*Ellinika*/ + "", // TODO /*Svenska*/ + "", // TODO /*Romaneste*/ + "", // TODO /*Magyar*/ + "", // TODO /*Català*/ + }, + { "Border for Underscan (Width)", /*English*/ + "Rand für Underscan (Breite)", /*Deutsch*/ + "", // TODO /*Slovenski*/ + "", // TODO /*Italiano*/ + "", // TODO /*Nederlands* + "", // TODO /*Português*/ + "", // TODO /*Français*/ + "", // TODO /*Norsk*/ + "", // TODO /*suomi*/ + "", // TODO /*Polski*/ + "", // TODO /*Español*/ + "", // TODO /*Ellinika*/ + "", // TODO /*Svenska*/ + "", // TODO /*Romaneste*/ + "", // TODO /*Magyar*/ + "", // TODO /*Català*/ + }, { NULL } }; diff --git a/liboutput/encode.h b/liboutput/encode.h index 15dd28d..f19a4c4 100644 --- a/liboutput/encode.h +++ b/liboutput/encode.h @@ -26,7 +26,7 @@ #define _ENCODE_H #include <ffmpeg/avcodec.h> - +#include "../setup-image.h" //#define TESTCODE class cEncode @@ -66,8 +66,8 @@ public: inline unsigned int GetHeight() const { return m_nHeight; } inline unsigned int GetWidth() const { return m_nWidth; } - inline unsigned int GetBorderHeight() const { return 16; } - inline unsigned int GetBorderWidth() const { return 16; } + inline unsigned int GetBorderHeight() const { return ImageSetup.m_nBorderHeight; } + inline unsigned int GetBorderWidth() const { return ImageSetup.m_nBorderWidth; } inline uint8_t *GetRGBMem() { return m_pImageRGB; } void ClearRGBMem (); @@ -1,7 +1,7 @@ /* * Image plugin to VDR (C++) * - * (C) 2004 A. Brachold <vdr04-at-deltab.de> + * (C) 2004-2005 A. Brachold <vdr04-at-deltab.de> * * This code is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -129,7 +129,7 @@ bool cActivSlideShow::NextImage(int nOffset) } return m_pCurImage != NULL; } - else if(ImageSetup.AutoRepeat) { + else if(ImageSetup.m_bAutoRepeat) { cImage *pNewActiv; pNewActiv = m_pCurSlideShow->cList < cImage >::First(); @@ -155,7 +155,7 @@ bool cActivSlideShow::PrevImage(int nOffset) } return m_pCurImage != NULL; } - else if(ImageSetup.AutoRepeat) { + else if(ImageSetup.m_bAutoRepeat) { cImage *pNewActiv; pNewActiv = m_pCurSlideShow->cList < cImage >::Last(); diff --git a/player-image.c b/player-image.c index f8818f8..6ab4bb5 100644 --- a/player-image.c +++ b/player-image.c @@ -1,8 +1,8 @@ /* * Image plugin to VDR (C++) * - * (C) 2004 Andreas Brachold <vdr04-at-deltab.de> - * 2003 Kai Tobias Burwieck <kai@burwieck.net> + * (C) 2004-2005 Andreas Brachold <vdr04-at-deltab.de> + * based on (C) 2003 Kai Tobias Burwieck <kai-at-burwieck.net> * * This code is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -312,7 +312,7 @@ void cImagePlayer::LoadImage(cShellWrapper* pShell) pnmImage.freerow((char*)pRow); else { - if(pShell->szNumber && ImageSetup.ShowNumbers) + if(pShell->szNumber && ImageSetup.m_bShowNumbers) cXPM::Overlay(pShell->szNumber,m_StillImage.GetRGBMem(), m_StillImage.GetWidth(),m_StillImage.GetHeight(), cXPM::TopRight,nOffLeft,nOffTop,pnmImage.GetWidth(),pnmImage.GetHeight()); diff --git a/setup-image.c b/setup-image.c index 8cf05d0..4f523b1 100644 --- a/setup-image.c +++ b/setup-image.c @@ -1,8 +1,8 @@ /* * Image plugin to VDR (C++) * - * (C) 2004 Andreas Brachold <vdr04-at-deltab.de> - * (C) 2003 Kai Tobias Burwieck <kai-at-burwieck.net> + * (C) 2004-2005 Andreas Brachold <vdr04-at-deltab.de> + * based on (C) 2003 Kai Tobias Burwieck <kai-at-burwieck.net> * * based on MP3/MPlayer plugin to VDR (C++) * (C) 2001,2002 Stefan Huelswitt <huels-at-iname.com> @@ -37,44 +37,62 @@ cImageSetup ImageSetup; const int cImageSetup::m_cSSMin = 2; const int cImageSetup::m_cSSMax = 300; + +const int cImageSetup::m_cnMinBorderHeight = 0; +const int cImageSetup::m_cnMaxBorderHeight = 480/2; //(Half NTSC) + +const int cImageSetup::m_cnMinBorderWidth = 0; +const int cImageSetup::m_cnMaxBorderWidth = 720/2; //(Half NTSC/PAL) + // --- cImageSetup ----------------------------------------------------------- cImageSetup::cImageSetup(void) { - SlideShow = 0; - SSsec = 10; - strncpy(TempDir, "/tmp/image", sizeof(TempDir)); + m_bSlideShow = 0; + m_nSSsec = 10; + strncpy(m_szTempDir, "/tmp/image", sizeof(m_szTempDir)); #if VDRVERSNUM < 10307 - ShowDate = 1; + m_bShowDate = 1; #endif - AutoRepeat = 0; - ShowNumbers = 1; + m_bAutoRepeat = 0; + m_bShowNumbers = 1; #if VDRVERSNUM >= 10308 m_bLiveAudio = 0; #endif m_bHousekeeping = 1; + + m_nBorderHeight = 16; + m_nBorderWidth = 16; } +#define ParseInteger(szTitle,nValue,nMin,nMax) \ + if(!strcasecmp(szName, szTitle)) \ + { \ + nValue = atoi(szValue); \ + if(nValue < nMin) nValue = nMin; \ + if(nValue > nMax) nValue = nMax; \ + } + + bool cImageSetup::SetupParse(const char *szName, const char *szValue) { - if(!strcasecmp(szName, "SlideShow")) SlideShow = atoi(szValue); - else if(!strcasecmp(szName, "SSsec")) - { - SSsec = atoi(szValue); - if(SSsec < m_cSSMin) SSsec = cImageSetup::m_cSSMin; - if(SSsec > m_cSSMax) SSsec = cImageSetup::m_cSSMax; - } - else if(!strcasecmp(szName, "TempDir")) strn0cpy(TempDir,szValue,sizeof(TempDir)); + ParseInteger("SlideShow", m_bSlideShow,0,1) + else ParseInteger("SSsec", m_nSSsec,m_cSSMin,m_cSSMax) + else ParseInteger("BorderHeight", m_nBorderHeight,m_cnMinBorderHeight,m_cnMaxBorderHeight) + else ParseInteger("BorderWidth", m_nBorderWidth,m_cnMinBorderWidth,m_cnMaxBorderWidth) #if VDRVERSNUM < 10307 - else if(!strcasecmp(szName, "ShowDate")) ShowDate = atoi(szValue); + else ParseInteger("ShowDate", m_bShowDate,0,1) #endif - else if(!strcasecmp(szName, "AutoRepeat")) AutoRepeat = atoi(szValue); - else if(!strcasecmp(szName, "ShowNumbers")) ShowNumbers = atoi(szValue); + else ParseInteger("AutoRepeat", m_bAutoRepeat,0,1) + else ParseInteger("ShowNumbers", m_bShowNumbers,0,1) #if VDRVERSNUM >= 10308 - else if(!strcasecmp(szName, "LiveAudio")) m_bLiveAudio = atoi(szValue); + else ParseInteger("LiveAudio", m_bLiveAudio,0,1) #endif - else if(!strcasecmp(szName, "Housekeeping")) m_bHousekeeping = atoi(szValue); + else ParseInteger("Housekeeping", m_bHousekeeping,0,1) + else if(!strcasecmp(szName, "TempDir")) { + strn0cpy(m_szTempDir,szValue,sizeof(m_szTempDir)); + } else return false; return true; } @@ -83,36 +101,71 @@ bool cImageSetup::SetupParse(const char *szName, const char *szValue) void cMenuSetupImage::Store(void) { ImageSetup = m_tmpSetup; - SetupStore("SlideShow", ImageSetup.SlideShow); - SetupStore("SSsec", ImageSetup.SSsec); - SetupStore("TempDir", ImageSetup.TempDir); + SetupStore("SlideShow", ImageSetup.m_bSlideShow); + SetupStore("SSsec", ImageSetup.m_nSSsec); + SetupStore("TempDir", ImageSetup.m_szTempDir); #if VDRVERSNUM < 10307 - SetupStore("ShowDate", ImageSetup.ShowDate); + SetupStore("ShowDate", ImageSetup.m_bShowDate); #endif - SetupStore("AutoRepeat", ImageSetup.AutoRepeat); - SetupStore("ShowNumbers", ImageSetup.ShowNumbers); + SetupStore("AutoRepeat", ImageSetup.m_bAutoRepeat); + SetupStore("ShowNumbers", ImageSetup.m_bShowNumbers); #if VDRVERSNUM >= 10308 SetupStore("LiveAudio", ImageSetup.m_bLiveAudio); #endif SetupStore("Housekeeping", ImageSetup.m_bHousekeeping); + SetupStore("BorderHeight", ImageSetup.m_nBorderHeight); + SetupStore("BorderWidth", ImageSetup.m_nBorderWidth); } cMenuSetupImage::cMenuSetupImage(void) : m_tmpSetup(ImageSetup) { SetSection(tr("Image")); - Add(new cMenuEditBoolItem(tr("SlideShow ?"), &m_tmpSetup.SlideShow, tr("no"), tr("yes"))); - Add(new cMenuEditIntItem (tr("Slide duration (sec)"), &m_tmpSetup.SSsec, cImageSetup::m_cSSMin, cImageSetup::m_cSSMax)); - Add(new cMenuEditBoolItem(tr("Repeat SlideShow"), &m_tmpSetup.AutoRepeat, tr("no"), tr("yes"))); + + Add(new cMenuEditBoolItem(tr("SlideShow ?"), + &m_tmpSetup.m_bSlideShow, + tr("no"), tr("yes"))); + + Add(new cMenuEditIntItem (tr("Slide duration (sec)"), + &m_tmpSetup.m_nSSsec, + cImageSetup::m_cSSMin, cImageSetup::m_cSSMax)); + + Add(new cMenuEditBoolItem(tr("Repeat SlideShow"), + &m_tmpSetup.m_bAutoRepeat, + tr("no"), tr("yes"))); + #if VDRVERSNUM < 10307 - Add(new cMenuEditBoolItem(tr("Show Filedate on OSD"), &m_tmpSetup.ShowDate, tr("no"), tr("yes"))); + Add(new cMenuEditBoolItem(tr("Show Filedate on OSD"), + &m_tmpSetup.m_bShowDate, + tr("no"), tr("yes"))); #endif - Add(new cMenuEditBoolItem(tr("Show Numbers on index image"), &m_tmpSetup.ShowNumbers, tr("no"), tr("yes"))); + + Add(new cMenuEditBoolItem(tr("Show Numbers on index image"), + &m_tmpSetup.m_bShowNumbers, + tr("no"), tr("yes"))); + #if VDRVERSNUM >= 10308 - Add(new cMenuEditBoolItem(tr("Live Audio from primary Device"), &m_tmpSetup.m_bLiveAudio, tr("no"), tr("yes"))); + Add(new cMenuEditBoolItem(tr("Live Audio from primary Device"), + &m_tmpSetup.m_bLiveAudio, + tr("no"), tr("yes"))); #endif - Add(new cMenuEditStrItem (tr("Directory with temporary files"), m_tmpSetup.TempDir,sizeof(m_tmpSetup.TempDir), "abcdefghijklmopqrstuvwxyz/-")); - Add(new cMenuEditBoolItem(tr("Remove temporary files"), &m_tmpSetup.m_bHousekeeping, tr("no"), tr("yes"))); + + Add(new cMenuEditStrItem (tr("Directory with temporary files"), + m_tmpSetup.m_szTempDir,sizeof(m_tmpSetup.m_szTempDir), + "abcdefghijklmopqrstuvwxyz/-")); + + Add(new cMenuEditBoolItem(tr("Remove temporary files"), + &m_tmpSetup.m_bHousekeeping, + tr("no"), tr("yes"))); + + Add(new cMenuEditIntItem (tr("Border for Underscan (Height)"), + &m_tmpSetup.m_nBorderHeight, + cImageSetup::m_cnMinBorderHeight, cImageSetup::m_cnMaxBorderHeight)); + + Add(new cMenuEditIntItem (tr("Border for Underscan (Width)"), + &m_tmpSetup.m_nBorderWidth, + cImageSetup::m_cnMinBorderWidth, cImageSetup::m_cnMaxBorderWidth)); + } @@ -128,7 +181,7 @@ void cImageSetup::SetEnv(void) const } nEnvironTable [] = { {"ASPECT_RATIO",Setup.VideoFormat?"16:9":"4:3"}, // Get from DVB-Setup - {"CONVERT_TEMPDIR",TempDir}, + {"CONVERT_TEMPDIR",m_szTempDir}, }; for(i=0;i < sizeof(nEnvironTable)/sizeof(*nEnvironTable);++i) diff --git a/setup-image.h b/setup-image.h index b0a1f58..7878fc6 100644 --- a/setup-image.h +++ b/setup-image.h @@ -1,7 +1,8 @@ /* * Image plugin to VDR (C++) * - * (C) 2003 Kai Tobias Burwieck <kai@burwieck.net> + * (C) 2004-2005 Andreas Brachold <vdr04-at-deltab.de> + * based on (C) 2003 Kai Tobias Burwieck <kai-at-burwieck.net> * * This code is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -26,20 +27,32 @@ extern const char *g_szConvertScript; #include <vdr/menuitems.h> +#ifndef MAX_PATH +#define MAX_PATH 4096 +#endif + class cImageSetup { public: - int SlideShow; - int SSsec; - char TempDir[260]; + /* It Slideshow activ */ + int m_bSlideShow; + /* If Slideshow activ, how many seconds between slides */ + int m_nSSsec; + /* Where stored temp. files */ + char m_szTempDir[MAX_PATH]; #if VDRVERSNUM < 10307 - int ShowDate; + /* Should show file date on OSD */ + int m_bShowDate; #endif - int AutoRepeat; - int ShowNumbers; + /* Should slideshow automated repeat */ + int m_bAutoRepeat; + /* Should show overlay numbers on indexdump */ + int m_bShowNumbers; #if VDRVERSNUM >= 10308 + /* Don't mute audio, on show images */ int m_bLiveAudio; #endif + /* Activate own house keeping system for temp. files, avoid pregenerated images */ int m_bHousekeeping; /** Minimum Value for Slideshow */ @@ -47,6 +60,17 @@ public: /** Maximum Value for Slideshow */ static const int m_cSSMax; + /** Range for BorderHeight */ + static const int m_cnMinBorderHeight; + static const int m_cnMaxBorderHeight; + int m_nBorderHeight; + + /** Range for BorderWidth */ + static const int m_cnMinBorderWidth; + static const int m_cnMaxBorderWidth; + int m_nBorderWidth; + + public: cImageSetup(void); void SetEnv(void) const; |