annotate src/app/playback-control/playback-control.component.ts @ 47:933c64ebcd13

Some extraction logic in place.
author Lucas Thompson <dev@lucas.im>
date Mon, 05 Dec 2016 16:57:34 +0000
parents 13f5f228ed98
children 16d19c12e42f
rev   line source
dev@32 1 import {Component, OnInit} from '@angular/core';
dev@37 2 import {AudioPlayerService} from "../services/audio-player/audio-player.service";
dev@44 3 import {FeatureExtractionService} from "../services/feature-extraction/feature-extraction.service";
dev@21 4
dev@21 5 @Component({
dev@21 6 selector: 'app-playback-control',
dev@21 7 templateUrl: './playback-control.component.html',
dev@21 8 styleUrls: ['./playback-control.component.css']
dev@21 9 })
dev@21 10 export class PlaybackControlComponent implements OnInit {
dev@21 11
dev@44 12 constructor(private audioService: AudioPlayerService,
dev@44 13 private featureExtractionService: FeatureExtractionService) {
dev@32 14 }
dev@21 15
dev@47 16 ngOnInit() {}
dev@21 17
dev@32 18 emitPlayPause() {
dev@32 19 this.audioService.togglePlaying();
dev@32 20 }
dev@32 21
dev@32 22 emitFastForward() {
dev@32 23 this.audioService.seekBy(5); // TODO this should probably be some dynamic amount based on the zoom level ala Sonic Visualiser
dev@32 24 }
dev@32 25
dev@32 26 emitFastForwardEnd() {
dev@32 27 this.audioService.seekToEnd();
dev@32 28 }
dev@32 29
dev@32 30 emitFastRewind() {
dev@32 31 this.audioService.seekBy(-5);
dev@32 32 }
dev@32 33
dev@32 34 emitFastRewindStart() {
dev@32 35 this.audioService.seekToStart();
dev@32 36 }
dev@32 37
dev@32 38 emitVolumeChanged(value: number) {
dev@32 39 this.audioService.setVolume(value);
dev@32 40 }
dev@32 41
dev@32 42
dev@32 43 // TODO seems wrong to be repeating myself
dev@32 44 isPlaying(): boolean {
dev@32 45 return this.audioService.isPlaying();
dev@32 46 }
dev@21 47 }