Files
radiantwave/src/home.h
T
NeilClack d60a8bd7fb
build-dev / nix-build (push) Successful in 46s
Add WiFi prompt
2026-08-28 15:35:57 -05:00

54 lines
1.3 KiB
C++

#pragma once
#include "page.h"
#include "network/license_status.h"
#include "text_cache.h"
#include <SDL3_ttf/SDL_ttf.h>
#include <string>
#include <vector>
struct TextLine {
SDL_Texture* texture = nullptr;
float width = 0;
float height = 0;
};
class Home : public Page {
public:
void onPush(AppState& state) override;
void onResume(AppState& state) override;
void onPause(AppState& state) override;
void onPop(AppState& state) override;
void handleEvent(const SDL_Event& event) override;
void update(float dt) override;
void render(SDL_Renderer* renderer) override;
private:
void createTextures(AppState& state);
void destroyTextures();
void refreshStatus();
void syncProclamationsIfEmpty(AppState& state);
std::string audioStatus() const;
TextLine title_;
TextLine play_;
TextLine settings_;
TextLine bg_;
TextLine wifiNote_;
AppState* state_ = nullptr;
float playY_ = 0;
float settingsY_ = 0;
std::string email_;
std::string license_;
std::string ssid_;
std::string dateFormat_;
bool internet_ = false;
float internetRefreshTimer_ = 0.0f;
TTF_Font* footerFont_ = nullptr;
std::vector<CachedText> footerNames_;
std::vector<CachedText> footerValues_;
};