Files
@ 6f49dc917aa3
Branch filter:
Location: light9/bin/inputdemo - annotation
6f49dc917aa3
2.0 KiB
text/plain
start vidref web version. v4l camera frames to web page is working
Ignore-this: 34bcc3b6149a1a3bed31aa5f32a4ddc6
Ignore-this: 34bcc3b6149a1a3bed31aa5f32a4ddc6
0f51a1a5785e 0f51a1a5785e 7772cc48e016 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e 3c523c71da29 0f51a1a5785e 0f51a1a5785e 3c523c71da29 f140153c087c 6fa4288da8a6 c756638275d6 0f51a1a5785e 7772cc48e016 0f51a1a5785e 7772cc48e016 0f51a1a5785e 0f51a1a5785e c33158b367a5 7772cc48e016 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e a38955ba6f40 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e 7772cc48e016 7772cc48e016 7772cc48e016 f066d6e874db 7772cc48e016 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e 7772cc48e016 7772cc48e016 7772cc48e016 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e c756638275d6 c756638275d6 7772cc48e016 c756638275d6 c756638275d6 f066d6e874db 0f51a1a5785e 7772cc48e016 0f51a1a5785e | #!bin/python
import sys
sys.path.append('/usr/lib/python2.7/dist-packages') # For gtk
from twisted.internet import gtk3reactor
gtk3reactor.install()
from twisted.internet import reactor
from rdflib import URIRef
import optparse, logging, time
from gi.repository import Gtk
from run_local import log
from light9 import networking
from light9 import clientsession
from rdfdb.syncedgraph import SyncedGraph
from light9.curvecalc.client import sendLiveInputPoint
class App(object):
def __init__(self):
parser = optparse.OptionParser()
parser.set_usage("%prog [opts] [curve uri]")
parser.add_option("--debug", action="store_true", help="log at DEBUG")
clientsession.add_option(parser)
opts, args = parser.parse_args()
log.setLevel(logging.DEBUG if opts.debug else logging.INFO)
self.session = clientsession.getUri('inputdemo', opts)
self.graph = SyncedGraph(networking.rdfdb.url, "inputdemo")
self.graph.initiallySynced.addCallback(lambda _: self.launch())
self.curve = args[0] if args else URIRef(
'http://light9.bigasterisk.com/show/dance2014/song1/curve/c-1401259747.675542'
)
print("sending points on curve %s" % self.curve)
reactor.run()
def launch(self):
win = Gtk.Window()
slider = Gtk.Scale.new_with_range(orientation=Gtk.Orientation.VERTICAL,
min=0,
max=1,
step=.001)
slider.props.inverted = True
slider.connect('value-changed', self.onChanged)
win.add(slider)
win.parse_geometry('50x250')
win.connect("delete-event", lambda *a: reactor.crash())
win.connect("destroy", lambda *a: reactor.crash())
win.show_all()
def onChanged(self, scale):
t1 = time.time()
d = sendLiveInputPoint(self.curve, scale.get_value())
@d.addCallback
def done(result):
print("posted in %.1f ms" % (1000 * (time.time() - t1)))
App()
|