diff bin/musicPad @ 617:94039df5cdd9

create Playlist class which is now used in wavecurve, musicPad, and ascoltami2. Ignore-this: da54d0239906e81ad5d95741d22f5975 Several other refactorings. Also, totally untested.
author David McClosky <dmcc@bigasterisk.com>
date Tue, 22 Jun 2010 04:41:11 +0000
parents 58e2e6ca1ff1
children 46d319974176
line wrap: on
line diff
--- a/bin/musicPad	Tue Jun 22 02:27:30 2010 +0000
+++ b/bin/musicPad	Tue Jun 22 04:41:11 2010 +0000
@@ -6,20 +6,18 @@
 sys.path.append(".")
 from light9 import networking, showconfig
 from light9.namespaces import L9
+from light9.ascoltami.playlist import Playlist
 logging.basicConfig(level=logging.INFO)
 log = logging.getLogger()
 
 introPad = 4
 postPad = 9 # 5 + autostop + 4
 
-graph = showconfig.getGraph()
+playlist = Playlist.fromShow(showconfig.getGraph(), showconfig.showUri())
 # instead of taking a show uri like it should, i just convert every
 # path i find in the graph (hoping that you only loaded statements for
 # the current show)
-for p in sorted(graph.objects(None, L9['showPath'])):
-    assert p.startswith("file://")
-    p = p[len("file://"):]
-    
+for p in playlist.allSongPaths():
     log.info("read %s", p)
     inputWave = wave.open(p, 'r')