From 175582d5539ccd5c8d24320fae86b6d5c6b83631 Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Fri, 26 Aug 2016 23:52:59 +1000 Subject: [PATCH] Use XMLNode::get/set_property API in ARDOUR::AudioPlaylistSource class --- libs/ardour/audio_playlist_source.cc | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/libs/ardour/audio_playlist_source.cc b/libs/ardour/audio_playlist_source.cc index f77c8b526f..e7d3b0a344 100644 --- a/libs/ardour/audio_playlist_source.cc +++ b/libs/ardour/audio_playlist_source.cc @@ -79,14 +79,12 @@ XMLNode& AudioPlaylistSource::get_state () { XMLNode& node (AudioSource::get_state ()); - char buf[64]; /* merge PlaylistSource state */ PlaylistSource::add_state (node); - snprintf (buf, sizeof (buf), "%" PRIu32, _playlist_channel); - node.add_property ("channel", buf); + node.set_property ("channel", _playlist_channel); return node; } @@ -108,17 +106,14 @@ AudioPlaylistSource::set_state (const XMLNode& node, int version, bool with_desc } } - XMLProperty const * prop; pair extent = _playlist->get_extent(); AudioSource::_length = extent.second - extent.first; - if ((prop = node.property (X_("channel"))) == 0) { + if (!node.get_property (X_("channel"), _playlist_channel)) { throw failed_constructor (); } - sscanf (prop->value().c_str(), "%" PRIu32, &_playlist_channel); - ensure_buffers_for_level (_level, _session.frame_rate()); return 0;