# HG changeset patch # User Chris Cannam # Date 1493797143 -3600 # Node ID 79fa2c4c0fce497c49fb395c8f5810734759ccaa # Parent 88ac87b1800e913980ea9330a02ab21afa6980e5# Parent 2e30a02b57ca5d080c6f4aab17de65b1350af998 Merge remote-tracking branch 'origin/master' diff -r 88ac87b1800e -r 79fa2c4c0fce src/app/feature-extraction-menu/feature-extraction-menu.component.html --- a/src/app/feature-extraction-menu/feature-extraction-menu.component.html Tue May 02 18:10:51 2017 +0100 +++ b/src/app/feature-extraction-menu/feature-extraction-menu.component.html Wed May 03 08:39:03 2017 +0100 @@ -11,7 +11,7 @@

diff -r 88ac87b1800e -r 79fa2c4c0fce src/app/feature-extraction-menu/feature-extraction-menu.component.ts --- a/src/app/feature-extraction-menu/feature-extraction-menu.component.ts Tue May 02 18:10:51 2017 +0100 +++ b/src/app/feature-extraction-menu/feature-extraction-menu.component.ts Wed May 03 08:39:03 2017 +0100 @@ -11,6 +11,7 @@ } from '../services/feature-extraction/feature-extraction.service'; import {ListResponse} from 'piper'; import {Subscription} from 'rxjs/Subscription'; +import {MdSelect} from '@angular/material'; export interface ExtractorOutputInfo { extractorKey: string; @@ -70,6 +71,14 @@ }; } + private getFirstSelectedItemOrEmpty(select: MdSelect): string { + const selected = select.selected; + if (selected) { + return selected instanceof Array ? selected[0].value : selected.value; + } + return ''; + } + ngOnInit() { this.piperService.list().then(this.populateExtractors); this.librariesUpdatedSubscription = diff -r 88ac87b1800e -r 79fa2c4c0fce src/app/waveform/waveform.component.ts --- a/src/app/waveform/waveform.component.ts Tue May 02 18:10:51 2017 +0100 +++ b/src/app/waveform/waveform.component.ts Wed May 03 08:39:03 2017 +0100 @@ -32,21 +32,24 @@ type Track = any; type Colour = string; -const colours = function* () { - const circularColours = [ - '#0868ac', // "sapphire blue", our waveform / header colour - '#c33c54', // "brick red" - '#17bebb', // "tiffany blue" - '#001021', // "rich black" - '#fa8334', // "mango tango" - '#034748' // "deep jungle green" - ]; + + +function* createColourGenerator(colours) { let index = 0; - const nColours = circularColours.length; + const nColours = colours.length; while (true) { - yield circularColours[index = ++index % nColours]; + yield colours[index = ++index % nColours]; } -}(); +} + +const defaultColourGenerator = createColourGenerator([ + '#0868ac', // "sapphire blue", our waveform / header colour + '#c33c54', // "brick red" + '#17bebb', // "tiffany blue" + '#001021', // "rich black" + '#fa8334', // "mango tango" + '#034748' // "deep jungle green" +]); @Component({ selector: 'ugly-waveform', @@ -65,11 +68,11 @@ if (this.featureExtractionSubscription) { return; } - + this.featureExtractionSubscription = this.piperService.featuresExtracted$.subscribe( features => { - this.renderFeatures(features, colours.next().value); + this.renderFeatures(features, defaultColourGenerator.next().value); }); } else { if (this.featureExtractionSubscription) { diff -r 88ac87b1800e -r 79fa2c4c0fce tslint.json --- a/tslint.json Tue May 02 18:10:51 2017 +0100 +++ b/tslint.json Wed May 03 08:39:03 2017 +0100 @@ -51,7 +51,7 @@ "no-string-literal": false, "no-string-throw": true, "no-switch-case-fall-through": true, - "no-trailing-whitespace": true, + "no-trailing-whitespace": false, "no-unused-expression": true, "no-use-before-declare": true, "no-var-keyword": true,