Use XMLNode::get_property() in FileSource class
This commit is contained in:
parent
e4c4193640
commit
27bb420c34
@ -144,22 +144,13 @@ FileSource::init (const string& pathstr, bool must_exist)
|
|||||||
int
|
int
|
||||||
FileSource::set_state (const XMLNode& node, int /*version*/)
|
FileSource::set_state (const XMLNode& node, int /*version*/)
|
||||||
{
|
{
|
||||||
LocaleGuard lg;
|
if (!node.get_property (X_("channel"), _channel)) {
|
||||||
XMLProperty const * prop;
|
|
||||||
|
|
||||||
if ((prop = node.property (X_("channel"))) != 0) {
|
|
||||||
_channel = atoi (prop->value());
|
|
||||||
} else {
|
|
||||||
_channel = 0;
|
_channel = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((prop = node.property (X_("origin"))) != 0) {
|
node.get_property (X_("origin"), _origin);
|
||||||
_origin = prop->value();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((prop = node.property (X_("gain"))) != 0) {
|
if (!node.get_property (X_("gain"), _gain)) {
|
||||||
_gain = atof (prop->value());
|
|
||||||
} else {
|
|
||||||
_gain = 1.f;
|
_gain = 1.f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user