Skip to content

Instantly share code, notes, and snippets.

@highfiiv
highfiiv / BaseControlValueAccessor.ts
Last active December 20, 2020 16:32
Frequency eq band component for visualizing audio stream band data
import { ControlValueAccessor } from '@angular/forms';
export class BaseControlValueAccessor<T> implements ControlValueAccessor {
public disabled = false;
/**
* Call when value has changed programmatically
*/
public onChange(newVal: T) { }
public onTouched(_?: any) { }
@highfiiv
highfiiv / input-range.component.html
Last active December 20, 2020 13:56
vertical input ranges for setting sensitivity scale on frequency eq bands
<label class="range__label">
<input type="range"
[id]="forID"
class="range__input"
[max]="max"
[step]="step"
(touch)="onTouched()"
[ngModel]="value"
(ngModelChange)="onInput($event)"
[name]="name"
@highfiiv
highfiiv / sys-sound.controller.ts
Last active December 20, 2020 16:33
The main web audio controller and view for sound eq and sensitivity ranges for each (see other gists for band and input-range components)
import { AfterViewInit, Component, OnDestroy, OnInit } from '@angular/core';
import { Subject } from 'rxjs';
@Component({
selector: 'sys-sound',
templateUrl: './sys-sound.component.html',
styleUrls: ['./sys-sound.component.scss']
})
export class SysSoundComponent implements OnInit, AfterViewInit, OnDestroy {
private _ngUnsubscribe: Subject<void> = new Subject<void>();