summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
authorTim Mayberry <mojofunk@gmail.com>2017-01-01 21:44:09 +1000
committerTim Mayberry <mojofunk@gmail.com>2017-04-19 09:36:50 +1000
commit27bb420c34d1697a992ca805be6cea9728e3646e (patch)
tree08a95e930e59fedaa03a127fef815d55e2e4c12a /libs/ardour
parente4c4193640317ef4c3f61c2fdf4a3729d2b2f524 (diff)
Use XMLNode::get_property() in FileSource class
Diffstat (limited to 'libs/ardour')
-rw-r--r--libs/ardour/file_source.cc15
1 files changed, 3 insertions, 12 deletions
diff --git a/libs/ardour/file_source.cc b/libs/ardour/file_source.cc
index f313fde7ba..c1aa50d4a4 100644
--- a/libs/ardour/file_source.cc
+++ b/libs/ardour/file_source.cc
@@ -144,22 +144,13 @@ FileSource::init (const string& pathstr, bool must_exist)
int
FileSource::set_state (const XMLNode& node, int /*version*/)
{
- LocaleGuard lg;
- XMLProperty const * prop;
-
- if ((prop = node.property (X_("channel"))) != 0) {
- _channel = atoi (prop->value());
- } else {
+ if (!node.get_property (X_("channel"), _channel)) {
_channel = 0;
}
- if ((prop = node.property (X_("origin"))) != 0) {
- _origin = prop->value();
- }
+ node.get_property (X_("origin"), _origin);
- if ((prop = node.property (X_("gain"))) != 0) {
- _gain = atof (prop->value());
- } else {
+ if (!node.get_property (X_("gain"), _gain)) {
_gain = 1.f;
}