summaryrefslogtreecommitdiff
path: root/gtk2_ardour/axis_view.h
diff options
context:
space:
mode:
authorTim Mayberry <mojofunk@gmail.com>2016-08-30 20:02:26 +1000
committerTim Mayberry <mojofunk@gmail.com>2017-04-19 09:36:58 +1000
commit66004a50366d43e0dca2c9305ec662e037cb17e1 (patch)
treeb276efaec5718e5893a5fda0075384b6a4d7d1fe /gtk2_ardour/axis_view.h
parent7fdbabcd79e2521787eaf200418edc40ffd5fe84 (diff)
Use PBD::to_string to convert non-string types in AxisView::set_gui_property
Diffstat (limited to 'gtk2_ardour/axis_view.h')
-rw-r--r--gtk2_ardour/axis_view.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/gtk2_ardour/axis_view.h b/gtk2_ardour/axis_view.h
index 2a7c378197..8de39583ef 100644
--- a/gtk2_ardour/axis_view.h
+++ b/gtk2_ardour/axis_view.h
@@ -63,11 +63,19 @@ class AxisView : public virtual PBD::ScopedConnectionList, public virtual ARDOUR
*/
std::string gui_property (const std::string& property_name) const;
+ void set_gui_property (const std::string& property_name, const char* value) {
+ property_hashtable.erase(property_name);
+ 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) {
- std::stringstream s;
- s << value;
property_hashtable.erase(property_name);
- property_hashtable.emplace(property_name, s.str());
+ property_hashtable.emplace(property_name, PBD::to_string(value));
gui_object_state().set_property<T> (state_id(), property_name, value);
}