diff --git a/light9/ascoltami/Light9AscoltamiUi.ts b/light9/ascoltami/Light9AscoltamiUi.ts --- a/light9/ascoltami/Light9AscoltamiUi.ts +++ b/light9/ascoltami/Light9AscoltamiUi.ts @@ -9,10 +9,11 @@ import { PlainViewState } from "../web/L import { getTopGraph } from "../web/RdfdbSyncedGraph"; import { SyncedGraph } from "../web/SyncedGraph"; import { TimingUpdate } from "./main"; +import { ResourceDisplay } from '../web/ResourceDisplay'; export { Light9TimelineAudio } from "../web/light9-timeline-audio"; export { Light9CursorCanvas } from "../web/Light9CursorCanvas"; export { RdfdbSyncedGraph } from "../web/RdfdbSyncedGraph"; - +export { ResourceDisplay } from "../web/ResourceDisplay"; const $V = Sylvester.Vector.create; debug.enable("*"); @@ -36,6 +37,7 @@ export class Light9AscoltamiUi extends L @property() isPlaying: boolean = false; @property() show: NamedNode | null = null; @property() song: NamedNode | null = null; + @property() requestedSong: NamedNode | null = null; @property() currentDuration: number = 0; @property() zoom: Zoom; @property() overviewZoom: Zoom; @@ -65,40 +67,47 @@ export class Light9AscoltamiUi extends L render() { return html` - - -

ascoltami [metrics]

+ -
-
- - - -
+ + +
+
+ + + + +
-
- - - - - -
`; +
+ + + + + +
`; } onCmdStop(ev?: MouseEvent): void { @@ -150,9 +159,12 @@ export class Light9AscoltamiUi extends L this.show = new NamedNode(config.show); this.times = config.times; document.title = document.title.replace("{{host}}", config.host); - const h1 = document.querySelector("h1")!; - h1.innerText = h1.innerText.replace("{{host}}", config.host); + try { + const h1 = document.querySelector("h1")!; + h1.innerText = h1.innerText.replace("{{host}}", config.host); + } catch (e) { + } byId("nav").innerText = navigator.userAgent; var updateFreq = navigator.userAgent.indexOf("Linux") != -1 ? 10 : 2; if (navigator.userAgent.match(/Windows NT/)) { @@ -185,7 +197,7 @@ export class Light9AscoltamiUi extends L }; }); } - + @property() songList: NamedNode[] = [] constructor() { super(); this.bindKeys(); @@ -194,6 +206,21 @@ export class Light9AscoltamiUi extends L getTopGraph().then((g) => { this.graph = g; this.musicSetup(); // async + this.graph.runHandler(this.graphChanged.bind(this), 'loadsongs'); }); } + graphChanged() { + this.songList = [] + try { + const playList = this.graph.uriValue(// + this.graph.Uri('http://light9.bigasterisk.com/show/dance2022'), + this.graph.Uri(':playList')); + log(playList) + this.songList = this.graph.items(playList) as NamedNode[]; + } catch (e) { + log('no playlist yet') + } + log(this.songList.length); + + } }