Changeset - d8202a0a7fd5
[Not reviewed]
default
0 7 0
Drew Perttula - 13 years ago 2012-06-13 04:27:48
drewp@bigasterisk.com
fix up musicpad and wavecurve. ascoltami2 can now use relative paths in the config
Ignore-this: eb95f50f54f14275f1f031ccb7fbb97f
7 files changed with 14 insertions and 16 deletions:
0 comments (0 inline, 0 general)
bin/curvecalc
Show inline comments
 
@@ -262,8 +262,8 @@ def main():
 
    subtermPath = graphPathForSubterms(song)
 
    try:
 
        graph.parse(subtermPath, format='n3')
 
    except urllib2.URLError, e:
 
        if e.reason.errno != 2:
 
    except IOError, e:
 
        if e.errno != 2:
 
            raise
 
        log.info("%s not found, starting with empty graph" % subtermPath)
 
    
bin/listsongs
Show inline comments
 
#!/usr/bin/python
 
#!bin/python
 

	
 
"""for completion, print the available song uris on stdout
 

	
bin/musicPad
Show inline comments
 
#!/usr/bin/python
 
#!bin/python
 
"""
 
rewrite all the songs with silence at the start and end
 
"""
 
@@ -14,9 +14,6 @@ introPad = 4
 
postPad = 9 # 5 + autostop + 4
 

	
 
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 playlist.allSongPaths():
 
    log.info("read %s", p)
 
    inputWave = wave.open(p, 'r')
bin/wavecurve
Show inline comments
 
#!/usr/bin/env python
 
#!bin/python
 
import optparse
 
import run_local
 
from light9.wavepoints import simp
 
@@ -31,7 +31,7 @@ if options.all:
 

	
 
    playlist = Playlist.fromShow(showconfig.getGraph(), showconfig.showUri())
 
    for song in playlist.allSongs():
 
        inpath = playlist.songPath(song)
 
        inpath = showconfig.songOnDisk(song)
 
        for curveName, t in [('music', .01),
 
                             ('smooth_music', .07)]:
 
            outpath = showconfig.curvesDir() + "/%s-%s" % (
light9/ascoltami/player.py
Show inline comments
 
@@ -32,7 +32,7 @@ class Player(object):
 
        bus.add_signal_watch()
 

	
 
        def on_any(bus, msg):
 
            print bus, msg, msg.type
 
            #print bus, msg, msg.type
 
            if msg.type == gst.MESSAGE_EOS:
 
                if self.onEOS is not None:
 
                    self.onEOS(self.getSong())
light9/ascoltami/playlist.py
Show inline comments
 
from light9.showconfig import getSongsFromShow
 
from light9.showconfig import getSongsFromShow, songOnDisk
 
from light9.namespaces import L9
 

	
 
class NoSuchSong(ValueError):
 
@@ -25,21 +25,22 @@ class Playlist(object):
 
                             currentSong)
 

	
 
        return nextSong
 

	
 
    def allSongs(self):
 
        """Returns a list of all song URIs in order."""
 
        return self.songs
 
    
 
    def allSongPaths(self):
 
        """Returns a list of the filesystem paths to all songs in order."""
 
        paths = []
 
        for song in self.songs:
 
            paths.append(self.songPath(song))
 
            paths.append(songOnDisk(song))
 
        return paths
 
    
 
    def songPath(self, uri):
 
        """filesystem path to a song"""
 
        p = self.graph.value(uri, L9['showPath'])
 
        assert p.startswith("file://"), p
 
        return p[len("file://"):]
 
        raise NotImplementedError("see showconfig.songOnDisk")
 
        # maybe that function should be moved to this method
 

	
 
    @classmethod
 
    def fromShow(playlistClass, graph, show):
light9/showconfig.py
Show inline comments
 
@@ -74,7 +74,7 @@ def songOnDisk(song):
 
    if not name:
 
        raise ValueError("Song %r has no :songFilename" % song)
 

	
 
    return path.join(root, name)
 
    return path.abspath(path.join(root, name))
 

	
 
def songFilenameFromURI(uri):
 
    """
0 comments (0 inline, 0 general)