changeset 1678:a88e082d2507

a little more sequencer reload speed Ignore-this: 1a9c21c58bff0b430b20798b1898eec
author drewp@bigasterisk.com
date Sun, 11 Jun 2017 19:16:11 +0000
parents 0802069ff063
children 12d67c7e006d
files light9/effect/sequencer.py
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/light9/effect/sequencer.py	Sun Jun 11 21:04:13 2017 +0000
+++ b/light9/effect/sequencer.py	Sun Jun 11 19:16:11 2017 +0000
@@ -92,12 +92,14 @@
         originTime = floatVal(uri, L9['originTime'])
         self.points = []
         for curve in g.objects(uri, L9['curve']):
-            if g.value(curve, L9['attr']) != L9['strength']:
+            po = list(g.predicate_objects(curve))
+            if dict(po).get(L9['attr'], None) != L9['strength']:
                 continue
-            for point in g.objects(curve, L9['point']):
+            for point in [row[1] for row in po if row[0] == L9['point']]:
+                po2 = dict(g.predicate_objects(point))
                 self.points.append((
-                    originTime + floatVal(point, L9['time']),
-                    floatVal(point, L9['value'])))
+                    originTime + float(po2[L9['time']]),
+                    float(po2[L9['value']])))
             self.points.sort()
         
     def activeAt(self, t):
@@ -175,8 +177,8 @@
         g = self.graph
 
         sharedEffectOutputs = {}
-
         for song in g.subjects(RDF.type, L9['Song']):
+            # ideally, wrap this (or smaller) in a sub-handler to run less on each patch
             self.notes[song] = []
             for note in g.objects(song, L9['note']):
                 self.notes[song].append(Note(g, note, effecteval, sharedEffectOutputs))