22import os
33import time
44
5- from mpos import Activity , Intent , sdcard
6- import mpos .ui
5+ from mpos import Activity , Intent , sdcard , get_event_name
76import mpos .audio .audioflinger as AudioFlinger
87
98class MusicPlayer (Activity ):
@@ -14,7 +13,7 @@ class MusicPlayer(Activity):
1413 def onCreate (self ):
1514 screen = lv .obj ()
1615 # the user might have recently plugged in the sd card so try to mount it
17- mpos . sdcard .mount_with_optional_format ('/sdcard' )
16+ sdcard .mount_with_optional_format ('/sdcard' )
1817 self .file_explorer = lv .file_explorer (screen )
1918 self .file_explorer .explorer_open_dir ('M:/' )
2019 self .file_explorer .align (lv .ALIGN .CENTER , 0 , 0 )
@@ -29,12 +28,12 @@ def onCreate(self):
2928
3029 def onResume (self , screen ):
3130 # the user might have recently plugged in the sd card so try to mount it
32- mpos . sdcard .mount_with_optional_format ('/sdcard' ) # would be good to refresh the file_explorer so the /sdcard folder shows up
31+ sdcard .mount_with_optional_format ('/sdcard' ) # would be good to refresh the file_explorer so the /sdcard folder shows up
3332
3433 def file_explorer_event_cb (self , event ):
3534 event_code = event .get_code ()
3635 if event_code not in [2 ,19 ,23 ,24 ,25 ,26 ,27 ,28 ,29 ,30 ,31 ,32 ,33 ,47 ,49 ,52 ]:
37- name = mpos . ui . get_event_name (event_code )
36+ name = get_event_name (event_code )
3837 #print(f"file_explorer_event_cb {event_code} with name {name}")
3938 if event_code == lv .EVENT .VALUE_CHANGED :
4039 path = self .file_explorer .explorer_get_current_path ()
0 commit comments