Mercurial > hg > ugly-duckling
diff src/app/feature-extraction-menu/feature-extraction-menu.component.ts @ 46:88052122ec01
Basic select box listing all outputs from available feature extractors a la Sonic Visualiser menus.
author | Lucas Thompson <dev@lucas.im> |
---|---|
date | Mon, 05 Dec 2016 11:59:22 +0000 |
parents | 13f5f228ed98 |
children | 933c64ebcd13 |
line wrap: on
line diff
--- a/src/app/feature-extraction-menu/feature-extraction-menu.component.ts Fri Dec 02 17:03:29 2016 +0000 +++ b/src/app/feature-extraction-menu/feature-extraction-menu.component.ts Mon Dec 05 11:59:22 2016 +0000 @@ -21,11 +21,20 @@ ngOnInit() { this.piperService.list().then(available => { - available.available.forEach(staticData => this.extractors.push({ - key: staticData.key, - name: staticData.basic.name - }) - ); + const maxCharacterLimit = 50; + available.available.forEach(staticData => { + if (staticData.basicOutputInfo.length > 1) + staticData.basicOutputInfo.forEach(output => this.extractors.push({ + key: `${staticData.key}:${output.identifier}`, + name: `${staticData.basic.name}: ${output.name}`.substr(0, maxCharacterLimit) + '...' + }) + ); + else + this.extractors.push({ + key: staticData.key, + name: staticData.basic.name.substr(0, maxCharacterLimit) + '...' + }); + }); }); }