changeset 307:686df28153a9

path and port fixes to make ascoltami work
author drewp@bigasterisk.com
date Fri, 16 Jun 2006 16:54:09 +0000
parents 41830567a8d0
children 3536b1e4dc8b
files bin/ascoltami light9/networking.py light9/showconfig.py
diffstat 3 files changed, 14 insertions(+), 32 deletions(-) [+]
line wrap: on
line diff
--- a/bin/ascoltami	Sun Mar 18 23:46:03 2007 +0000
+++ b/bin/ascoltami	Fri Jun 16 16:54:09 2006 +0000
@@ -22,6 +22,9 @@
 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 @@
     
         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)
--- a/light9/networking.py	Sun Mar 18 23:46:03 2007 +0000
+++ b/light9/networking.py	Fri Jun 16 16:54:09 2006 +0000
@@ -4,20 +4,20 @@
 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
--- a/light9/showconfig.py	Sun Mar 18 23:46:03 2007 +0000
+++ b/light9/showconfig.py	Fri Jun 16 16:54:09 2006 +0000
@@ -24,30 +24,10 @@
     /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")