MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / expanded_json

Function expanded_json

app/workflow/workflow.cpp:470–489  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

468 engine::audio::WavPcm16Sink().write(path, engine::audio::AudioBuffer{
469 audio.sample_rate,
470 audio.channels,
471 audio.samples,
472 });
473}
474
475engine::io::json::Value expanded_json(const engine::io::json::Value & value, const WorkflowContext & context) {
476 if (value.is_string()) {
477 return engine::io::json::Value::make_string(expand_value(value.as_string(), context));
478 }
479 if (value.is_array()) {
480 engine::io::json::Value::Array out;
481 for (const auto & item : value.as_array()) {
482 out.push_back(expanded_json(item, context));
483 }
484 return engine::io::json::Value::make_array(std::move(out));
485 }
486 if (value.is_object()) {
487 engine::io::json::Value::Object out;
488 for (const auto & [key, item] : value.as_object()) {
489 out.emplace(key, expanded_json(item, context));
490 }
491 return engine::io::json::Value::make_object(std::move(out));
492 }

Callers 3

run_model_step_implFunction · 0.85
run_chunked_model_stepFunction · 0.85
run_model_step_foreachFunction · 0.85

Calls 4

expand_valueFunction · 0.85
is_stringMethod · 0.80
is_arrayMethod · 0.80
is_objectMethod · 0.80

Tested by

no test coverage detected