@@ -21,7 +21,7 @@ mod player;
2121
2222use core:: * ;
2323use interface:: * ;
24- use player:: { PlayerCommand , PlayerNotification } ;
24+ use player:: PlayerCommand ;
2525use tauri_plugin_window_state:: { AppHandleExt , StateFlags , WindowExt } ;
2626
2727#[ cfg( all(
@@ -83,7 +83,7 @@ fn init(app: AppHandle, colormap_length: u32) -> tauri::Result<ConstsAndUserSett
8383 let settings_json = json ! ( user_settings) ;
8484 _set_user_settings ( & app, settings_json, false ) ?;
8585
86- player:: spawn_task ( ) ;
86+ player:: spawn_task ( app ) ;
8787 Ok ( ConstsAndUserSettings {
8888 constants : Default :: default ( ) ,
8989 user_settings,
@@ -498,22 +498,6 @@ async fn resume_player() {
498498 player:: send ( PlayerCommand :: Resume ) . await ;
499499}
500500
501- #[ tauri:: command]
502- fn get_player_state ( ) -> PlayerState {
503- match player:: recv ( ) {
504- PlayerNotification :: Ok ( state) => PlayerState {
505- is_playing : state. is_playing ,
506- position_sec : state. position_sec ,
507- err : "" . to_string ( ) ,
508- } ,
509- PlayerNotification :: Err ( e_str) => PlayerState {
510- is_playing : false ,
511- position_sec : 0. ,
512- err : e_str,
513- } ,
514- }
515- }
516-
517501#[ inline]
518502async fn _refresh_track_player ( ) {
519503 player:: send ( PlayerCommand :: SetTrack ( ( None , None ) ) ) . await ;
@@ -763,7 +747,6 @@ pub fn run() {
763747 seek_player,
764748 pause_player,
765749 resume_player,
766- get_player_state,
767750 menu:: enable_edit_menu,
768751 menu:: disable_edit_menu,
769752 menu:: enable_axis_zoom_menu,
0 commit comments