# HG changeset patch
# User drewp@bigasterisk.com
# Date 2022-06-05 01:42:39
# Node ID 1dbbf0db3036667264fc07ee36d3d9a48eb4fad7
# Parent fb7f6cee4537cd60c4550d64163e4aa003b57d67
WIP graph-using songlist; trying to make request-then-play safer ux for song playback
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`
-
-
-
+
-
+
+
+
-
-
-
-
-
-
-
`;
+
+
+
+
+
+
+
`;
}
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);
+
+ }
}