changeset 1043:c0e21a405256

Change external tool handling.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 20 Nov 2015 14:44:51 +0200
parents b17c41ffe43b
children c0674ef6e100 280de0770798
files faptool.php mconfig.inc.php.example
diffstat 2 files changed, 19 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/faptool.php	Fri Nov 20 13:39:20 2015 +0200
+++ b/faptool.php	Fri Nov 20 14:44:51 2015 +0200
@@ -19,13 +19,22 @@
 
 function wtGetExecutable($name, $path = FALSE)
 {
-  if (stChkSetting($name))
-    return stGetSetting($name);
+  if (stChkSetting($name."_exe"))
+    return stGetSetting($name."_exe");
   else
     return $name;
 }
 
 
+function wtGetExecutableArgs($name)
+{
+  if (stChkSetting($name."_args"))
+    return " ".stGetSetting($name."_args")." ";
+  else
+    return "";
+}
+
+
 function wtConvertImage($inFilename, $outFilename, $outDim, $outFormat, $outQuality, $thumb, $useGfxConv)
 {
   global $setPreviewPath;
@@ -37,6 +46,7 @@
     $tmpFilename = tempnam($setPreviewPath, "tmp");
     $isTemp = TRUE;
     if (wtExec(wtGetExecutable("gfxconv"),
+      wtGetExecutableArgs("gfxconv").
       escapeshellarg($inFilename)." -f png -o ".escapeshellarg($tmpFilename),
       0) === false)
       return FALSE;
@@ -106,7 +116,7 @@
     "--samplerate ".$sfreq." ".
     "--channels ".$schannels." ".
     "--end-time ".($sduration)." ".
-    stGetSetting("openmpt123ExtraArgs")." ".
+    wtGetExecutableArgs("openmpt123").
     escapeshellarg($inFilename)." -o ".escapeshellarg($outFilename),
     0);
 }
@@ -124,6 +134,7 @@
 
   return wtExec(
     wtGetExecutable("avconv"),
+    wtGetExecutableArgs("avconv").
     "-y -v 1 -t ".intval($sduration)." ".
     "-i ".escapeshellarg($inFilename).
     " ".$optStr." -ac ".$schannels.
--- a/mconfig.inc.php.example	Fri Nov 20 13:39:20 2015 +0200
+++ b/mconfig.inc.php.example	Fri Nov 20 14:44:51 2015 +0200
@@ -58,7 +58,11 @@
   "sampleChannels" => 1, // 1 = mono, 2 = stereo
   "sampleDuration" => 30, // in seconds
 
-  "openmpt123ExtraArgs" => "", // Extra commandline arguments for openmpt123
+  //"avconv_exe" => "ffmpeg", // avconv/ffmpeg binary executable
+  //"gfxconv_exe" => "gfxconv", 
+  //"openmpg123_exe" => "openmpt123",
+
+  "openmpt123_args" => "", // Extra commandline arguments for openmpt123
 
   // Samples to be generated, and their avconv settings
   "sampleTypes" => array(