#ifndef __LVGL_LOTTIE_H__ #define __LVGL_LOTTIE_H__ #include "config.h" extern lv_obj_t *ui_Screen_Lottie; extern lv_obj_t *g_music_preload_lottie; extern uint8_t *g_music_preload_fb; extern char g_music_preload_path[]; extern bool g_music_preload_ready; extern bool resume_music_loop_after_oneshot; /* 持续播放音乐时收到其他指令,播完该指令一次后切回音乐段 */ extern bool resume_calling_loop_after_oneshot; /* 通话循环段被插播时,插播播完后恢复 20%-80% 循环 */ void handle_normal_sticker(uint16_t action_id, const char *path_to_play, int *last_active_page_ptr); bool handle_play_music(uint16_t action_id, const char *path_to_play, int *last_active_page_ptr); bool handle_sentinel_mode(uint16_t action_id, const char *path_to_play, int *last_active_page_ptr); void reset_all_playback_state(void); void switch_to_default_emoji(void); bool handle_stop_music(uint16_t action_id, int *last_active_page_ptr); bool handle_internal_commands(uint32_t bits, int *last_active_page_ptr); void clear_music_preload(void); void try_preload_music_listen_lottie(const char *path); void set_current_lottie_range_time(float start_s, float end_s); /** 通话接听后处于循环段时为 true;与 is_playing_music 类似,供 BLE 直通打断 pending */ bool lvgl_lottie_calling_active_for_ble(void); /** AI 回复循环态(conversation.json)时为 true,供 BLE 持续态直通判断 */ bool lvgl_lottie_ai_respond_loop_active_for_ble(void); /** play_sticker 是否跳过电机:仅 AI 循环内 0x0045、及 direction==0+resume/循环态(误回中);同向重复由 motor 层处理 */ bool lvgl_lottie_should_skip_play_sticker_motor(uint16_t action_id, uint8_t direction); /** 正念 breath 两遍播放窗口内返回 true;BLE 侧据此丢弃所有指令 */ bool lvgl_lottie_mindfulness_block_ble_for_ble(void); /** lottie_anim_completed_cb 内优先调用:若存在「插播中挂起的挂断」,则通知 change_task 回默认并返回 true */ bool lvgl_lottie_completed_try_deferred_hangup(void); /** lottie_anim_completed_cb 内调用:若 AI 回复循环被插播,通知恢复并返回 true */ bool lvgl_lottie_completed_try_resume_ai_respond_loop(void); /** lottie_anim_completed_cb 内调用:若 0x0020/21/2E/2F hearing 段已播完,通知启动 AI 回复循环并返回 true */ bool lvgl_lottie_completed_try_start_ai_respond_loop(void); #endif