Macro libspa::pod::object

source ·
macro_rules! object {
    ($type_:expr, $id:expr, $($properties:expr),* $(,)?) => { ... };
}
Expand description

A macro for creating a new Object with properties.

The macro accepts the object type, id and a list of properties, separated by commas.

§Examples:

Create an Object.

use libspa::pod::{object, property};

let pod_object = object!{
    libspa::utils::SpaTypes::ObjectParamFormat,
    libspa::param::ParamType::EnumFormat,
    property!(
        libspa::param::format::FormatProperties::MediaType,
        Id,
        libspa::param::format::MediaType::Video
    ),
    property!(
        libspa::param::format::FormatProperties::MediaSubtype,
        Id,
        libspa::param::format::MediaSubtype::Raw
    ),
};