Files
@ 286a34d9ccba
Branch filter:
Location: light9/bin/musictime - annotation
286a34d9ccba
1.6 KiB
text/plain
vidref videos fill browser width
Ignore-this: 8a8acb7d8963706acb6ec895f7c94ae9
Ignore-this: 8a8acb7d8963706acb6ec895f7c94ae9
cce016abe31e 3c523c71da29 58bbf9f42457 58bbf9f42457 f066d6e874db 82e98aa4d159 7772cc48e016 cce016abe31e 58bbf9f42457 cce016abe31e 7772cc48e016 82e98aa4d159 58bbf9f42457 7772cc48e016 58bbf9f42457 58bbf9f42457 58bbf9f42457 58bbf9f42457 7772cc48e016 7772cc48e016 7772cc48e016 7772cc48e016 7772cc48e016 7772cc48e016 7772cc48e016 7772cc48e016 58bbf9f42457 7772cc48e016 58bbf9f42457 cce016abe31e f066d6e874db 7772cc48e016 58bbf9f42457 58bbf9f42457 58bbf9f42457 cce016abe31e 82e98aa4d159 58bbf9f42457 cce016abe31e cce016abe31e 7772cc48e016 82e98aa4d159 58bbf9f42457 58bbf9f42457 58bbf9f42457 46d319974176 58bbf9f42457 7772cc48e016 58bbf9f42457 58bbf9f42457 58bbf9f42457 cce016abe31e cce016abe31e | #!bin/python
import run_local # noqa
import light9.networking
import tkinter as tk
from twisted.internet import reactor, tksupport, task
from light9.ascoltami.musictime_client import MusicTime
mt = MusicTime()
class MusicTimeTk(tk.Frame, MusicTime):
def __init__(self, master, url):
tk.Frame.__init__(self)
MusicTime.__init__(self, url)
self.timevar = tk.DoubleVar()
self.timelabel = tk.Label(self,
textvariable=self.timevar,
bd=2,
relief='raised',
width=10,
padx=2,
pady=2,
anchor='w')
self.timelabel.pack(expand=1, fill='both')
def print_time(evt, *args):
self.timevar.set(mt.getLatest().get('t', 0))
print(self.timevar.get(), evt.keysym)
self.timelabel.bind('<KeyPress>', print_time)
self.timelabel.bind('<1>', print_time)
self.timelabel.focus()
task.LoopingCall(self.update_time).start(.1)
def update_time(self):
t = self.getLatest().get('t', 0)
self.timevar.set(t)
if __name__ == "__main__":
from optparse import OptionParser
parser = OptionParser()
parser.add_option("-u", "--url", default=light9.networking.musicPlayer.url)
options, args = parser.parse_args()
root = tk.Tk()
root.title("Time")
MusicTimeTk(root, options.url).pack(expand=1, fill='both')
tksupport.install(root, ms=20)
reactor.run()
|