51 const ossia::destination_index& idx;
54 template <std::
size_t N>
56 operator()(
const std::array<float, N>& start,
const std::array<float, N>& end)
58 SCORE_ASSERT(!idx.empty());
59 const auto i = idx[0];
62 if(
auto node = Device::try_getNodeFromAddress(rootNode, address.address))
66 if(
auto dom = as.domain.get().v.target<ossia::vecf_domain<N>>())
68 if(
auto min_v = dom->min[i])
69 d.min = std::min(d.min, (
double)*min_v);
70 if(
auto max_v = dom->max[i])
71 d.max = std::max(d.max, (
double)*max_v);
79 const std::vector<ossia::value>& start,
const std::vector<ossia::value>& end)
81 SCORE_ASSERT(!idx.empty());
82 const auto i = (std::size_t)idx[0];
84 ossia::convert<double>(start[i]), ossia::convert<double>(end[i])};
86 if(
auto node = Device::try_getNodeFromAddress(rootNode, address.address))
90 if(
auto dom = as.domain.get().v.target<ossia::vector_domain>())
92 if(dom->min.size() > i)
93 d.min = std::min(d.min, ossia::convert<double>(dom->min[i]));
94 if(dom->max.size() > i)
95 d.max = std::max(d.max, ossia::convert<double>(dom->max[i]));
103 operator()(
const ossia::value_map_type& start,
const ossia::value_map_type& end)
108 template <
typename T>
113 if(
auto node = Device::try_getNodeFromAddress(rootNode, address.address))
117 d.refine(as.domain.get());
123 Curve::CurveDomain operator()(ossia::impulse start, ossia::impulse end) {
return {}; }
130 template <
typename T,
typename U>
139 const ossia::destination_index& idx;
141 template <std::
size_t N>
142 std::pair<double, double>
143 operator()(
const std::array<float, N>& start,
const std::array<float, N>& end)
145 SCORE_ASSERT(!idx.empty());
146 const auto i = idx[0];
147 return {(double)start[i], (
double)end[i]};
150 std::pair<double, double> operator()(
151 const std::vector<ossia::value>& start,
const std::vector<ossia::value>& end)
153 SCORE_ASSERT(!idx.empty());
154 const auto i = idx[0];
155 return {ossia::convert<double>(start[i]), ossia::convert<double>(end[i])};
158 template <
typename T>
159 std::pair<double, double> operator()(
const T& start,
const T& end)
161 return {(double)start, (
double)end};
164 std::pair<double, double> operator()(ossia::impulse start, ossia::impulse end)
169 std::pair<double, double> operator()(
const std::string& start,
const std::string& end)
174 template <
typename T,
typename U>
175 std::pair<double, double> operator()(
const T& start,
const U& end)
Definition CurveModel.hpp:104
Definition InterpolateStates.hpp:49