diff src/app/services/feature-extraction/feature-extraction.service.ts @ 396:3eab26a629e1

Revert changes relating to bodging unit onto the shaped features. Now return from the extraction service and add to the analysis item, and send into the cross-hair component with a prop.
author Lucas Thompson <dev@lucas.im>
date Thu, 01 Jun 2017 23:04:39 +0100
parents 524f5cd75737
children f52eb1b422f5
line wrap: on
line diff
--- a/src/app/services/feature-extraction/feature-extraction.service.ts	Thu Jun 01 18:56:06 2017 +0100
+++ b/src/app/services/feature-extraction/feature-extraction.service.ts	Thu Jun 01 23:04:39 2017 +0100
@@ -32,6 +32,7 @@
 export interface ExtractionResult {
   id: RequestId;
   result: KnownShapedFeature;
+  unit?: string;
 }
 
 @Injectable()
@@ -93,7 +94,12 @@
         features: features,
         outputDescriptor: config.outputDescriptor
       });
-      const result = {
+      const result = config.outputDescriptor.configured.unit ? {
+        id: analysisItemId,
+        result: shaped,
+        unit: shaped.shape === 'notes' ?
+          'MIDI note' : config.outputDescriptor.configured.unit
+      } : {
         id: analysisItemId,
         result: shaped
       };