add commandline option for user defined default background image trunk
authornathan
Fri, 02 Jan 2009 13:46:58 +0100
branchtrunk
changeset 19306cc35c7faa
parent 18 708c6d199dbf
child 20 3f59412204df
add commandline option for user defined default background image
HISTORY
README
data-mp3.c
data-mp3.h
mp3.c
     1.1 --- a/HISTORY	Sun Jul 06 10:43:56 2008 +0800
     1.2 +++ b/HISTORY	Fri Jan 02 13:46:58 2009 +0100
     1.3 @@ -4,11 +4,13 @@
     1.4  ..2007: Version 0.10.2 (vdr 1.4.7 / 1.5.11)
     1.5  - Fixed a segfault while direct song selection. Thanks to Halim Sahin for
     1.6    reporting.
     1.7 +- Fixed possible division by zero in libsndfile decoder.
     1.8  - Fixed some gcc 4.x warnings.
     1.9 -- Removed line number references from *.po files.
    1.10 +- Added commandline option for a user defined default background image.
    1.11  - Backward compatible on-the-fly creation of the i18n.c file using Udo Richter's
    1.12    po2i18n package.
    1.13  - Added italian translations.
    1.14 +- Updated french and russian translations.
    1.15  
    1.16  27.08.2007: Version 0.10.1 (vdr 1.4.7 / 1.5.9)
    1.17  - Fixed segfault in MP3 infocache purge on plugin exit.
     2.1 --- a/README	Sun Jul 06 10:43:56 2008 +0800
     2.2 +++ b/README	Fri Jan 02 13:46:58 2009 +0100
     2.3 @@ -203,6 +203,7 @@
     2.4  -C DIR,  --cache=DIR    store ID3 cache file in DIR
     2.5  -D DIR,  --dsp=DIR      device for OSS output
     2.6  -i CMD,  --iconv=CMD    use CMD to convert background images
     2.7 +-I IMG,  --defimage=IMG use IMG as default background image
     2.8  -c DIR,  --icache=DIR   cache converted images in DIR
     2.9  -S SUB,  --sources=SUB  search sources config in SUB subdirectory
    2.10   
     3.1 --- a/data-mp3.c	Sun Jul 06 10:43:56 2008 +0800
     3.2 +++ b/data-mp3.c	Fri Jan 02 13:46:58 2009 +0100
     3.3 @@ -38,6 +38,7 @@
     3.4  
     3.5  const char *imagecache = "/var/cache/images/mp3";
     3.6  const char *imageconv  = "image_convert.sh";
     3.7 +const char *def_usr_img = 0;
     3.8  
     3.9  // image suffixes to search
    3.10  const char *img_suff[] = { "jpg","png","gif",0 };
    3.11 @@ -262,6 +263,9 @@
    3.12    // default image in source basedir
    3.13    if((image=CheckImage("background"))) return true;
    3.14  
    3.15 +  // default user supplied image
    3.16 +  if(def_usr_img && (image=strdup(def_usr_img))) return true;
    3.17 +
    3.18    di(printf("image: no image for %s\n",obj->Path()))
    3.19    return false;
    3.20  }
     4.1 --- a/data-mp3.h	Sun Jul 06 10:43:56 2008 +0800
     4.2 +++ b/data-mp3.h	Fri Jan 02 13:46:58 2009 +0100
     4.3 @@ -32,7 +32,7 @@
     4.4  class cSongInfo;
     4.5  class cImageConvert;
     4.6  
     4.7 -extern const char *imagecache, *imageconv;
     4.8 +extern const char *imagecache, *imageconv, *def_usr_img;
     4.9  extern const char *img_suff[], *excl_pl[], *excl_br[];
    4.10  
    4.11  // ----------------------------------------------------------------
     5.1 --- a/mp3.c	Sun Jul 06 10:43:56 2008 +0800
     5.2 +++ b/mp3.c	Fri Jan 02 13:46:58 2009 +0100
     5.3 @@ -1603,6 +1603,8 @@
     5.4                       "                           (default: %s)\n"
     5.5                       "  -i CMD,   --iconv=CMD    use CMD to convert background images\n"
     5.6                       "                           (default: %s)\n"
     5.7 +                     "  -I IMG,   --defimage=IMG use IMG as default background image\n"
     5.8 +                     "                           (default: none)\n"
     5.9                       "  -c DIR,   --icache=DIR   cache converted images in DIR\n"
    5.10                       "                           (default: %s)\n"
    5.11                       "  -S SUB,   --sources=SUB  search sources config in SUB subdirectory\n"
    5.12 @@ -1638,6 +1640,7 @@
    5.13        { "cache",    required_argument, NULL, 'C' },
    5.14        { "icache",   required_argument, NULL, 'c' },
    5.15        { "iconv",    required_argument, NULL, 'i' },
    5.16 +      { "defimage", required_argument, NULL, 'I' },
    5.17        { "sources",  required_argument, NULL, 'S' },
    5.18        { NULL }
    5.19      };
    5.20 @@ -1650,6 +1653,7 @@
    5.21        case 'm': mountscript=optarg; break;
    5.22        case 'n': netscript=optarg; break;
    5.23        case 'C': cachedir=optarg; break;
    5.24 +      case 'I': def_usr_img=optarg; break;
    5.25        case 'S': sourcesSub=optarg; break;
    5.26        case 'B':
    5.27  #ifdef HAVE_SNDFILE