This commit is contained in:
yumoqing 2022-08-30 23:16:23 +08:00
parent c13dd66f05
commit 33c728a550
4 changed files with 22 additions and 10 deletions

View File

@ -5,3 +5,5 @@ add script to support local .tmpl and .dspy file translation. it can build dynam
## version 0.3.1 ## version 0.3.1
* uses weakref to collect all the i18n widgets in i18n.py * uses weakref to collect all the i18n widgets in i18n.py
* show video play position

View File

@ -115,12 +115,7 @@ class BlocksApp(App):
print('profile_path=', fname) print('profile_path=', fname)
return fname return fname
def write_profile(self, dic): def default_profile(self):
fname = self.get_profile_name()
with codecs.open(fname,'w','utf-8') as f:
json.dump(dic,f)
def write_default_profile(self):
device_id = getID() device_id = getID()
try: try:
device_id = plyer.uniqueid.id device_id = plyer.uniqueid.id
@ -132,6 +127,15 @@ class BlocksApp(App):
d = { d = {
'device_id': device_id 'device_id': device_id
} }
return d
def write_profile(self, dic):
fname = self.get_profile_name()
with codecs.open(fname,'w','utf-8') as f:
json.dump(dic,f)
def write_default_profile(self):
d = self.default_profile()
self.write_profile(d) self.write_profile(d)
def read_profile(self): def read_profile(self):

View File

@ -12,6 +12,7 @@ from kivy.clock import Clock
from kivy.properties import StringProperty, BooleanProperty, \ from kivy.properties import StringProperty, BooleanProperty, \
OptionProperty, NumericProperty OptionProperty, NumericProperty
from kivy.graphics.texture import Texture from kivy.graphics.texture import Texture
from kivy.graphics import Color, Line
from kivyblocks.ready import WidgetReady from kivyblocks.ready import WidgetReady
@ -115,9 +116,14 @@ class FFVideo(WidgetReady, Image):
def on_frame(self, *args): def on_frame(self, *args):
if self._player is None: if self._player is None:
return return
if self.audio_id is None: # self._player.request_channel(self, 'audio', 'open', self.audio_id)
return p = self._player.get_pts() / self.duration * self.width
self._player.request_channel(self, 'audio', 'open', self.audio_id) with self.canvas.after:
Color(1,1,1,1)
Line()
Line(points=[0, 0, self.width, 0], width=1)
Color(1,0,0,1)
Line(points=[0,1,p,0], width=2)
def __del__(self): def __del__(self):
if self._update_task: if self._update_task:

View File

@ -1 +1 @@
__version__ = '0.3.0' __version__ = '0.3.1'