changeset 320:a16d968d646e

Bodge in to load pyin and nnls-chroma from server on startup
author Lucas Thompson <dev@lucas.im>
date Mon, 15 May 2017 23:52:23 +0100
parents 64dee0c156b1
children 89208e8af8cc
files src/app/feature-extraction-menu/feature-extraction-menu.component.ts src/app/services/feature-extraction/FeatureExtractionWorker.ts yarn.lock
diffstat 3 files changed, 13 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/src/app/feature-extraction-menu/feature-extraction-menu.component.ts	Mon May 15 17:57:42 2017 +0100
+++ b/src/app/feature-extraction-menu/feature-extraction-menu.component.ts	Mon May 15 23:52:23 2017 +0100
@@ -80,7 +80,10 @@
   }
 
   ngOnInit() {
-    this.piperService.list().then(this.populateExtractors);
+    this.piperService.list().then(this.populateExtractors).then(() => {
+      this.piperService.load('pyin');
+      this.piperService.load('nnls-chroma');
+    });
     this.librariesUpdatedSubscription =
       this.piperService.librariesUpdated$.subscribe(this.populateExtractors);
   }
--- a/src/app/services/feature-extraction/FeatureExtractionWorker.ts	Mon May 15 17:57:42 2017 +0100
+++ b/src/app/services/feature-extraction/FeatureExtractionWorker.ts	Mon May 15 23:52:23 2017 +0100
@@ -111,7 +111,10 @@
   constructor(workerScope: DedicatedWorkerGlobalScope,
               private requireJs: RequireJs) {
     this.workerScope = workerScope;
-    this.remoteLibraries = new Map<LibraryKey, LibraryUri>();
+    this.remoteLibraries = new Map<LibraryKey, LibraryUri>([
+      ['nnls-chroma', 'assets/extractors/NNLSChroma.js'],
+      ['pyin', 'assets/extractors/PYin.umd.js'],
+    ]);
     this.service = new ThrottledReducingAggregateService();
     this.setupImportLibraryListener();
     this.server = new WebWorkerStreamingServer(
@@ -124,6 +127,7 @@
 
     this.workerScope.onmessage = (ev: MessageEvent) => {
       const sendResponse = (result) => {
+        console.warn(ev.data.method);
         this.workerScope.postMessage({
           method: ev.data.method,
           result: result
--- a/yarn.lock	Mon May 15 17:57:42 2017 +0100
+++ b/yarn.lock	Mon May 15 23:52:23 2017 +0100
@@ -391,10 +391,6 @@
   version "0.8.12"
   resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.8.12.tgz#a0d90e4351bb887716c83fd637ebf818af4adfcc"
 
-ast-types@0.8.15:
-  version "0.8.15"
-  resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.8.15.tgz#8eef0827f04dff0ec8857ba925abe3fea6194e52"
-
 ast-types@0.9.6:
   version "0.9.6"
   resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.9.6.tgz#102c9e9e9005d3e7e3829bf0c4fa24ee862ee9b9"
@@ -4080,9 +4076,9 @@
   version "0.16.0"
   resolved "https://codeload.github.com/piper-audio/piper-js/tar.gz/e42d0165d93794eeade2b09a345b6123d298f13c"
   dependencies:
-    "@types/base64-js" "^1.2.5"
+    "@types/base64-js" "^1.1.4"
     base64-js "^1.2.0"
-    rxjs "^5.4.0"
+    rxjs "^5.2.0"
 
 portfinder@^1.0.9, portfinder@~1.0.12:
   version "1.0.13"
@@ -4602,7 +4598,7 @@
     readable-stream "^2.0.2"
     set-immediate-shim "^1.0.1"
 
-recast@0.10.33:
+recast@0.10.33, recast@^0.10.10:
   version "0.10.33"
   resolved "https://registry.yarnpkg.com/recast/-/recast-0.10.33.tgz#942808f7aa016f1fa7142c461d7e5704aaa8d697"
   dependencies:
@@ -4611,15 +4607,6 @@
     private "~0.1.5"
     source-map "~0.5.0"
 
-recast@^0.10.10:
-  version "0.10.43"
-  resolved "https://registry.yarnpkg.com/recast/-/recast-0.10.43.tgz#b95d50f6d60761a5f6252e15d80678168491ce7f"
-  dependencies:
-    ast-types "0.8.15"
-    esprima-fb "~15001.1001.0-dev-harmony-fb"
-    private "~0.1.5"
-    source-map "~0.5.0"
-
 recast@^0.11.17:
   version "0.11.23"
   resolved "https://registry.yarnpkg.com/recast/-/recast-0.11.23.tgz#451fd3004ab1e4df9b4e4b66376b2a21912462d3"
@@ -6046,20 +6033,13 @@
     imurmurhash "^0.1.4"
     slide "^1.1.5"
 
-ws@1.1.1:
+ws@1.1.1, ws@^1.0.1:
   version "1.1.1"
   resolved "https://registry.yarnpkg.com/ws/-/ws-1.1.1.tgz#082ddb6c641e85d4bb451f03d52f06eabdb1f018"
   dependencies:
     options ">=0.0.5"
     ultron "1.0.x"
 
-ws@^1.0.1:
-  version "1.1.4"
-  resolved "https://registry.yarnpkg.com/ws/-/ws-1.1.4.tgz#57f40d036832e5f5055662a397c4de76ed66bf61"
-  dependencies:
-    options ">=0.0.5"
-    ultron "1.0.x"
-
 wtf-8@1.0.0:
   version "1.0.0"
   resolved "https://registry.yarnpkg.com/wtf-8/-/wtf-8-1.0.0.tgz#392d8ba2d0f1c34d1ee2d630f15d0efb68e1048a"