Changeset - 686df28153a9
[Not reviewed]
default
0 3 0
drewp@bigasterisk.com - 19 years ago 2006-06-16 16:54:09
drewp@bigasterisk.com
path and port fixes to make ascoltami work
3 files changed with 13 insertions and 31 deletions:
0 comments (0 inline, 0 general)
bin/ascoltami
Show inline comments
 
@@ -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)
light9/networking.py
Show inline comments
 
@@ -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
light9/showconfig.py
Show inline comments
 
@@ -25,29 +25,9 @@ def songInMpd(song):
 
    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")
0 comments (0 inline, 0 general)