# HG changeset patch # User Drew Perttula # Date 2017-05-23 06:58:02 # Node ID 7eb3676b8fd6e3fc3592627c9c998a9f3d0dfd07 # Parent 104ff46065659fd604d71d64d8ddf7aaaee0439d more of the fixed add-to-song service Ignore-this: 44b96a929b79ab201a80a6914b117f9d diff --git a/bin/effecteval b/bin/effecteval --- a/bin/effecteval +++ b/bin/effecteval @@ -62,7 +62,7 @@ class SongEffects(PrettyErrorHandler, cy except Exception: # which? song = yield currentSong() - event = self.get_argument('event') or 'default' + event = self.get_argument('event', default='default') log.info("adding to %s", song) diff --git a/light9/effect/edit.py b/light9/effect/edit.py --- a/light9/effect/edit.py +++ b/light9/effect/edit.py @@ -19,6 +19,9 @@ def getMusicStatus(): @inlineCallbacks def songEffectPatch(graph, dropped, song, event, ctx): + """ + some uri was 'dropped' in the timeline. event is 'default' or 'start' or 'end'. + """ with graph.currentState( tripleFilter=(dropped, None, None)) as g: droppedTypes = list(g.objects(dropped, RDF.type)) diff --git a/light9/rdfdb/currentstategraphapi.py b/light9/rdfdb/currentstategraphapi.py --- a/light9/rdfdb/currentstategraphapi.py +++ b/light9/rdfdb/currentstategraphapi.py @@ -10,7 +10,7 @@ class ReadOnlyConjunctiveGraph(object): self.graph = graph def __getattr__(self, attr): - if attr in ['subjects', 'value', 'objects', 'triples']: # not complete + if attr in ['subjects', 'value', 'objects', 'triples', 'label']: # not complete return getattr(self.graph, attr) raise TypeError("can't access %r of read-only graph" % attr) diff --git a/light9/rdfdb/syncedgraph.py b/light9/rdfdb/syncedgraph.py --- a/light9/rdfdb/syncedgraph.py +++ b/light9/rdfdb/syncedgraph.py @@ -125,6 +125,10 @@ class SyncedGraph(CurrentStateGraphApi, self._sender.sendPatch(p).addErrback(self.sendFailed) log.debug('patch is done %s', debugKey) + def suggestPrefixes(self, prefixes): + song note edit should put song: to the song uri + self.addlPrefixes.update(prefixes) + def sendFailed(self, result): """ we asked for a patch to be queued and sent to the master, and diff --git a/light9/subserver/effects.coffee b/light9/subserver/effects.coffee --- a/light9/subserver/effects.coffee +++ b/light9/subserver/effects.coffee @@ -33,6 +33,21 @@ model.addToCurrentSong = (e) -> data: {drop: e.uri} }) +model.addMomentary = (e) -> + $.ajax({ + type: 'POST' + url: '/effectEval/songEffects' + data: {drop: e.uri, event: 'start'} + }) + +model.addMomentaryUp = (e) -> + $.ajax({ + type: 'POST' + url: '/effectEval/songEffects' + data: {drop: e.uri, event: 'end'} + }) + + reconnectingWebSocket "../effectsUpdates", (msg) -> model.chases(msg.chases) if msg.chases? model.classes(msg.classes) if msg.classes? diff --git a/light9/subserver/effects.jade b/light9/subserver/effects.jade --- a/light9/subserver/effects.jade +++ b/light9/subserver/effects.jade @@ -30,6 +30,7 @@ html | a(data-bind="attr: {href: uri}, text: label") button(data-bind="click: $root.addToCurrentSong") Add to current song + button(data-bind="event: { mousedown: $root.addMomentary, mouseup: $root.addMomentaryUp }") Add momentary div code(data-bind="text: code") diff --git a/show/dance2017/playlist.n3 b/show/dance2017/playlist.n3 --- a/show/dance2017/playlist.n3 +++ b/show/dance2017/playlist.n3 @@ -14,22 +14,22 @@ show:dance2017 :playList ( sh:song16 sh:song17 sh:song18 ) . -sh:song1 a :Song; rdfs:label "01"; :songFilename "01.wav" . -sh:song2 a :Song; rdfs:label "02"; :songFilename "02.wav" . -sh:song3 a :Song; rdfs:label "03"; :songFilename "03.wav" . -sh:song4 a :Song; rdfs:label "04"; :songFilename "04.wav" . -sh:song5 a :Song; rdfs:label "05"; :songFilename "05.wav" . -sh:song6 a :Song; rdfs:label "06"; :songFilename "06.wav" . -sh:song7 a :Song; rdfs:label "07"; :songFilename "07.wav" . -sh:song8 a :Song; rdfs:label "08"; :songFilename "08.wav" . -sh:song9 a :Song; rdfs:label "09"; :songFilename "09.wav" . -sh:song10 a :Song; rdfs:label "10"; :songFilename "10.wav" . -sh:song11 a :Song; rdfs:label "11"; :songFilename "11.wav" . -sh:song12 a :Song; rdfs:label "12"; :songFilename "12.wav" . -sh:song13 a :Song; rdfs:label "13"; :songFilename "13.wav" . -sh:song14 a :Song; rdfs:label "14"; :songFilename "14.wav" . -sh:song15 a :Song; rdfs:label "15"; :songFilename "15.wav" . -sh:song16 a :Song; rdfs:label "16"; :songFilename "16.wav" . -sh:song17 a :Song; rdfs:label "17"; :songFilename "17.wav" . +sh:song1 a :Song; rdfs:label "01"; :songFilename "01-out.wav" . +sh:song2 a :Song; rdfs:label "02"; :songFilename "02-out.wav" . +sh:song3 a :Song; rdfs:label "03"; :songFilename "03-out.wav" . +sh:song4 a :Song; rdfs:label "04"; :songFilename "04-out.wav" . +sh:song5 a :Song; rdfs:label "05"; :songFilename "05-out.wav" . +sh:song6 a :Song; rdfs:label "06"; :songFilename "06-out.wav" . +sh:song7 a :Song; rdfs:label "07"; :songFilename "07-out.wav" . +sh:song8 a :Song; rdfs:label "08"; :songFilename "08-out.wav" . +sh:song9 a :Song; rdfs:label "09"; :songFilename "09-out.wav" . +sh:song10 a :Song; rdfs:label "10"; :songFilename "10-out.wav" . +sh:song11 a :Song; rdfs:label "11"; :songFilename "11-out.wav" . +sh:song12 a :Song; rdfs:label "12"; :songFilename "12-out.wav" . +sh:song13 a :Song; rdfs:label "13"; :songFilename "13-out.wav" . +sh:song14 a :Song; rdfs:label "14"; :songFilename "14-out.wav" . +sh:song15 a :Song; rdfs:label "15"; :songFilename "15-africaout.wav" . +sh:song16 a :Song; rdfs:label "16"; :songFilename "16-out.wav" . +sh:song17 a :Song; rdfs:label "17"; :songFilename "17-out.wav" .