# HG changeset patch # User drewp@bigasterisk.com # Date 2006-06-16 16:54:09 # Node ID 686df28153a9ffc80be250708eb813cb58185300 # Parent 41830567a8d00c757ed6b52fdffa5fab84923c84 path and port fixes to make ascoltami work diff --git a/bin/ascoltami b/bin/ascoltami --- a/bin/ascoltami +++ b/bin/ascoltami @@ -22,6 +22,9 @@ from __future__ import division,nested_s from optparse import OptionParser import os,math,time import Tkinter as tk +#import logging +#log = logging.getLogger() +#log.setLevel(logging.DEBUG) from twisted.internet import reactor,tksupport from twisted.internet.error import CannotListenError @@ -165,11 +168,10 @@ class Player: self.autopausedthissong = False self.mpd.clear() - self.mpd.add(showconfig.songInMpd(MUS['preSong'])) - self.mpd.add(showconfig.songInMpd(song)) - self.mpd.add(showconfig.songInMpd(MUS['postSong'])) - self.filename_var.set(graph.value(song, L9['showPath'])) - self.song_uri = song + self.mpd.add(showconfig.songInMpd(self.pre_post_names[0])) + self.mpd.add(showconfig.songInMpd(song_path)) + self.mpd.add(showconfig.songInMpd(self.pre_post_names[1])) + self.filename_var.set(song_path) self.set_total_time(song) self.mpd.seek(seconds=0, song=0) diff --git a/light9/networking.py b/light9/networking.py --- a/light9/networking.py +++ b/light9/networking.py @@ -4,20 +4,20 @@ from ConfigParser import SafeConfigParse def dmxServerUrl(): #host = os.getenv('DMXHOST', 'localhost') #url = "http://%s:8030" % host - return "http://localhost:%s" % dmxServerPort() + return "http://spot:%s" % dmxServerPort() def dmxServerPort(): return 8030 def musicUrl(): - return "http://localhost:%s" % musicPort() + return "http://score:%s" % musicPort() def musicPort(): return 8040 def mpdServer(): """servername, port""" - return 'dash',6600 + return 'score',6600 def kcPort(): return 8050 diff --git a/light9/showconfig.py b/light9/showconfig.py --- a/light9/showconfig.py +++ b/light9/showconfig.py @@ -24,30 +24,10 @@ def songInMpd(song): /my/music. song is a file in musicDir; this function returns a version starting with the mpd path, but minus the mpd root itself. the mpc ~/.mpdconf """ - - assert isinstance(song, URIRef), "songInMpd now takes URIRefs" - - mpdHome = None - for line in open(path.expanduser("~/.mpdconf")): - if line.startswith("music_directory"): - mpdHome = line.split()[1].strip('"') - if mpdHome is None: - raise ValueError("can't find music_directory in your ~/.mpdconf") - mpdHome = mpdHome.rstrip(path.sep) + path.sep - - songFullPath = songOnDisk(song) - if not songFullPath.startswith(mpdHome): - raise ValueError("the song path %r is not under your MPD music_directory (%r)" % (songFullPath, mpdHome)) - - mpdRelativePath = songFullPath[len(mpdHome):] - if path.join(mpdHome, mpdRelativePath) != songFullPath: - raise ValueError("%r + %r doesn't make the songpath %r" % (mpdHome, mpdRelativePath, songFullPath)) - return mpdRelativePath.encode('ascii') - -def songOnDisk(song): - graph = getGraph() - songFullPath = path.join(root(), graph.value(song, L9['showPath'])) - return songFullPath + + if 'dance2005' in root(): + return "projects/dance2005/%s" % song + raise NotImplementedError def curvesDir(): return path.join(root(),"curves")