comparison src/app/services/feature-extraction/FeatureExtractionWorker.ts @ 88:4aa6b1266251

Change deprecated names from piper
author Lucas Thompson <dev@lucas.im>
date Thu, 23 Feb 2017 16:13:38 +0000
parents 5fb318ac16d5
children 4865567d9e43
comparison
equal deleted inserted replaced
87:d17b92663d50 88:4aa6b1266251
1 /** 1 /**
2 * Created by lucas on 01/12/2016. 2 * Created by lucas on 01/12/2016.
3 */ 3 */
4 4
5 import {EmscriptenProxy, ListRequest, ListResponse} from 'piper'; 5 import {PiperVampService, ListRequest, ListResponse} from 'piper';
6 import { 6 import {
7 PiperSimpleClient, SimpleRequest, 7 PiperSimpleClient, SimpleRequest,
8 SimpleResponse 8 SimpleResponse
9 } from 'piper/HigherLevelUtilities'; 9 } from 'piper/HigherLevelUtilities';
10 import { VampExamplePlugins } from 'piper/ext/VampExamplePluginsModule'; 10 import { VampExamplePlugins } from 'piper/ext/VampExamplePluginsModule';
35 this.workerScope = workerScope; 35 this.workerScope = workerScope;
36 this.clients = new Map<LibraryKey, PiperSimpleClient>(); 36 this.clients = new Map<LibraryKey, PiperSimpleClient>();
37 this.remoteLibraries = new Map<LibraryKey, LibraryUri>(); 37 this.remoteLibraries = new Map<LibraryKey, LibraryUri>();
38 this.clients.set( 38 this.clients.set(
39 'vamp-example-plugins', 39 'vamp-example-plugins',
40 new PiperSimpleClient(new EmscriptenProxy(VampExamplePlugins())) 40 new PiperSimpleClient(new PiperVampService(VampExamplePlugins()))
41 ); 41 );
42 42
43 this.workerScope.onmessage = (ev: MessageEvent) => { 43 this.workerScope.onmessage = (ev: MessageEvent) => {
44 const sendResponse = (result) => { 44 const sendResponse = (result) => {
45 this.workerScope.postMessage({ 45 this.workerScope.postMessage({
68 const key: LibraryKey = ev.data.params; 68 const key: LibraryKey = ev.data.params;
69 if (this.remoteLibraries.has(key)) { 69 if (this.remoteLibraries.has(key)) {
70 this.requireJs([this.remoteLibraries.get(key)], (plugin) => { 70 this.requireJs([this.remoteLibraries.get(key)], (plugin) => {
71 this.clients.set( 71 this.clients.set(
72 key, 72 key,
73 new PiperSimpleClient(new EmscriptenProxy(plugin.createLibrary())) 73 new PiperSimpleClient(new PiperVampService(plugin.createLibrary()))
74 ); // TODO won't always be an emscripten module 74 ); // TODO won't always be an emscripten module
75 this.list({}).then(sendResponse); 75 this.list({}).then(sendResponse);
76 }); 76 });
77 } else { 77 } else {
78 console.error('Non registered library key.'); // TODO handle error 78 console.error('Non registered library key.'); // TODO handle error