changeset 950:527e62f39af6

More work on faptool.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 28 Nov 2014 08:18:37 +0200
parents 2179600710d1
children 6549fb84a814
files faptool.php
diffstat 1 files changed, 13 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/faptool.php	Fri Nov 28 08:18:03 2014 +0200
+++ b/faptool.php	Fri Nov 28 08:18:37 2014 +0200
@@ -277,9 +277,9 @@
       wtPurgeDir($path);
     } // archive
 //    else
-//      $done = wtRenderConvertEntryToSource();
+//      $found = wtRenderConvertEntryToSource();
     
-    if (!$done)
+    if (!$found)
     {
       echo "WARNING: Could not generate preview from entry ".wtNiceName($compo, $entry, $efile)."\n";
       return FALSE;
@@ -291,9 +291,18 @@
   switch (source)
   {
     case audio:
-      foreach (...)
+      foreach (stGetSetting("sampleTypes") as $stype => $sopts)
       {
-        wtConvertSample();
+        if (!isset($fileTypeData[$stype]))
+          die("Internal error: Sample type ".$stype." in sampleTypes in mconfig.inc.php, but not defined in file type data.\n");
+
+        $filename = $pdata["files"][$sdata]["file"];
+
+        wtConvertSample(
+          $inFilename,
+          stMakePath(FALSE, TRUE, array($setPreviewPath, $compo["cpath"], $filename)),
+          $sopts
+          );
       }
       break;