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
* 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)
return fname
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):
def default_profile(self):
device_id = getID()
try:
device_id = plyer.uniqueid.id
@ -132,6 +127,15 @@ class BlocksApp(App):
d = {
'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)
def read_profile(self):

View File

@ -12,6 +12,7 @@ from kivy.clock import Clock
from kivy.properties import StringProperty, BooleanProperty, \
OptionProperty, NumericProperty
from kivy.graphics.texture import Texture
from kivy.graphics import Color, Line
from kivyblocks.ready import WidgetReady
@ -115,9 +116,14 @@ class FFVideo(WidgetReady, Image):
def on_frame(self, *args):
if self._player is None:
return
if self.audio_id is None:
return
self._player.request_channel(self, 'audio', 'open', self.audio_id)
# self._player.request_channel(self, 'audio', 'open', self.audio_id)
p = self._player.get_pts() / self.duration * self.width
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):
if self._update_task:

View File

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