mirror of
https://github.com/cyberboy666/r_e_c_u_r.git
synced 2025-12-12 11:20:15 +01:00
testing current position update
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,2 +1,3 @@
|
||||
*.pyc
|
||||
*.log
|
||||
*.log
|
||||
.vscode
|
||||
@@ -11,25 +11,35 @@ import data_centre
|
||||
|
||||
# logger = data_centre.setup_logging()
|
||||
tk = Tk()
|
||||
|
||||
label1Text = StringVar()
|
||||
label1Text.set('blah')
|
||||
# tk.withdraw()
|
||||
canvas = Frame(tk, width=500, height=400)
|
||||
frame = Frame(tk, width=500, height=400)
|
||||
# data = data_centre.data()
|
||||
video_driver = video_centre.video_driver(canvas)
|
||||
label = Label(tk, textvariable=label1Text)
|
||||
video_driver = video_centre.video_driver(frame)
|
||||
|
||||
label.pack()
|
||||
|
||||
def key(event):
|
||||
print "pressed", repr(event.char)
|
||||
if(event.char in ['0','1','2'] ):
|
||||
if(event.char in ['0', '1', '2']):
|
||||
print 'updating next bank'
|
||||
data_centre.update_next_bank_number(int(event.char))
|
||||
video_driver.next_player.load_content()
|
||||
# This doesn't work, something to fix later
|
||||
# video_driver.next_player.load_content()
|
||||
|
||||
canvas.bind("<Key>", key)
|
||||
|
||||
canvas.pack()
|
||||
canvas.focus_set()
|
||||
def update_current_time():
|
||||
label1Text.set(video_driver.current_player.omx.get_position())
|
||||
tk.after(500, update_current_time)
|
||||
|
||||
frame.bind("<Key>", key)
|
||||
|
||||
frame.pack()
|
||||
frame.focus_set()
|
||||
|
||||
tk.after(500, update_current_time)
|
||||
tk.mainloop()
|
||||
# try:
|
||||
# # video_driver = video_centre.video_driver(canvas)
|
||||
|
||||
@@ -124,7 +124,8 @@ class video_player(object):
|
||||
def load_content(self):
|
||||
self.status = 'LOADING'
|
||||
next_context = data_centre.get_next_context()
|
||||
logger.info('{} is loading now {}'.format(self.name, next_context['location']))
|
||||
logger.info('{} is loading now {}'.format(
|
||||
self.name, next_context['location']))
|
||||
self.omx.load(next_context['location'], 'after-first-frame',
|
||||
'--win 0,0,400,400 --no-osd', '')
|
||||
|
||||
@@ -132,7 +133,6 @@ class video_player(object):
|
||||
self.exit()
|
||||
self.load_content()
|
||||
|
||||
|
||||
#layer = layer + 1
|
||||
|
||||
def set_to_default(self):
|
||||
|
||||
Reference in New Issue
Block a user