--- vdr-plugin-music-0.2.0.orig/debian/changelog
+++ vdr-plugin-music-0.2.0/debian/changelog
@@ -0,0 +1,12 @@
+vdr-plugin-music (0.2.0-1) unstable; urgency=low
+
+  * Initial release (Closes: #nnnn)  <nnnn is the bug number of your ITP>
+  
+  Important:
+  
+  If you intend to make this plugin available to others, please create an
+  ITP-bug (see http://www.debian.org/devel/wnpp ) and contact the
+  Debian VDR packaging team: pkg-vdr-dvb-devel@lists.alioth.debian.org
+
+ -- Roman Müllenschläder <mms@prodeia.de>  Tue, 11 Dec 2007 08:46:32 +0100
+
--- vdr-plugin-music-0.2.0.orig/debian/compat
+++ vdr-plugin-music-0.2.0/debian/compat
@@ -0,0 +1 @@
+5
--- vdr-plugin-music-0.2.0.orig/debian/control
+++ vdr-plugin-music-0.2.0/debian/control
@@ -0,0 +1,13 @@
+Source: vdr-plugin-music
+Section: misc
+Priority: extra
+Maintainer: Roman Müllenschläder <mms@prodeia.de>
+Build-Depends: debhelper (>= 5), vdr-dev (>= 1.4.7-2ctvdr2), dpatch
+Standards-Version: 3.7.2
+
+Package: vdr-plugin-music
+Architecture: any
+Depends: ${shlibs:Depends}, ${vdr:Depends}
+Description: <insert up to 60 chars description>
+ <insert long description, indented with spaces>
+XB-VDR-Patchlevel: ${vdr:Patchlevel}
--- vdr-plugin-music-0.2.0.orig/debian/copyright
+++ vdr-plugin-music-0.2.0/debian/copyright
@@ -0,0 +1,20 @@
+This package was debianized by Roman Müllenschläder <mms@prodeia.de> on
+Tue, 11 Dec 2007 08:46:32 +0100.
+
+It was downloaded from http://www.vdr.glaserei-franz.de/vdrplugins.htm
+
+Upstream Author: Morone
+
+Copyright: 2006 Morone
+
+
+The Debian packaging is (C) 2007, Roman Müllenschläder <mms@prodeia.de> and
+is licensed under the GPL, see `/usr/share/common-licenses/GPL'.
+
+License:
+
+It may be redistributed under the terms of the GNU GPL, Version 2
+found on Debian systems in the file /usr/share/common-licenses/GPL .
+
+# Please also look if there are files or directories which have a
+# different copyright/license attached and list them here.
--- vdr-plugin-music-0.2.0.orig/debian/docs
+++ vdr-plugin-music-0.2.0/debian/docs
@@ -0,0 +1 @@
+README
--- vdr-plugin-music-0.2.0.orig/debian/install
+++ vdr-plugin-music-0.2.0/debian/install
@@ -0,0 +1,2 @@
+libvdr-music.so.*    usr/lib/vdr/plugins/
+music/*		     usr/share/vdr-plugin-music/
--- vdr-plugin-music-0.2.0.orig/debian/README.Debian
+++ vdr-plugin-music-0.2.0/debian/README.Debian
@@ -0,0 +1,6 @@
+vdr-plugin-music for Debian
+--------------------------------------
+
+<possible notes regarding this package - if none, delete this file>
+
+ -- Roman Müllenschläder <mms@prodeia.de>  Tue, 11 Dec 2007 08:46:32 +0100
--- vdr-plugin-music-0.2.0.orig/debian/rules
+++ vdr-plugin-music-0.2.0/debian/rules
@@ -0,0 +1,93 @@
+#! /bin/sh /usr/share/vdr-dev/make-special-vdr.sh
+# Sample debian/rules that uses debhelper.
+# GNU copyright 1997 to 1999 by Joey Hess.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
+	CFLAGS += -g
+endif
+ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+	INSTALL_PROGRAM += -s
+endif
+
+# To use dpatch uncomment the following line and set Build-Depends to dpatch
+DPATCH=yes
+
+ifdef DPATCH
+include /usr/share/dpatch/dpatch.make
+else
+patch:
+patch-stamp:
+unpatch:
+endif
+
+MAKE_OPTIONS = DVBDIR=/usr VDRDIR=/usr/include/vdr LIBDIR=.
+
+configure: configure-stamp
+configure-stamp: patch-stamp
+	dh_testdir
+	touch configure-stamp
+
+build: build-stamp
+build-stamp: configure-stamp
+	dh_testdir
+	$(MAKE) all $(MAKE_OPTIONS)
+	touch build-stamp
+
+clean: clean-patched unpatch
+clean-patched:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp configure-stamp
+	-$(MAKE) -o .dependencies clean $(MAKE_OPTIONS)
+	rm -f libvdr-*.so.*
+	dh_clean
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k
+	dh_installdirs
+	dh_install
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+	dh_testdir
+	dh_testroot
+#	dh_installdebconf
+	dh_installdocs
+	dh_installexamples
+#	dh_installmenu
+#	dh_installlogrotate
+#	dh_installemacsen
+#	dh_installpam
+#	dh_installmime
+#	dh_installinit
+#	dh_installcron
+#	dh_installman
+#	dh_installinfo
+#	dh_undocumented
+	dh_installchangelogs HISTORY
+	dh_link
+	dh_strip
+	dh_compress
+	dh_fixperms
+#	dh_makeshlibs
+	dh_installdeb
+#	dh_perl
+	dh_shlibdeps
+	sh /usr/share/vdr-dev/patchlevel.sh subst
+	sh /usr/share/vdr-dev/dependencies.sh
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure \
+        clean-patched patch unpatch
--- vdr-plugin-music-0.2.0.orig/debian/patches/01_Makefile.dpatch
+++ vdr-plugin-music-0.2.0/debian/patches/01_Makefile.dpatch
@@ -0,0 +1,29 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+
+## Makefile-fPIC-fix patch
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Adds -fPIC to Makefile to fix potential FTBFS.
+
+@DPATCH@
+--- vdr-plugin-music-0.2.0.orig/Makefile
++++ vdr-plugin-music-0.2.0/Makefile
+@@ -32,7 +32,7 @@
+ #HAVE_MAGICK=1
+
+ # Uncomment, if you patched VDR with Wareagle-iconpatch
+-#HAVE_ICONPATCH=1
++HAVE_ICONPATCH=1
+
+ # Uncomment one of these lines, if you don't want one of the plugins
+ #WITHOUT_MP3=1
+@@ -45,7 +45,7 @@
+ #WITHOUT_LIBVORBISFILE=1
+
+ # Uncomment the following line, if you want OSS sound output
+-#WITH_OSS_OUTPUT=1
++WITH_OSS_OUTPUT=1
+
+ # Uncomment the following line, if you want to include debug symbols
+ #DBG=1
+
--- vdr-plugin-music-0.2.0.orig/debian/patches/00list
+++ vdr-plugin-music-0.2.0/debian/patches/00list
@@ -0,0 +1,2 @@
+01_Makefile
+02_graphtftcoverfix
--- vdr-plugin-music-0.2.0.orig/debian/patches/02_graphtftcoverfix.dpatch
+++ vdr-plugin-music-0.2.0/debian/patches/02_graphtftcoverfix.dpatch
@@ -0,0 +1,288 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+
+## GraphTFT.dpatch
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Adds Covers to graphtft.
+
+@DPATCH@
+diff -Nru music-0.2.0/Makefile music-0.2.0-new/Makefile
+--- music-0.2.0/Makefile	2007-05-18 15:29:15.000000000 +0200
++++ music-0.2.0-new/Makefile	2007-07-04 13:01:39.000000000 +0200
+@@ -52,7 +52,7 @@
+ 
+ # INTERNAL USE , DONT UNCOMMENT OR PLUGIN WILL NOT COMPILE
+ #IM_A_MORON=1
+-#HAVE_TUNED_GTFT=1
++HAVE_GRAPHTFT=1
+ 
+ ### The C++ compiler and options:
+ CXX      ?= g++
+@@ -159,8 +159,8 @@
+ 	DEFINES += -DIM_A_MORON
+ endif
+ 
+-ifdef HAVE_TUNED_GTFT
+-	DEFINES += -DHAVE_TUNED_GTFT
++ifdef HAVE_GRAPHTFT
++	DEFINES += -DHAVE_GRAPHTFT
+ endif
+ 
+ ifndef WITHOUT_LIBSNDFILE
+diff -Nru music-0.2.0/mp3control.c music-0.2.0-new/mp3control.c
+--- music-0.2.0/mp3control.c	2007-05-18 14:32:37.000000000 +0200
++++ music-0.2.0-new/mp3control.c	2007-07-04 13:02:52.000000000 +0200
+@@ -156,14 +156,6 @@
+ 
+ cMP3Control::~cMP3Control()
+ {
+-#ifdef HAVE_TUNED_GTFT
+-    cPlugin *graphtft=cPluginManager::GetPlugin("graphtft");
+-    if(graphtft) cStatus::MsgImageFile("");
+-#else
+-    cPlugin *graphtft=cPluginManager::GetPlugin("graphtft");
+-    if(graphtft) graphtft->SetupParse("CoverImage", "");
+-#endif
+-
+   if(cmdMenu) {delete cmdMenu;}
+   cmdMenu = NULL;
+ 
+@@ -372,15 +364,6 @@
+       }
+     }
+ 
+-
+-#ifdef HAVE_TUNED_GTFT
+-    cPlugin *graphtft=cPluginManager::GetPlugin("graphtft");
+-    if(graphtft) cStatus::MsgImageFile(coverpicture ? coverpicture:"");
+-#else
+-    cPlugin *graphtft=cPluginManager::GetPlugin("graphtft");
+-    if(graphtft) graphtft->SetupParse("CoverImage", coverpicture ? coverpicture:"");
+-#endif
+-
+   }
+   CanLoadCover = false;
+ }
+diff -Nru music-0.2.0/player-mp3.c music-0.2.0-new/player-mp3.c
+--- music-0.2.0/player-mp3.c	2007-05-08 00:55:53.000000000 +0200
++++ music-0.2.0-new/player-mp3.c	2007-07-04 13:04:19.000000000 +0200
+@@ -1974,6 +1974,9 @@
+               ExistsLyrics(playing->Fullname());
+ 
+               // Cover + Backgroundstuff
++#ifdef HAVE_GRAPHTFT
++              LoadGraphtftImage(playing->Fullname());
++#endif
+ 
+               if( (!MP3Setup.EnableVis) || ((showcoveronly) && (!MP3Setup.VisInCoverMode))  ) {
+ 	        LoadImage(playing->Fullname(), true);
+@@ -2182,6 +2186,7 @@
+     SetPlayMode(pmPaused);
+     statusMode=3;
+     }
++  Unlock();
+ }
+ 
+ 
+@@ -2401,6 +2406,7 @@
+   strcpy (imageFile, fullname);
+   strcpy (coverpicture, "");
+ 
++
+   // Spectrum-Analyzer enabled
+   if((MP3Setup.EnableVis) && (!coveronly) ) {
+     p = strncpy(imageFile, MP3VisLoader.VisLoaderBackground(), sizeof(imageFile));
+@@ -2414,11 +2420,6 @@
+       }
+     } 
+   }
+-
+-
+-
+-
+-
+   //
+   // track specific image, e.g. <song>.jpg
+   //
+@@ -2522,13 +2523,160 @@
+   if (!strlen (coverpicture)) {
+     DefaultImage();
+   }
+-
+-  if (!(strcmp(coverpicture, oldimagefile))==0)
++  //
++  // path to cover changed ?
++  if (!(strcmp(coverpicture, oldimagefile))==0) {
+     CanLoadCover=true;
+-  else
++    }
++  else {
+     CanLoadCover=false;
++  }
++}
++
++
++#ifdef HAVE_GRAPHTFT
++void cMP3Player::LoadGraphtftImage(const char *fullsongpath)
++{
++  size_t i;
++  char graphcover[256];
++  char imageFile[256];
++  char oldimagefile[256];
++  char *p, *q = NULL;
++  char Artist[256];
++  char *imageSuffixes[] = { "jpg", "png" };
+  
++  d(printf("music[%d]: player: gtft: checking (%s) for images\n", getpid (), fullsongpath));
++
++
++  strcpy (oldimagefile, graphcover);
++  strcpy (imageFile, fullsongpath);
++  strcpy (graphcover, "");
++
++
++  //
++  // track specific image, e.g. <song>.jpg
++  //
++
++  if (!strlen (graphcover))
++  {
++
++    p = strrchr (imageFile, '.');
++    if (p)
++    {
++      for (i = 0; i < sizeof (imageSuffixes) / sizeof (imageSuffixes[0]); i++)
++      {
++        strcpy (p + 1, imageSuffixes[i]);
++        d(printf("music[%d]: player: gtft: (%s)\n", getpid (), imageFile));
++        q = CheckImage (imageFile);
++        if (q)
++        {
++          strcpy (graphcover, q);
++        }
++      }
++    } 
++  }
++  //
++  // album specific image, e.g. cover-/front-/folder.jpg in song directory
++  //
++
++  if (!strlen (graphcover))
++  {
++    std::string fullfilename;
++    std::string Base;
++    
++    fullfilename = imageFile;
++    int len = fullfilename.length();
++
++    std::string::size_type pos  = fullfilename.rfind('/',len);
++    if(pos!=std::string::npos) {
++      //BaseDir
++      Base     = fullfilename.substr(0,pos+1);
++    }  
++
++    d(printf("music[%d]: player: gtft: directory='%s'\n", getpid(), Base.c_str()));
++
++    std::string jpegs    ="";
++    std::string b_jpegs  ="";
++    std::string pngs     ="";
++    std::string b_pngs   ="";
++
++    jpegs   = Base + "*.jpg";
++    b_jpegs = Base + "*.JPG";
++    pngs    = Base + "*.png";
++    b_pngs  = Base + "*.PNG";
++
++    d(printf("music[%d]: player: gtft: search for Cover in (%s)\n", getpid (), Base.c_str()));
++
++    unsigned int i;
++    glob_t glob_buffer;
++    glob_buffer.gl_offs = 4;
++    glob(  jpegs.c_str(), 0              , NULL, &glob_buffer);
++    glob(b_jpegs.c_str(), GLOB_APPEND    , NULL, &glob_buffer);
++    glob(  pngs.c_str() , GLOB_APPEND    , NULL, &glob_buffer);
++    glob(b_pngs.c_str() , GLOB_APPEND    , NULL, &glob_buffer);
++
++    for (i=0; i < glob_buffer.gl_pathc; ++i) {
++      d(printf("music[%d]: player: gtft: (%s)\n", getpid(), glob_buffer.gl_pathv[i]));
++
++      if(strcasestr(glob_buffer.gl_pathv[i], "cover")) {
++        q = CheckImage (glob_buffer.gl_pathv[i]);
++        }    
++      else if(strcasestr(glob_buffer.gl_pathv[i], "front")) {
++        q = CheckImage (glob_buffer.gl_pathv[i]);
++        }    
++      else if(strcasestr(glob_buffer.gl_pathv[i], "folder")) {
++        q = CheckImage (glob_buffer.gl_pathv[i]);
++      }    
++
++      if (q) { strcpy (graphcover, q); }
++    } 
++    globfree(&glob_buffer);
++  }
++  //
++  // Artist specific image, e.g. Acdc.jpg in Artistcover directory
++  //
++  if (!strlen (graphcover)) {
++    if(artist !=NULL) {
++      strcpy(Artist, MP3Setup.CoverDir);
++      strcat(Artist, "/");
++      strcat(Artist,artist);
++      strcat(Artist, ".jpg");
++       if (Artist) {
++           d(printf("music[%d]: player: gtft: (%s)\n", getpid (), Artist));
++           q = CheckImage (Artist);
++           if (q) {
++             strcpy (graphcover, q);
++             }
++       }
++    }
++  }
++  //
++  // Default image
++  //
++  if (!strlen (graphcover)) {
++    if (!isStream) {
++      file = config;
++      file = file + "/themes/defaultcover";
++      file = file + MP3Skin.localcover;
++      strcpy(graphcover, file.c_str());
++      }	
++    else {
++      file = config;
++      file = file + "/themes/defaultcover";
++      file = file + MP3Skin.streamcover;
++      strcpy(graphcover, file.c_str());
++    }
++  }
++  //
++  // Write imagepath to /tmp
++  if( FILE *f = fopen("/tmp/graphTFT.cover", "w")) {
++    d(printf("music: player-mp3.c: write imagepath '%s' to /tmp/graphTFT.cover\n", graphcover));
++    fprintf(f, "%s\n", graphcover);
++    fclose(f);
++  }    
++
+ }
++#endif
+ 
+ 
+ void cMP3Player::CheckMpeg(void) {
+@@ -2644,4 +2792,3 @@
+ 	ptslen = 1;
+     }
+ }
+-
+diff -Nru music-0.2.0/player-mp3.h music-0.2.0-new/player-mp3.h
+--- music-0.2.0/player-mp3.h	2007-05-02 19:43:54.000000000 +0200
++++ music-0.2.0-new/player-mp3.h	2007-07-04 13:06:12.000000000 +0200
+@@ -200,6 +200,9 @@
+   void WaitPlayMode(ePlayMode mode, bool inv);
+   void ExistsLyrics(const char *songpath);
+   void DefaultImage(void);
++#ifdef HAVE_GRAPHTFT
++  void LoadGraphtftImage(const char *fullsongpath);
++#endif
+ protected:
+   virtual void Activate(bool On);
+   virtual void Action(void);
--- vdr-plugin-music-0.2.0.orig/debian/links
+++ vdr-plugin-music-0.2.0/debian/links
@@ -0,0 +1 @@
+usr/share/vdr-plugin-music/    var/lib/vdr/plugins/music

