MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
Forma.hpp File Reference

Factory free functions for the Forma surface system. More...

#include "Primitives/Picker.hpp"
#include "Tend.hpp"
+ Include dependency graph for Forma.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  MayaFlux
 Main namespace for the Maya Flux audio engine.
 
namespace  MayaFlux::Portal
 
namespace  MayaFlux::Portal::Forma
 
namespace  MayaFlux::Vruta
 

Functions

Bridge & MayaFlux::Portal::Forma::bridge ()
 Return the application-level Bridge instance.
 
std::shared_ptr< Buffers::FormaBuffer > MayaFlux::Portal::Forma::create_buffer (Graphics::RenderConfig render)
 Construct and register a FormaBuffer without creating a Mapped<T>.
 
std::pair< std::shared_ptr< Layer >, std::shared_ptr< Context > > MayaFlux::Portal::Forma::create_layer (const std::shared_ptr< Core::Window > &window, std::string name)
 Construct a Layer and a Context wired to window.
 
Surface MayaFlux::Portal::Forma::create_surface (SurfaceConfig config)
 Construct a Surface from a SurfaceConfig.
 
void MayaFlux::Portal::Forma::destroy (Surface &surface, uint32_t id)
 Tear down an element and everything related to it.
 
bool MayaFlux::Portal::Forma::initialize (std::shared_ptr< Nodes::NodeGraphManager > node_graph_manager, std::shared_ptr< Buffers::BufferManager > buffer_manager, std::shared_ptr< Vruta::TaskScheduler > scheduler, std::shared_ptr< Vruta::EventManager > event_manager, std::shared_ptr< Core::WindowManager > window_manager)
 Store engine-level references for use by all subsequent Forma calls.
 
void MayaFlux::Portal::Forma::inspect (const std::shared_ptr< Buffers::Buffer > &buf)
 Open a dedicated window inspecting a single Buffer and its processing chain.
 
void MayaFlux::Portal::Forma::inspect (const std::shared_ptr< Nodes::Network::NodeNetwork > &net)
 Open a dedicated window inspecting a NodeNetwork.
 
void MayaFlux::Portal::Forma::inspect (const std::shared_ptr< Nodes::Node > &node)
 Open a dedicated window inspecting a single Node and its modulator tree.
 
void MayaFlux::Portal::Forma::inspect (const std::shared_ptr< Vruta::Event > &ev, std::string_view name={})
 Open a dedicated window inspecting a single Event.
 
void MayaFlux::Portal::Forma::inspect_buffers ()
 Open or show the BufferManager inspection window.
 
void MayaFlux::Portal::Forma::inspect_events ()
 Open or show the EventManager inspection window.
 
void MayaFlux::Portal::Forma::inspect_node_graph ()
 Open or show the NodeGraphManager inspection window.
 
void MayaFlux::Portal::Forma::inspect_scheduler ()
 Open or show the TaskScheduler inspection window.
 
Inspector & MayaFlux::Portal::Forma::inspector ()
 Access the Forma introspection subsystem.
 
bool MayaFlux::Portal::Forma::is_initialized ()
 Whether initialize() has been called successfully.
 
std::pair< Mapped< std::shared_ptr< Kakshya::PlotContainer > >, Surface > MayaFlux::Portal::Forma::plot (std::string title, uint32_t width, uint32_t height, std::shared_ptr< Kakshya::PlotContainer > container, Plot::SeriesSpec spec)
 Create a live plot in a new window.
 
void MayaFlux::Portal::Forma::shutdown ()
 Release stored references.
 

Detailed Description

Factory free functions for the Forma surface system.

Call initialize() once after engine startup to store BufferManager, TaskScheduler, and EventManager references. Subsequent factory calls require only the arguments that legitimately vary per call (Window, geometry function, initial value). This matches the Portal::Text and Portal::Graphics initialization contracts.

Typical sequence:

Portal::Forma::initialize(buffer_manager, scheduler, event_manager);
auto surface = Forma::create_surface(SurfaceConfig { .window = window, .name = "hud" });
auto el = Forma::create_element<float>(surface, geom_fn, 0.5f);
auto bridge = Forma::create_bridge();
bridge.bind(el.state, envelope);
bridge.write(el.state, compute_proc, offsetof(PC, cutoff));
ctx->on_press(el.element.id, IO::MouseButtons::LEFT,
[](uint32_t, glm::vec2){});
std::weak_ptr< Core::Window > window
Definition Picker.cpp:23
void write(std::shared_ptr< MappedState< T > > state, std::function< void(std::span< const float >)> sink)
Definition Bridge.hpp:138
void bind(const ElementRef &ref, std::shared_ptr< Nodes::Node > node, std::function< float(double)> project={})
Drive element value from a Node's output each frame.
Definition Bridge.cpp:45

Definition in file Forma.hpp.