Files
@ 5c8b6cd330da
Branch filter:
Location: light9/bin/effectsequencer - annotation
5c8b6cd330da
3.2 KiB
text/plain
fix artnet setup
Ignore-this: b6a4f26b87bb2e61e3391d620c5d1462
Ignore-this: b6a4f26b87bb2e61e3391d620c5d1462
ba6fd5eaa0cf ba6fd5eaa0cf ba6fd5eaa0cf ba6fd5eaa0cf f066d6e874db ba6fd5eaa0cf ba6fd5eaa0cf 1a7e5b07bf17 6fa4288da8a6 ba6fd5eaa0cf ba6fd5eaa0cf ba6fd5eaa0cf ba6fd5eaa0cf ba6fd5eaa0cf 8e0e5b3db301 8e0e5b3db301 8e0e5b3db301 f140153c087c ba6fd5eaa0cf 7772cc48e016 ba6fd5eaa0cf 7772cc48e016 ba6fd5eaa0cf ba6fd5eaa0cf ba6fd5eaa0cf ba6fd5eaa0cf ba6fd5eaa0cf ba6fd5eaa0cf ba6fd5eaa0cf 7772cc48e016 7772cc48e016 f29e26811206 f29e26811206 f29e26811206 f29e26811206 7772cc48e016 7772cc48e016 ba6fd5eaa0cf ba6fd5eaa0cf 4a7594476905 4718ca6f812e 4718ca6f812e 4718ca6f812e 4718ca6f812e 4718ca6f812e 91bcc6c76934 91bcc6c76934 91bcc6c76934 91bcc6c76934 ba6fd5eaa0cf ba6fd5eaa0cf 7772cc48e016 7772cc48e016 7772cc48e016 7772cc48e016 b680d6f50a93 1a7e5b07bf17 1a7e5b07bf17 1a7e5b07bf17 ba6fd5eaa0cf ba6fd5eaa0cf b680d6f50a93 ba6fd5eaa0cf ba6fd5eaa0cf ba6fd5eaa0cf ba6fd5eaa0cf ba6fd5eaa0cf ba6fd5eaa0cf ba6fd5eaa0cf ba6fd5eaa0cf 7772cc48e016 7772cc48e016 ba6fd5eaa0cf 7772cc48e016 7772cc48e016 7772cc48e016 7772cc48e016 ba6fd5eaa0cf 7772cc48e016 7772cc48e016 ba6fd5eaa0cf ba6fd5eaa0cf ba6fd5eaa0cf ba6fd5eaa0cf ba6fd5eaa0cf ba6fd5eaa0cf ba6fd5eaa0cf 7772cc48e016 ba6fd5eaa0cf ba6fd5eaa0cf ba6fd5eaa0cf ba6fd5eaa0cf ba6fd5eaa0cf ba6fd5eaa0cf ba6fd5eaa0cf | #!bin/python
"""
plays back effect notes from the timeline
"""
from run_local import log
from twisted.internet import reactor
from greplin.scales.cyclonehandler import StatsHandler
from rdfdb.syncedgraph import SyncedGraph
from light9 import networking, showconfig
from greplin import scales
import optparse, sys, logging
import cyclone.web
from rdflib import URIRef
from light9.effect.sequencer import Sequencer, Updates
from light9.collector.collector_client import sendToCollector
from light9 import clientsession
class App(object):
def __init__(self, show, session):
self.show = show
self.session = session
self.graph = SyncedGraph(networking.rdfdb.url, "effectSequencer")
self.graph.initiallySynced.addCallback(self.launch)
self.stats = scales.collection(
'/',
scales.PmfStat('sendLevels', recalcPeriod=1),
scales.PmfStat('getMusic', recalcPeriod=1),
scales.PmfStat('evals', recalcPeriod=1),
scales.PmfStat('sendOutput', recalcPeriod=1),
scales.IntStat('errors'),
)
def launch(self, *args):
self.seq = Sequencer(
self.graph,
lambda settings: sendToCollector(
'effectSequencer',
self.session,
settings,
# This seems to be safe here (and lets us get from
# 20fpx to 40fpx), even though it leads to big stalls
# if I use it on KC.
useZmq=True))
self.cycloneApp = cyclone.web.Application(handlers=[
(r'/()', cyclone.web.StaticFileHandler, {
"path": "light9/effect/",
"default_filename": "sequencer.html"
}),
(r'/updates', Updates),
(r'/stats/(.*)', StatsHandler, {
'serverName': 'effectsequencer'
}),
],
debug=True,
seq=self.seq,
graph=self.graph,
stats=self.stats)
reactor.listenTCP(networking.effectSequencer.port, self.cycloneApp)
log.info("listening on %s" % networking.effectSequencer.port)
if __name__ == "__main__":
parser = optparse.OptionParser()
parser.add_option(
'--show',
help='show URI, like http://light9.bigasterisk.com/show/dance2008',
default=showconfig.showUri())
parser.add_option("-v",
"--verbose",
action="store_true",
help="logging.DEBUG")
parser.add_option("--twistedlog",
action="store_true",
help="twisted logging")
clientsession.add_option(parser)
(options, args) = parser.parse_args()
log.setLevel(logging.DEBUG if options.verbose else logging.INFO)
if not options.show:
raise ValueError("missing --show http://...")
session = clientsession.getUri('effectSequencer', options)
app = App(URIRef(options.show), session)
if options.twistedlog:
from twisted.python import log as twlog
twlog.startLogging(sys.stderr)
reactor.run()
|