2 #include <Process/TypeConversion.hpp>
4 #include <LocalTree/BaseCallbackWrapper.hpp>
6 #include <score/tools/Debug.hpp>
8 #include <ossia/network/base/node.hpp>
15 template <
typename Property>
18 using model_t =
typename Property::model_type;
19 using param_t =
typename Property::param_type;
21 using converter_t = ossia::qt_property_converter<typename Property::param_type>;
24 ossia::net::parameter_base& param_addr, model_t& obj, QObject* context)
29 &m_model, Property::notify, context,
30 [&m = m_model, &addr = addr] {
31 auto newVal = converter_t::convert((m.*Property::get)());
34 auto res = addr.value();
38 addr.push_value(newVal);
45 Qt::QueuedConnection);
47 addr.set_value(converter_t::convert((m_model.*Property::get)()));
51 template <
typename Property,
typename Object>
52 auto add_getProperty(ossia::net::node_base& n, Object& obj, QObject* context)
54 constexpr
const auto t
55 = ossia::qt_property_converter<typename Property::param_type>::val;
56 auto node = n.create_child(Property::name);
59 auto addr = node->create_parameter(t);
62 addr->set_access(ossia::access_mode::GET);
64 return std::make_unique<GetPropertyWrapper<Property>>(*addr, obj, context);
Local tree provides a way to extend the tree given through the Engine::Network::LocalDevice.
Definition: BaseCallbackWrapper.hpp:9
Definition: BaseProperty.hpp:12
Definition: GetProperty.hpp:17