feat(client): add per-posture player height offset setting (#1121)
This commit is contained in:
@@ -348,6 +348,9 @@ const std::vector<config_field> & configuration::config_fields()
|
||||
scalar("codec", &configuration::codec),
|
||||
scalar("bit_depth", &configuration::bit_depth),
|
||||
scalar("usb_network", &configuration::usb_network),
|
||||
scalar("height_offset_standing", &configuration::height_offset_standing),
|
||||
scalar("height_offset_seated", &configuration::height_offset_seated),
|
||||
scalar("default_posture", &configuration::default_posture),
|
||||
};
|
||||
return fields;
|
||||
}
|
||||
@@ -414,3 +417,27 @@ float configuration::get_default_stream_scale() const
|
||||
return 0.3;
|
||||
return 0.5;
|
||||
}
|
||||
|
||||
float configuration::get_height_offset() const
|
||||
{
|
||||
std::lock_guard lock(mutex);
|
||||
return default_posture == posture::seated ? height_offset_seated : height_offset_standing;
|
||||
}
|
||||
|
||||
void configuration::set_height_offset(float value)
|
||||
{
|
||||
std::lock_guard lock(mutex);
|
||||
(default_posture == posture::seated ? height_offset_seated : height_offset_standing) = value;
|
||||
}
|
||||
|
||||
posture configuration::get_posture() const
|
||||
{
|
||||
std::lock_guard lock(mutex);
|
||||
return default_posture;
|
||||
}
|
||||
|
||||
void configuration::set_posture(posture p)
|
||||
{
|
||||
std::lock_guard lock(mutex);
|
||||
default_posture = p;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user