2026-08-03 10:49:13 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <Arduino.h>
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
|
|
enum class CycleMode : uint8_t {
|
|
|
|
|
Random = 0,
|
|
|
|
|
Chronological = 1,
|
|
|
|
|
ReverseChronological = 2,
|
2026-08-03 19:52:22 -04:00
|
|
|
FavoritesWeighted = 3,
|
|
|
|
|
WeightedChronological = 4,
|
|
|
|
|
WeightedReverseChronological = 5
|
2026-08-03 10:49:13 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
enum class ImageQuality : uint8_t {
|
|
|
|
|
Preview = 0,
|
|
|
|
|
Original = 1
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
enum class MetaPosition : uint8_t {
|
feat: blurred letterbox, portrait pairs, overlay metadata, button fixes
- Letterbox: extend edge pixels outward with blur + fade to solid color
- Portrait: detect and pair portraits side-by-side, fallback to solo
- Metadata: add overlay mode (corner badge), time field, custom date/time
format strings (strftime), font size 1.5x, region-aware for pairs
- Buttons: swap G9/G10 to match physical layout, double-press random
button for deep sleep, SLP indicator drawn before sleep
- Boot: remove redundant 'Loading photos' screen (saves 17s refresh)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-03 15:53:06 -04:00
|
|
|
// Captioned mode (full-width bar)
|
|
|
|
|
CaptionBottom = 0,
|
|
|
|
|
CaptionTop = 1,
|
|
|
|
|
// Overlay mode (corner badge)
|
|
|
|
|
OverlayTopLeft = 2,
|
|
|
|
|
OverlayTopRight = 3,
|
|
|
|
|
OverlayBottomLeft = 4,
|
|
|
|
|
OverlayBottomRight = 5
|
2026-08-03 10:49:13 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Metadata flags bitmask
|
|
|
|
|
constexpr uint8_t META_DATE = 0x01;
|
feat: blurred letterbox, portrait pairs, overlay metadata, button fixes
- Letterbox: extend edge pixels outward with blur + fade to solid color
- Portrait: detect and pair portraits side-by-side, fallback to solo
- Metadata: add overlay mode (corner badge), time field, custom date/time
format strings (strftime), font size 1.5x, region-aware for pairs
- Buttons: swap G9/G10 to match physical layout, double-press random
button for deep sleep, SLP indicator drawn before sleep
- Boot: remove redundant 'Loading photos' screen (saves 17s refresh)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-03 15:53:06 -04:00
|
|
|
constexpr uint8_t META_TIME = 0x20;
|
2026-08-03 10:49:13 -04:00
|
|
|
constexpr uint8_t META_LOCATION = 0x02;
|
|
|
|
|
constexpr uint8_t META_PEOPLE = 0x04;
|
|
|
|
|
constexpr uint8_t META_ALBUM = 0x08;
|
|
|
|
|
constexpr uint8_t META_CAMERA = 0x10;
|
|
|
|
|
|
|
|
|
|
struct Settings {
|
|
|
|
|
// WiFi
|
|
|
|
|
String wifi_ssid;
|
|
|
|
|
String wifi_pass;
|
|
|
|
|
|
|
|
|
|
// Immich
|
|
|
|
|
String immich_url;
|
|
|
|
|
String immich_key;
|
|
|
|
|
|
|
|
|
|
// Slideshow
|
|
|
|
|
uint8_t interval_min;
|
|
|
|
|
CycleMode cycle_mode;
|
|
|
|
|
ImageQuality img_quality;
|
|
|
|
|
|
|
|
|
|
// Display
|
|
|
|
|
uint8_t meta_flags;
|
|
|
|
|
MetaPosition meta_pos;
|
feat: blurred letterbox, portrait pairs, overlay metadata, button fixes
- Letterbox: extend edge pixels outward with blur + fade to solid color
- Portrait: detect and pair portraits side-by-side, fallback to solo
- Metadata: add overlay mode (corner badge), time field, custom date/time
format strings (strftime), font size 1.5x, region-aware for pairs
- Buttons: swap G9/G10 to match physical layout, double-press random
button for deep sleep, SLP indicator drawn before sleep
- Boot: remove redundant 'Loading photos' screen (saves 17s refresh)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-03 15:53:06 -04:00
|
|
|
String date_fmt; // strftime-style, default "%Y-%m-%d"
|
|
|
|
|
String time_fmt; // strftime-style, default "%H:%M:%S"
|
2026-08-03 10:49:13 -04:00
|
|
|
|
2026-08-03 19:52:22 -04:00
|
|
|
// Image pipeline
|
|
|
|
|
uint8_t pipeline_mode; // 0=dynamic, 1=balanced, 2=none
|
|
|
|
|
uint8_t dither_noise; // 1=blue noise dither smoothing ON, 0=OFF
|
|
|
|
|
|
2026-08-03 10:49:13 -04:00
|
|
|
// Device
|
|
|
|
|
uint8_t led_brightness;
|
2026-08-03 19:52:22 -04:00
|
|
|
uint8_t show_battery; // 1 = show battery indicator on display
|
2026-08-03 10:49:13 -04:00
|
|
|
uint32_t queue_cursor;
|
|
|
|
|
String albums_json;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class SettingsManager {
|
|
|
|
|
public:
|
|
|
|
|
void begin();
|
|
|
|
|
Settings get();
|
|
|
|
|
void save(const Settings& s);
|
|
|
|
|
void saveField(const char* key, uint8_t value);
|
2026-08-03 11:00:02 -04:00
|
|
|
void saveField(const char* key, uint32_t value);
|
2026-08-03 10:49:13 -04:00
|
|
|
void saveField(const char* key, const char* value);
|
|
|
|
|
void factoryReset();
|
|
|
|
|
bool isProvisioned();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
String readString(const char* key, const char* defaultValue = "");
|
|
|
|
|
uint8_t readU8(const char* key, uint8_t defaultValue = 0);
|
|
|
|
|
uint32_t readU32(const char* key, uint32_t defaultValue = 0);
|
|
|
|
|
void writeString(const char* key, const String& value);
|
|
|
|
|
void writeU8(const char* key, uint8_t value);
|
|
|
|
|
void writeU32(const char* key, uint32_t value);
|
|
|
|
|
};
|