MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ try_scalar()

std::optional< double > MayaFlux::Core::InputValue::try_scalar ( ) const
noexcept

Safe scalar extraction.

Returns
Value, or std::nullopt if this is not a SCALAR.

Definition at line 266 of file InputBinding.cpp.

267{
268 if (type != Type::SCALAR)
269 return std::nullopt;
270 return std::get<double>(data);
271}
@ SCALAR
Single normalized float [-1.0, 1.0] or [0.0, 1.0].
std::variant< double, std::vector< double >, std::vector< uint8_t >, MIDIMessage, OSCMessage > data

References data, SCALAR, and type.