Files
lisael-box/main/net/podcast.h
T
Clément Saillant e35058f53d chore(box): commit firmware base + feature docs
Backfills the working firmware that had stayed uncommitted across the
build sessions, so the branch is self-contained.

- audio: audio_player, radio_pipeline, sd_player, calm_tone, aac_player
- net: podcast (RSS), udp_log
- modes: balloons, plus calm/games/radio tweaks
- ui: fonts header, icons; build files (CMakeLists, idf_component.yml,
  sdkconfig.defaults)
- docs/superpowers: Histoires design + plan

Note: sdkconfig stays gitignored (Wi-Fi creds + tuned LFN/FS/mbedtls
settings); a fresh checkout must reconfigure those.
2026-06-15 00:20:47 +02:00

44 lines
1.6 KiB
C

// Radio France youth podcasts for Lisael Box.
//
// Fetches a show's RSS feed over HTTPS, extracts the latest episode's audio
// enclosure (AAC/.m4a) and downloads it to the microSD card, where the AAC
// player (aac_player.c) plays it offline. Hybrid model: a background prefetch
// keeps the latest episode local; the Podcasts screen plays the local file.
#pragma once
#include <stddef.h>
#include <stdbool.h>
#include "esp_err.h"
#ifdef __cplusplus
extern "C" {
#endif
// Number of configured shows, and per-show accessors.
int lisael_podcast_count(void);
const char *lisael_podcast_title(int idx);
const char *lisael_podcast_id(int idx);
// Absolute SD path of a show's downloaded episode ("/sdcard/podcasts/<id>.m4a").
void lisael_podcast_local_path(int idx, char *buf, size_t n);
// True if a downloaded episode exists locally for this show.
bool lisael_podcast_have_local(int idx);
// Fetch the RSS feed and write the latest episode's enclosure URL into url_out.
esp_err_t lisael_podcast_latest_url(int idx, char *url_out, size_t url_sz);
// Ensure the latest episode is downloaded to SD. Fetches the RSS, and if the
// latest enclosure differs from what's stored (or no local file), downloads it.
// Returns ESP_OK when a local file is ready to play.
esp_err_t lisael_podcast_sync(int idx);
// List the downloaded episode files on the SD card (/sdcard/podcasts/*.m4a).
// Fills paths[i] (absolute) and labels[i] (human title). Returns the count
// (<= max). Used by the "Sons" screen to browse/play downloaded episodes.
int lisael_podcast_list_local(char paths[][128], char labels[][48], int max);
#ifdef __cplusplus
}
#endif