13
0

Use PBD::to_string to convert non-string types in AxisView::set_gui_property

This commit is contained in:
Tim Mayberry 2016-08-30 20:02:26 +10:00
parent 7fdbabcd79
commit 66004a5036

View File

@ -63,11 +63,19 @@ class AxisView : public virtual PBD::ScopedConnectionList, public virtual ARDOUR
*/
std::string gui_property (const std::string& property_name) const;
template<typename T> void set_gui_property (const std::string& property_name, const T& value) {
std::stringstream s;
s << value;
void set_gui_property (const std::string& property_name, const char* value) {
property_hashtable.erase(property_name);
property_hashtable.emplace(property_name, s.str());
property_hashtable.emplace(property_name, value);
gui_object_state().set_property (state_id(), property_name, value);
}
void set_gui_property (const std::string& property_name, const std::string& value) {
set_gui_property (property_name, value.c_str());
}
template<typename T> void set_gui_property (const std::string& property_name, const T& value) {
property_hashtable.erase(property_name);
property_hashtable.emplace(property_name, PBD::to_string(value));
gui_object_state().set_property<T> (state_id(), property_name, value);
}