#pragma once #include #include #include #include namespace radiantwave::db { struct ProclamationRecord; struct AudioFileRecord; } namespace radiantwave::scroller { // A single color in an RGBA palette (independent of the DB layer). struct StreamColor { uint8_t r = 0; uint8_t g = 0; uint8_t b = 0; uint8_t a = 255; }; // Full passes each user-selected proclamation plays before the default is // shown, and vice versa. Adjust here to tune how long each text stays up. inline constexpr int kSelectedRepeatCount = 20; inline constexpr int kDefaultRepeatCount = 10; struct ProclamationStream { std::string name; std::vector words; int repeat = 1; // full passes before the stream advances int completed = 0; // passes fully consumed so far int wordsPlaced = 0; // words consumed in the current partial pass std::vector palette; int colorIndex = 0; // next palette color to apply to a line int solfeggio_frequency_id = 0; std::string audioFilename; // empty = never touch audio }; // Builds the ordered stream list by interleaving the selected proclamations // with the default: each selected proclamation (in database order) plays // `kSelectedRepeatCount` passes, then the default plays `kDefaultRepeatCount` // passes, then the next selected proclamation, and so on. The first // user-selected proclamation always plays first. If nothing is selected, only // the default plays. `palettesByFreqId` and `audioByFreqId` are // database-derived lookups; `fallbackPalette` is used for the default stream // and unknown frequencies. std::vector buildStreams( const std::vector& proclamations, const std::unordered_map>& palettesByFreqId, const std::vector& fallbackPalette, const std::unordered_map& audioByFreqId, const std::string& defaultProclamationId); } // namespace radiantwave::scroller