presentation zoom and legal info

This commit is contained in:
2020-04-01 15:52:21 +02:00
committed by smuddy
parent 797b585395
commit b8fbcb4b9a
11 changed files with 111 additions and 8 deletions

View File

@@ -7,6 +7,9 @@ import {ShowSongService} from '../../shows/services/show-song.service';
import {SongService} from '../../songs/services/song.service';
import {Song} from '../../songs/services/song';
import {Section, TextRenderingService} from '../../songs/services/text-rendering.service';
import {faSearchPlus} from '@fortawesome/free-solid-svg-icons/faSearchPlus';
import {faSearchMinus} from '@fortawesome/free-solid-svg-icons/faSearchMinus';
import {faDesktop} from '@fortawesome/free-solid-svg-icons/faDesktop';
export interface PresentationSong {
id: string;
@@ -21,11 +24,15 @@ export interface PresentationSong {
})
export class RemoteComponent {
public shows$: Observable<Show[]>;
public show$: Observable<Show>;
public show: Show;
public songs: Song[];
public presentationSongs: PresentationSong[];
public currentShowId: string;
public faZoomIn = faSearchPlus;
public faZoomOut = faSearchMinus;
public faDesktop = faDesktop;
constructor(
private showDataService: ShowDataService,
private showSongService: ShowSongService,
@@ -38,7 +45,7 @@ export class RemoteComponent {
public onShowChanged(change: MatSelectChange): void {
this.currentShowId = change.value;
this.show$ = this.showDataService.read$(change.value);
this.showDataService.read$(change.value).subscribe(_ => this.show = _);
this.showSongService.list$(change.value).subscribe(_ => {
this.presentationSongs = _
.map(song => this.songs.filter(f => f.id == song.songId)[0])
@@ -60,4 +67,17 @@ export class RemoteComponent {
presentationSection: index
})
}
public async onZoomIn() {
debugger
await this.showDataService.update(this.currentShowId, {
presentationZoom: (this.show.presentationZoom ?? 30) + 2,
});
}
public async onZoomOut() {
await this.showDataService.update(this.currentShowId, {
presentationZoom: (this.show.presentationZoom ?? 30) - 2,
});
}
}