changeset 111:90dca6156662

Use exceptions to report failure to apply Vamp plugins etc -- Error-tagged returns seem more appropriate to incremental failure
author Chris Cannam
date Sun, 14 Apr 2013 21:29:21 +0100
parents f039eec93d50
children f73923903ba4
files yetilab/plot/plot.yeti yetilab/vamp/vamp.yeti yetilab/vamp/vamppost.yeti
diffstat 3 files changed, 7 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/yetilab/plot/plot.yeti	Sat Apr 13 22:00:09 2013 +0100
+++ b/yetilab/plot/plot.yeti	Sun Apr 14 21:29:21 2013 +0100
@@ -39,10 +39,10 @@
     yrange = new Range(1, size.rows - 1);
     grid = new OrthonormalGrid(xrange, size.columns, yrange, size.rows);
     surface = Builder#buildOrthonormalBig(grid, mapper); //??? big?
-    surface#setFaceDisplayed(true);
+    surface#setFaceDisplayed(false);
     surface#setWireframeDisplayed(true);
     surface#setWireframeColor(Color#BLACK);
-    chart = new Chart(Quality#Nicest);
+    chart = new Chart(Quality#Fastest, "swing");
     chart#getScene()#getGraph()#add(surface);
     ChartLauncher#openChart(chart));
 
--- a/yetilab/vamp/vamp.yeti	Sat Apr 13 22:00:09 2013 +0100
+++ b/yetilab/vamp/vamp.yeti	Sun Apr 14 21:29:21 2013 +0100
@@ -257,7 +257,7 @@
 converted { p, sampleRate, hop } outputNo fl =
     map (featuresFromSet outputNo) fl;
 
-returnErrorFrom p stream text = (p.dispose (); stream.close (); Error text);
+returnErrorFrom p stream text = (p.dispose (); stream.close (); failWith text);
 
 processWith key p outputNo stream =
    (blockSize =
@@ -274,7 +274,7 @@
         framesize = blockSize, blockSize, hop = stepSize
     };
     if p.initialise params then
-        OK {
+        {
             key = key,
             output = p.outputs[outputNo],
             parameters = mapIntoHash id p.parameterValue
@@ -303,13 +303,13 @@
             outputs = strJoin ", " (map (.identifier) p.outputs);
             returnErrorFrom p stream "Plugin \(key) has no output named \(output) (outputs are: \(outputs))"
         fi;
-    Error e: Error e;
+    Error e: failWith e;
     esac;
 
 processFile key output filename = 
     case af.open filename of
     Stream s: processStream key output s;
-    Error e: Error e;
+    Error e: failWith e;
     esac;
 
 processStreamStructured key output filename =
--- a/yetilab/vamp/vamppost.yeti	Sat Apr 13 22:00:09 2013 +0100
+++ b/yetilab/vamp/vamppost.yeti	Sun Apr 14 21:29:21 2013 +0100
@@ -145,17 +145,9 @@
              fi) features);
     esac);
 
-postprocess data =
-    case data of
-    OK data:
-        structure data;
-    Error e:
-        Error e;
-    esac;
-
 {
 fillTimestamps,
-postprocess
+postprocess = structure
 }