diff options
| author | root <root@elwms02.(none)> | 2010-04-06 16:13:08 +0200 |
|---|---|---|
| committer | root <root@elwms02.(none)> | 2010-04-06 16:13:08 +0200 |
| commit | 0e7005fcc7483c01aa102fbea358c5ac65a48d62 (patch) | |
| tree | 11517ce0d3d2977c6732b3aa583b0008083e0bd3 /plugins/graphlcd | |
| download | x-vdr-0e7005fcc7483c01aa102fbea358c5ac65a48d62.tar.gz x-vdr-0e7005fcc7483c01aa102fbea358c5ac65a48d62.tar.bz2 | |
hello world
Diffstat (limited to 'plugins/graphlcd')
| -rw-r--r-- | plugins/graphlcd/patches/graphlcd-0.1.5_span-0.0.4.diff | 364 | ||||
| -rw-r--r-- | plugins/graphlcd/patches/graphlcd-0.1.5_vdr-1.5.3.diff | 19 | ||||
| -rw-r--r-- | plugins/graphlcd/plugin.sh | 75 |
3 files changed, 458 insertions, 0 deletions
diff --git a/plugins/graphlcd/patches/graphlcd-0.1.5_span-0.0.4.diff b/plugins/graphlcd/patches/graphlcd-0.1.5_span-0.0.4.diff new file mode 100644 index 0000000..6f7bd69 --- /dev/null +++ b/plugins/graphlcd/patches/graphlcd-0.1.5_span-0.0.4.diff @@ -0,0 +1,364 @@ +diff -ruN graphlcd-0.1.5/display.c graphlcd-0.1.5_span-0.0.4/display.c +--- graphlcd-0.1.5/display.c 2007-02-11 10:45:09.000000000 +0100 ++++ graphlcd-0.1.5_span-0.0.4/display.c 2007-03-19 16:50:54.000000000 +0100 +@@ -29,6 +29,7 @@ + + #include <vdr/tools.h> + #include <vdr/menu.h> ++#include <vdr/plugin.h> + + #include "compat.h" + +@@ -115,6 +116,7 @@ + nCurrentBrightness = -1; + LastTimeBrightness = 0; + bBrightnessActive = true; ++ LastTimeSA.Set(0); // span-patch + } + + cGraphLCDDisplay::~cGraphLCDDisplay() +@@ -379,6 +381,13 @@ + update = true; + } + ++ // span-patch ++ if ( LastTimeSA.TimedOut() ) ++ { ++ update = true; ++ LastTimeSA.Set(1000); ++ } ++ + // update Display every second or due to an update + if (CurrTime != LastTime || update) + { +@@ -1465,6 +1465,7 @@ + FRAME_SPACE_X + nMaxX, + nTopY + nProgressbarHeight, + GLCD::clrBlack, false); ++ DisplaySA(); + + if (1 < replay.total && 1 < replay.current) // Don't show full progressbar for endless streams + { +@@ -1951,3 +1952,127 @@ + } + mutex.Unlock(); + } ++void cGraphLCDDisplay::DisplaySA() ++{ ++ // Spectrum Analyzer visualization ++ if ( GraphLCDSetup.enableSpectrumAnalyzer ) { ++ if (cPluginManager::CallFirstService(SPAN_GET_BAR_HEIGHTS_ID, NULL)) { ++ Span_GetBarHeights_v1_0 GetBarHeights; ++ ++ int bandsSA = 20; ++ int falloffSA = 8; ++ int channelsSA = 1; ++ ++ unsigned int bar; ++ unsigned int *barHeights = new unsigned int[bandsSA]; ++ unsigned int *barHeightsLeftChannel = new unsigned int[bandsSA]; ++ unsigned int *barHeightsRightChannel = new unsigned int[bandsSA]; ++ unsigned int volumeLeftChannel; ++ unsigned int volumeRightChannel; ++ unsigned int volumeBothChannels; ++ unsigned int *barPeaksBothChannels = new unsigned int[bandsSA]; ++ unsigned int *barPeaksLeftChannel = new unsigned int[bandsSA]; ++ unsigned int *barPeaksRightChannel = new unsigned int[bandsSA]; ++ ++ GetBarHeights.bands = bandsSA; ++ GetBarHeights.barHeights = barHeights; ++ GetBarHeights.barHeightsLeftChannel = barHeightsLeftChannel; ++ GetBarHeights.barHeightsRightChannel = barHeightsRightChannel; ++ GetBarHeights.volumeLeftChannel = &volumeLeftChannel; ++ GetBarHeights.volumeRightChannel = &volumeRightChannel; ++ GetBarHeights.volumeBothChannels = &volumeBothChannels; ++ GetBarHeights.name = "graphlcd"; ++ GetBarHeights.falloff = falloffSA; ++ GetBarHeights.barPeaksBothChannels = barPeaksBothChannels; ++ GetBarHeights.barPeaksLeftChannel = barPeaksLeftChannel; ++ GetBarHeights.barPeaksRightChannel = barPeaksRightChannel; ++ ++ if ( cPluginManager::CallFirstService(SPAN_GET_BAR_HEIGHTS_ID, &GetBarHeights )) { ++ int i; ++ int barWidth = 2; ++ int saStartX = FRAME_SPACE_X; ++ int saEndX = saStartX + barWidth*bandsSA*2 + bandsSA/4 - 1; ++ int saStartY = FRAME_SPACE_Y; ++ int saEndY = FRAME_SPACE_Y + bitmap->Height()/2 - 3; ++ ++ LastTimeSA.Set(100); ++ ++ if ( GraphLCDSetup.SAShowVolume ) { ++ saStartX = FRAME_SPACE_X + bitmap->Width()/2 - (barWidth*bandsSA*2 + bandsSA/4)/2 - 2; ++ saEndX = saStartX + barWidth*bandsSA*2 + bandsSA/4 - 1; ++ ++ // left volume ++ bitmap->DrawRectangle(FRAME_SPACE_X, ++ saStartY, ++ saStartX-1, ++ saEndY + 1, ++ GLCD::clrWhite, true); ++ ++ for ( i=0; (i<logo->Width()/2-2) && (i<3*(volumeLeftChannel*saStartX)/100); i++) { ++ bitmap->DrawRectangle(saStartX - i - 2, ++ saStartY + saEndY/2 - i, ++ saStartX - i - 4, ++ saStartY + saEndY/2 + i, ++ GLCD::clrBlack, true); ++ } ++ ++ // right volume ++ bitmap->DrawRectangle(saEndX + 1, ++ saStartY, ++ bitmap->Width() - 1, ++ saEndY + 1, ++ GLCD::clrWhite, true); ++ ++ for ( i=0; (i<logo->Width()/2-2) && (i<3*(volumeRightChannel*saStartX)/100); i++) { ++ bitmap->DrawRectangle(saEndX + 2 + i, ++ saStartY + saEndY/2 - i, ++ saEndX + i + 4, ++ saStartY + saEndY/2 + i, ++ GLCD::clrBlack, true); ++ } ++ } ++ ++ // black background ++ bitmap->DrawRectangle(saStartX, ++ saStartY, ++ saEndX, ++ saEndY + 1, ++ GLCD::clrBlack, true); ++ ++ for ( i=0; i < bandsSA; i++ ) { ++/* if ( channelsSA == 2 ) { ++ bar = barHeightsLeftChannel[i]; ++ bar = barHeightsRightChannel[i]; ++ }*/ ++ if ( channelsSA == 1) { ++ // the bar ++ bar = (barHeights[i]*(saEndY-saStartY))/100; ++ bitmap->DrawRectangle(saStartX + barWidth*2*(i)+ barWidth + 1, ++ saEndY, ++ saStartX + barWidth*2*(i) + barWidth+ barWidth + 1, ++ saEndY - bar, ++ GLCD::clrWhite, true); ++ ++ // the peak ++ bar = (barPeaksBothChannels[i]*(saEndY-saStartY))/100; ++ if ( bar > 0 ) { ++ bitmap->DrawRectangle(saStartX + barWidth*2*(i)+ barWidth + 1, ++ saEndY - bar, ++ saStartX + barWidth*2*(i) + barWidth+ barWidth + 1, ++ saEndY - bar+1, ++ GLCD::clrWhite, true); ++ } ++ } ++ } ++ } ++ ++ delete [] barHeights; ++ delete [] barHeightsLeftChannel; ++ delete [] barHeightsRightChannel; ++ delete [] barPeaksBothChannels; ++ delete [] barPeaksLeftChannel; ++ delete [] barPeaksRightChannel; ++ } ++ } ++} ++ +diff -ruN graphlcd-0.1.5/display.h graphlcd-0.1.5_span-0.0.4/display.h +--- graphlcd-0.1.5/display.h 2007-02-11 10:36:30.000000000 +0100 ++++ graphlcd-0.1.5_span-0.0.4/display.h 2007-03-19 16:51:47.000000000 +0100 +@@ -31,10 +31,33 @@ + #include <vdr/thread.h> + #include <vdr/player.h> + ++#define SPAN_CLIENT_CHECK_ID "Span-ClientCheck-v1.0" ++#define SPAN_GET_BAR_HEIGHTS_ID "Span-GetBarHeights-v1.0" + + #define LCDMAXCARDS 4 + static const int kMaxTabCount = 10; + ++struct Span_Client_Check_1_0 { ++ bool *isActive; ++ bool *isRunning; ++}; ++ ++struct Span_GetBarHeights_v1_0 { ++ unsigned int bands; // number of bands to compute ++ unsigned int *barHeights; // the heights of the bars of the two channels combined ++ unsigned int *barHeightsLeftChannel; // the heights of the bars of the left channel ++ unsigned int *barHeightsRightChannel; // the heights of the bars of the right channel ++ unsigned int *volumeLeftChannel; // the volume of the left channels ++ unsigned int *volumeRightChannel; // the volume of the right channels ++ unsigned int *volumeBothChannels; // the combined volume of the two channels ++ const char *name; // name of the plugin that wants to get the data ++ // (must be unique for each client!) ++ unsigned int falloff; // bar falloff value ++ unsigned int *barPeaksBothChannels; // bar peaks of the two channels combined ++ unsigned int *barPeaksLeftChannel; // bar peaks of the left channel ++ unsigned int *barPeaksRightChannel; // bar peaks of the right channel ++}; ++ + enum ThreadState + { + Normal, +@@ -106,6 +129,7 @@ + time_t LastTime; + time_t LastTimeCheckSym; + time_t LastTimeModSym; ++ cTimeMs LastTimeSA; + struct timeval CurrTimeval; + struct timeval UpdateAt; + +@@ -127,6 +151,7 @@ + void DisplayTextItem(); + void DisplayColorButtons(); + void DisplayVolume(); ++ void DisplaySA(); + + void UpdateIn(long usec); + bool CheckAndUpdateSymbols(); +diff -ruN graphlcd-0.1.5/i18n.c graphlcd-0.1.5_span-0.0.4/i18n.c +--- graphlcd-0.1.5/i18n.c 2007-02-04 16:55:03.000000000 +0100 ++++ graphlcd-0.1.5_span-0.0.4/i18n.c 2007-03-19 16:50:54.000000000 +0100 +@@ -966,5 +966,53 @@ + # endif + #endif + }, ++ { ++ "Show spectrum analyzer", ++ "Zeige Spectrum Analyzer", ++ "",// 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 Românã ++ "",// TODO Magyar ++ "",// TODO Català ++#if VDRVERSNUM > 10302 ++ "",// TODO Russian ++# if VDRVERSNUM > 10307 ++ "",// TODO Croatian ++# endif ++#endif ++ }, ++ { ++ "Show SA volume", ++ "Zeige SA Lautstärke", ++ "",// 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 Românã ++ "",// TODO Magyar ++ "",// TODO Català ++#if VDRVERSNUM > 10302 ++ "",// TODO Russian ++# if VDRVERSNUM > 10307 ++ "",// TODO Croatian ++# endif ++#endif ++ }, + { NULL } + }; +diff -ruN graphlcd-0.1.5/menu.c graphlcd-0.1.5_span-0.0.4/menu.c +--- graphlcd-0.1.5/menu.c 2007-02-04 16:44:28.000000000 +0100 ++++ graphlcd-0.1.5_span-0.0.4/menu.c 2007-03-19 16:50:54.000000000 +0100 +@@ -75,6 +75,8 @@ + Add(new cMenuEditIntItem(tr("Brightness on user activity"), &newGraphLCDSetup.BrightnessActive, 0, 100)); + Add(new cMenuEditIntItem(tr("Brightness on user inactivity"), &newGraphLCDSetup.BrightnessIdle, 0, 100)); + Add(new cMenuEditIntItem(tr("Brightness delay [s]"), &newGraphLCDSetup.BrightnessDelay, 0, 600)); ++ Add(new cMenuEditBoolItem(tr("Show spectrum analyzer"), &newGraphLCDSetup.enableSpectrumAnalyzer)); ++ Add(new cMenuEditBoolItem(tr("Show SA volume"), &newGraphLCDSetup.SAShowVolume)); + } + + void cGraphLCDMenuSetup::Store() +@@ -101,4 +103,6 @@ + SetupStore("BrightnessActive", GraphLCDSetup.BrightnessActive = newGraphLCDSetup.BrightnessActive); + SetupStore("BrightnessIdle", GraphLCDSetup.BrightnessIdle = newGraphLCDSetup.BrightnessIdle); + SetupStore("BrightnessDelay", GraphLCDSetup.BrightnessDelay = newGraphLCDSetup.BrightnessDelay); ++ SetupStore("enableSpectrumAnalyzer", GraphLCDSetup.enableSpectrumAnalyzer = newGraphLCDSetup.enableSpectrumAnalyzer); ++ SetupStore("SAShowVolume", GraphLCDSetup.SAShowVolume = newGraphLCDSetup.SAShowVolume); + } +diff -ruN graphlcd-0.1.5/plugin.c graphlcd-0.1.5_span-0.0.4/plugin.c +--- graphlcd-0.1.5/plugin.c 2007-02-25 18:33:17.000000000 +0100 ++++ graphlcd-0.1.5_span-0.0.4/plugin.c 2007-03-19 16:50:54.000000000 +0100 +@@ -54,6 +54,7 @@ + virtual cOsdObject * MainMenuAction(); + virtual cMenuSetupPage * SetupMenu(); + virtual bool SetupParse(const char * Name, const char * Value); ++ virtual bool Service(const char *Id, void *Data); + }; + + cPluginGraphLCD::cPluginGraphLCD() +@@ -239,8 +240,21 @@ + else if (!strcasecmp(Name, "BrightnessActive")) GraphLCDSetup.BrightnessActive = atoi(Value); + else if (!strcasecmp(Name, "BrightnessIdle")) GraphLCDSetup.BrightnessIdle = atoi(Value); + else if (!strcasecmp(Name, "BrightnessDelay")) GraphLCDSetup.BrightnessDelay = atoi(Value); ++ else if (!strcasecmp(Name, "enableSpectrumAnalyzer")) GraphLCDSetup.enableSpectrumAnalyzer = atoi(Value); ++ else if (!strcasecmp(Name, "SAShowVolume")) GraphLCDSetup.SAShowVolume = atoi(Value); + else return false; + return true; + } + ++bool cPluginGraphLCD::Service(const char *Id, void *Data) ++{ ++ if (strcmp(Id, SPAN_CLIENT_CHECK_ID) == 0) { ++ if ( GraphLCDSetup.enableSpectrumAnalyzer && (Data != NULL)) { ++ *((Span_Client_Check_1_0*)Data)->isActive = true; ++ } ++ return true; ++ } ++ return false; ++} ++ + VDRPLUGINCREATOR(cPluginGraphLCD); // Don't touch this! +diff -ruN graphlcd-0.1.5/setup.c graphlcd-0.1.5_span-0.0.4/setup.c +--- graphlcd-0.1.5/setup.c 2007-02-04 16:43:03.000000000 +0100 ++++ graphlcd-0.1.5_span-0.0.4/setup.c 2007-03-19 16:50:54.000000000 +0100 +@@ -52,7 +52,9 @@ + ScrollTime(500), + BrightnessActive(100), + BrightnessIdle(100), +- BrightnessDelay(30) ++ BrightnessDelay(30), ++ enableSpectrumAnalyzer(1), ++ SAShowVolume(1) + { + } + +@@ -90,4 +92,6 @@ + BrightnessActive = source->BrightnessActive; + BrightnessIdle = source->BrightnessIdle; + BrightnessDelay = source->BrightnessDelay; ++ enableSpectrumAnalyzer = source->enableSpectrumAnalyzer; ++ SAShowVolume = source->SAShowVolume; + } +diff -ruN graphlcd-0.1.5/setup.h graphlcd-0.1.5_span-0.0.4/setup.h +--- graphlcd-0.1.5/setup.h 2007-02-04 16:42:46.000000000 +0100 ++++ graphlcd-0.1.5_span-0.0.4/setup.h 2007-03-19 16:50:54.000000000 +0100 +@@ -54,6 +54,8 @@ + int BrightnessActive; + int BrightnessIdle; + int BrightnessDelay; ++ int enableSpectrumAnalyzer; ++ int SAShowVolume; + + public: + cGraphLCDSetup(void); diff --git a/plugins/graphlcd/patches/graphlcd-0.1.5_vdr-1.5.3.diff b/plugins/graphlcd/patches/graphlcd-0.1.5_vdr-1.5.3.diff new file mode 100644 index 0000000..fac88fb --- /dev/null +++ b/plugins/graphlcd/patches/graphlcd-0.1.5_vdr-1.5.3.diff @@ -0,0 +1,19 @@ +fix compile Probs up from vdr-1.5.3 + +Joerg Bornkessel <hd_brummy@gentoo.org> 2007 06 26 + +diff -Naur graphlcd-0.1.5.orig/layout.c graphlcd-0.1.5/layout.c +--- graphlcd-0.1.5.orig/layout.c 2007-06-26 21:43:52.000000000 +0200 ++++ graphlcd-0.1.5/layout.c 2007-06-26 21:46:05.000000000 +0200 +@@ -65,7 +65,11 @@ + file += "/fonts/"; + file += url.substr(4, pos - 4); + } ++#if APIVERSNUM >= 10503 ++ return font.LoadFT2(file, cCharSetConv::SystemCharacterTable(), size); ++#else + return font.LoadFT2(file, I18nCharSets()[Setup.OSDLanguage], size); ++#endif + } + else + { diff --git a/plugins/graphlcd/plugin.sh b/plugins/graphlcd/plugin.sh new file mode 100644 index 0000000..d7c7ab3 --- /dev/null +++ b/plugins/graphlcd/plugin.sh @@ -0,0 +1,75 @@ +#!/bin/sh + +# x-vdr (Installations-Skript fuer einen VDR mit Debian als Basis) +# von Marc Wernecke - www.zulu-entertainment.de +# 11.03.2006 +# +# vdr-graphlcd + +# defaults +source ./../../x-vdr.conf +source ./../../setup.conf +source ./../../functions +WEB="http://download.berlios.de/graphlcd/vdr-graphlcd-0.1.5.tgz" +VERSION="graphlcd-0.1.5" +LINK="graphlcd" + +VAR=`basename $WEB` +DIR=`pwd` + +# plugin entfernen +function clean_plugin() { + cd $SOURCEDIR/VDR/PLUGINS/src + rm -rf $VDRCONFDIR/plugins/graphlcd + rm -rf $LINK* + rm -f $VDRLIBDIR/libvdr-$LINK* + log "cleaning $LINK" +} + +# plugin installieren +function install_plugin() { + download_plugin + extract_plugin + cd $SOURCEDIR/VDR/PLUGINS/src + rm -f $LINK + ln -vfs $VERSION $LINK + patch_plugin + + ## plugin specials - start ## + # copy data + cd $SOURCEDIR/VDR/PLUGINS/src/$LINK + cp -r graphlcd $VDRCONFDIR/plugins + + # symlink fuer logos und fonts + cd $VDRCONFDIR/plugins/graphlcd + ln -sf logonames.alias.1.3 logonames.alias + ln -sf fonts.conf.small fonts.conf + + # media + cd $DIR + local WEB="http://www.zulu-entertainment.de/files/vdr-graphlcd/graphlcd-media-snapshot-20060828.tar.gz" + local VERSION="graphlcd-media-snapshot-20060828" + local VAR=`basename $WEB` + download_plugin + if echo "$FILES/plugins/$VAR" | grep "bz2$" - &>/dev/null; then + if tar xjf "$FILES/plugins/$VAR" -C $DIR; then log "extrahiere $VAR" ; fi + else + if tar xzf "$FILES/plugins/$VAR" -C $DIR; then log "extrahiere $VAR" ; fi + fi + cp -r $DIR/$VERSION/* $VDRCONFDIR/plugins/graphlcd + + # rechte + chown -R $VDRUSER:$VDRGROUP $VDRCONFDIR/plugins/graphlcd + ## plugin specials - ende ## +} + +# plugin commands +if [ $# \> 0 ]; then + cmd=$1 + cmd_plugin +else + install_plugin + log "install-plugin fuer $VERSION ist fertig" +fi + +exit 0 |
