summaryrefslogtreecommitdiff
path: root/gtk2_ardour/automation_time_axis.cc
diff options
context:
space:
mode:
authorTim Mayberry <mojofunk@gmail.com>2017-04-04 17:42:22 +1000
committerTim Mayberry <mojofunk@gmail.com>2017-04-19 09:37:02 +1000
commitda8146f011539a1297bd832f17d13fe9d8d6a2f9 (patch)
tree44ff38cdeade7f643ace667e650cc06549334173 /gtk2_ardour/automation_time_axis.cc
parent1ce58ad90aab58bca10af9c448b8e186ac532480 (diff)
Use PBD::to_string in AutomationTimeAxis instead of boost::lexical_cast and string_compose
Diffstat (limited to 'gtk2_ardour/automation_time_axis.cc')
-rw-r--r--gtk2_ardour/automation_time_axis.cc27
1 files changed, 14 insertions, 13 deletions
diff --git a/gtk2_ardour/automation_time_axis.cc b/gtk2_ardour/automation_time_axis.cc
index fa5452d885..cb8456e062 100644
--- a/gtk2_ardour/automation_time_axis.cc
+++ b/gtk2_ardour/automation_time_axis.cc
@@ -21,11 +21,12 @@
#include <gtkmm2ext/barcontroller.h>
#include <gtkmm2ext/utils.h>
#include <boost/algorithm/string.hpp>
-#include <boost/lexical_cast.hpp>
#include "pbd/error.h"
#include "pbd/memento_command.h"
#include "pbd/stacktrace.h"
+#include "pbd/string_convert.h"
+#include "pbd/types_convert.h"
#include "ardour/automation_control.h"
#include "ardour/event_type_map.h"
@@ -904,13 +905,13 @@ string
AutomationTimeAxisView::state_id() const
{
if (_automatable != _route && _control) {
- return string_compose ("automation %1", _control->id().to_s());
+ return string("automation ") + _control->id().to_s();
} else if (_parameter) {
- return string_compose ("automation %1 %2/%3/%4",
- _route->id(),
- _parameter.type(),
- _parameter.id(),
- (int) _parameter.channel());
+ const string parameter_str = PBD::to_string (_parameter.type()) + "/" +
+ PBD::to_string (_parameter.id()) + "/" +
+ PBD::to_string (_parameter.channel ());
+
+ return string("automation ") + PBD::to_string(_route->id()) + " " + parameter_str;
} else {
error << "Automation time axis has no state ID" << endmsg;
return "";
@@ -933,11 +934,11 @@ AutomationTimeAxisView::parse_state_id (
bool & has_parameter,
Evoral::Parameter & parameter)
{
- stringstream s;
- s << state_id;
+ stringstream ss;
+ ss << state_id;
string a, b, c;
- s >> a >> b >> c;
+ ss >> a >> b >> c;
if (a != X_("automation")) {
return false;
@@ -958,9 +959,9 @@ AutomationTimeAxisView::parse_state_id (
assert (p.size() == 3);
parameter = Evoral::Parameter (
- boost::lexical_cast<int> (p[0]),
- boost::lexical_cast<int> (p[2]),
- boost::lexical_cast<int> (p[1])
+ PBD::string_to<uint32_t>(p[0]), // type
+ PBD::string_to<uint8_t>(p[2]), // channel
+ PBD::string_to<uint32_t>(p[1]) // id
);
return true;