diff bin/curvecalc @ 1048:86732ba7d9ae

curvecalc now gets its curves from the rdf graph, and can persist their points there too (save is still an explicit command) Ignore-this: 541488a3f299d2ca77a993118e1b974
author Drew Perttula <drewp@bigasterisk.com>
date Thu, 29 May 2014 06:48:21 +0000
parents a13eee92e60c
children 547d65ea9902
line wrap: on
line diff
--- a/bin/curvecalc	Thu May 29 06:48:08 2014 +0000
+++ b/bin/curvecalc	Thu May 29 06:48:21 2014 +0000
@@ -344,14 +344,9 @@
 
     def onSave(self, *args):
         # only doing curves still. I hope to eliminate all this.
-        with self.graph.currentState() as g:
-            song = g.value(self.session, L9['currentSong'])
-
-            log.info("saving curves for %r", song)
-            self.curveset.save(basename=os.path.join(
-                showconfig.curvesDir(),
-                showconfig.songFilenameFromURI(song)))
-            log.info("saved")
+        log.info("saving curves")
+        self.curveset.save()
+        log.info("saved")
 
     def makeStatusLines(self, master):
         """various labels that listen for dispatcher signals"""
@@ -452,18 +447,7 @@
     except IndexError:
         pass
 
-    curveset = Curveset(sliders=opts.sliders)
-
-    def curvesetReload():
-        # not sure if this clears right or not yet
-        song = graph.value(session, L9['currentSong'])
-        if song is None:
-            return
-        curveset.load(basename=os.path.join(
-            showconfig.curvesDir(),
-            showconfig.songFilenameFromURI(song)),
-                      skipMusic=opts.skip_music)
-    graph.addHandler(curvesetReload)
+    curveset = Curveset(graph=graph, session=session, sliders=opts.sliders)
         
     log.debug("startup: output %s", time.time() - startTime)
 
@@ -504,8 +488,6 @@
     parser.set_usage("%prog [opts] [songURI]")
     parser.add_option("--sliders", action='store_true',
                       help='use hardware sliders')
-    parser.add_option("--skip-music", action='store_true',
-                      help="ignore music and smooth_music curve files")
     parser.add_option("--debug", action="store_true",
                       help="log at DEBUG")
     parser.add_option("--reload", action="store_true",