Upgrade Playlist Features

This commit is contained in:
2025-12-09 17:20:01 +08:00
parent 577990de69
commit 8bd2780688
683 changed files with 91812 additions and 81260 deletions

View File

@@ -1,32 +1,32 @@
#pragma once
#include <functional>
#include <esp_timer.h>
#include <esp_pm.h>
class SleepTimer {
public:
SleepTimer(int seconds_to_light_sleep = 20, int seconds_to_deep_sleep = -1);
~SleepTimer();
void SetEnabled(bool enabled);
void OnEnterLightSleepMode(std::function<void()> callback);
void OnExitLightSleepMode(std::function<void()> callback);
void OnEnterDeepSleepMode(std::function<void()> callback);
void WakeUp();
private:
void CheckTimer();
esp_timer_handle_t sleep_timer_ = nullptr;
bool enabled_ = false;
int ticks_ = 0;
int seconds_to_light_sleep_;
int seconds_to_deep_sleep_;
bool in_light_sleep_mode_ = false;
std::function<void()> on_enter_light_sleep_mode_;
std::function<void()> on_exit_light_sleep_mode_;
std::function<void()> on_enter_deep_sleep_mode_;
};
#pragma once
#include <functional>
#include <esp_timer.h>
#include <esp_pm.h>
class SleepTimer {
public:
SleepTimer(int seconds_to_light_sleep = 20, int seconds_to_deep_sleep = -1);
~SleepTimer();
void SetEnabled(bool enabled);
void OnEnterLightSleepMode(std::function<void()> callback);
void OnExitLightSleepMode(std::function<void()> callback);
void OnEnterDeepSleepMode(std::function<void()> callback);
void WakeUp();
private:
void CheckTimer();
esp_timer_handle_t sleep_timer_ = nullptr;
bool enabled_ = false;
int ticks_ = 0;
int seconds_to_light_sleep_;
int seconds_to_deep_sleep_;
bool in_light_sleep_mode_ = false;
std::function<void()> on_enter_light_sleep_mode_;
std::function<void()> on_exit_light_sleep_mode_;
std::function<void()> on_enter_deep_sleep_mode_;
};