# HG changeset patch # User Drew Perttula # Date 2019-06-02 11:37:14 # Node ID c81f86f3d65ab0a6ea50101d01ab17d4f80abd19 # Parent 4dd977d11dcac1f6a7f52190ad59121918590d1b effecteval is mostly obsolete, but now it can at least show a list of effects used in a song (which seq can too) Ignore-this: c24e4c1c3ccd839e79b1b2fb19ee996a diff --git a/bin/effecteval b/bin/effecteval --- a/bin/effecteval +++ b/bin/effecteval @@ -7,8 +7,6 @@ import cyclone.web, cyclone.websocket, c import sys, optparse, logging, json, itertools from rdflib import URIRef, Literal -sys.path.append('/usr/lib/pymodules/python2.7/') # for numpy, on rpi -sys.path.append('/usr/lib/python2.7/dist-packages') # For numpy from light9 import networking, showconfig from light9.effecteval.effect import EffectNode from light9.effect.edit import getMusicStatus, songNotePatch @@ -103,11 +101,20 @@ class SongEffectsUpdates(cyclone.websock songs = list(self.graph.items(playlist)) out = [] for s in songs: - out.append({'uri': s, 'label': self.graph.label(s)}) - out[-1]['effects'] = [{ - 'uri': uri, - 'label': self.graph.label(uri) - } for uri in sorted(self.graph.objects(s, L9['effect']))] + out.append({'uri': s, 'label': self.graph.label(s), 'effects': []}) + seen = set() + for n in self.graph.objects(s, L9['note']): + for uri in self.graph.objects(n, L9['effectClass']): + if uri in seen: + continue + seen.add(uri) + out[-1]['effects'].append({ + 'uri': uri, + 'label': self.graph.label(uri) + }) + out[-1]['effects'].sort(key=lambda e: e['uri']) + + self.sendMessage({'songs': out}) diff --git a/light9/effecteval/effect-components.html b/light9/effecteval/effect-components.html --- a/light9/effecteval/effect-components.html +++ b/light9/effecteval/effect-components.html @@ -16,9 +16,10 @@ label="{{effect.label}}"> -
  • - -
  • + @@ -52,7 +53,7 @@