MCPcopy Create free account
hub / github.com/FastLED/FastLED / getPlaylistConfig

Method getPlaylistConfig

src/fl/control/wled.cpp.hpp:510–546  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

508}
509
510fl::json WLED::getPlaylistConfig() const {
511 fl::json playlist = fl::json::object();
512
513 // Preset IDs
514 if (!mPlaylistPresets.empty()) {
515 fl::json ps = fl::json::array();
516 for (const auto& preset : mPlaylistPresets) {
517 ps.push_back(fl::json(static_cast<i64>(preset)));
518 }
519 playlist.set("ps", ps);
520 }
521
522 // Durations
523 if (!mPlaylistDurations.empty()) {
524 fl::json dur = fl::json::array();
525 for (const auto& duration : mPlaylistDurations) {
526 dur.push_back(fl::json(static_cast<i64>(duration)));
527 }
528 playlist.set("dur", dur);
529 }
530
531 // Transitions
532 if (!mPlaylistTransitions.empty()) {
533 fl::json trans = fl::json::array();
534 for (const auto& transition : mPlaylistTransitions) {
535 trans.push_back(fl::json(static_cast<i64>(transition)));
536 }
537 playlist.set("transition", trans);
538 }
539
540 // Other properties
541 playlist.set("repeat", static_cast<i64>(mPlaylistRepeat));
542 playlist.set("end", static_cast<i64>(mPlaylistEnd));
543 playlist.set("r", mPlaylistRandomize);
544
545 return playlist;
546}
547
548const WLEDSegment* WLED::findSegmentById(u8 id) const {
549 for (const auto& seg : mSegments) {

Callers

nothing calls this directly

Calls 5

arrayClass · 0.50
jsonClass · 0.50
emptyMethod · 0.45
push_backMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected