summaryrefslogtreecommitdiff
path: root/libs/ardour/file_source.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/file_source.cc')
-rw-r--r--libs/ardour/file_source.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/libs/ardour/file_source.cc b/libs/ardour/file_source.cc
index 8b503d4894..f313fde7ba 100644
--- a/libs/ardour/file_source.cc
+++ b/libs/ardour/file_source.cc
@@ -61,6 +61,7 @@ FileSource::FileSource (Session& session, DataType type, const string& path, con
, _file_is_new (!origin.empty()) // if origin is left unspecified (empty string) then file must exist
, _channel (0)
, _origin (origin)
+ , _gain (1.f)
{
set_within_session_from_path (path);
}
@@ -69,6 +70,7 @@ FileSource::FileSource (Session& session, const XMLNode& node, bool /*must_exist
: Source (session, node)
, _file_is_new (false)
, _channel (0)
+ , _gain (1.f)
{
/* this setting of _path is temporary - we expect derived classes
to call ::init() which will actually locate the file
@@ -142,6 +144,7 @@ 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) {
@@ -154,6 +157,12 @@ FileSource::set_state (const XMLNode& node, int /*version*/)
_origin = prop->value();
}
+ if ((prop = node.property (X_("gain"))) != 0) {
+ _gain = atof (prop->value());
+ } else {
+ _gain = 1.f;
+ }
+
return 0;
}