X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fexport_format_specification.cc;h=aef49cc28f8c750ef3bd7bbdfe0e2a6821a008ee;hb=a0558694dfdb2a89d54e22d30916ea0118b39301;hp=d8a45ba533e47afe81cb8a2b2332347a4d2ce7d2;hpb=8c9749e42faf7808034ed8b7afce4a2fe6dc6f33;p=ardour.git diff --git a/libs/ardour/export_format_specification.cc b/libs/ardour/export_format_specification.cc index d8a45ba533..aef49cc28f 100644 --- a/libs/ardour/export_format_specification.cc +++ b/libs/ardour/export_format_specification.cc @@ -167,11 +167,16 @@ ExportFormatSpecification::ExportFormatSpecification (Session & s) , _silence_end (s) , _normalize (false) - , _normalize_target (1.0) + , _normalize_loudness (false) + , _normalize_dbfs (GAIN_COEFF_UNITY) + , _normalize_lufs (-23) + , _normalize_dbtp (-1) , _with_toc (false) , _with_cue (false) + , _with_mp4chaps (false) , _soundcloud_upload (false) , _command ("") + , _analyse (true) { format_ids.insert (F_None); endiannesses.insert (E_FileDefault); @@ -182,8 +187,31 @@ ExportFormatSpecification::ExportFormatSpecification (Session & s) ExportFormatSpecification::ExportFormatSpecification (Session & s, XMLNode const & state) : session (s) + + , has_sample_format (false) + , supports_tagging (false) + , _has_broadcast_info (false) + , _channel_limit (0) + , _dither_type (D_None) + , _src_quality (SRC_SincBest) + , _tag (true) + + , _trim_beginning (false) , _silence_beginning (s) + , _trim_end (false) , _silence_end (s) + + , _normalize (false) + , _normalize_loudness (false) + , _normalize_dbfs (GAIN_COEFF_UNITY) + , _normalize_lufs (-23) + , _normalize_dbtp (-1) + , _with_toc (false) + , _with_cue (false) + , _with_mp4chaps (false) + , _soundcloud_upload (false) + , _command ("") + , _analyse (true) { _silence_beginning.type = Time::Timecode; _silence_end.type = Time::Timecode; @@ -196,6 +224,8 @@ ExportFormatSpecification::ExportFormatSpecification (ExportFormatSpecification , session (other.session) , _silence_beginning (other.session) , _silence_end (other.session) + , _soundcloud_upload (false) + , _analyse (other._analyse) { if (modify_name) { set_name (other.name() + " (copy)"); @@ -222,7 +252,10 @@ ExportFormatSpecification::ExportFormatSpecification (ExportFormatSpecification set_trim_beginning (other.trim_beginning()); set_trim_end (other.trim_end()); set_normalize (other.normalize()); - set_normalize_target (other.normalize_target()); + set_normalize_loudness (other.normalize_loudness()); + set_normalize_dbfs (other.normalize_dbfs()); + set_normalize_lufs (other.normalize_lufs()); + set_normalize_dbtp (other.normalize_dbtp()); set_tag (other.tag()); @@ -239,6 +272,7 @@ ExportFormatSpecification::~ExportFormatSpecification () XMLNode & ExportFormatSpecification::get_state () { + LocaleGuard lg; XMLNode * node; XMLNode * root = new XMLNode ("ExportFormatSpecification"); @@ -246,6 +280,7 @@ ExportFormatSpecification::get_state () root->add_property ("id", _id.to_s()); root->add_property ("with-cue", _with_cue ? "true" : "false"); root->add_property ("with-toc", _with_toc ? "true" : "false"); + root->add_property ("with-mp4chaps", _with_mp4chaps ? "true" : "false"); root->add_property ("command", _command); node = root->add_child ("Encoding"); @@ -274,7 +309,10 @@ ExportFormatSpecification::get_state () node = processing->add_child ("Normalize"); node->add_property ("enabled", normalize() ? "true" : "false"); - node->add_property ("target", to_string (normalize_target(), std::dec)); + node->add_property ("loudness", normalize_loudness() ? "yes" : "no"); + node->add_property ("dbfs", to_string (normalize_dbfs(), std::dec)); + node->add_property ("lufs", to_string (normalize_lufs(), std::dec)); + node->add_property ("dbtp", to_string (normalize_dbtp(), std::dec)); XMLNode * silence = processing->add_child ("Silence"); XMLNode * start = silence->add_child ("Start"); @@ -303,6 +341,7 @@ ExportFormatSpecification::set_state (const XMLNode & root) XMLProperty const * prop; XMLNode const * child; string value; + LocaleGuard lg; if ((prop = root.property ("name"))) { _name = prop->value(); @@ -317,14 +356,19 @@ ExportFormatSpecification::set_state (const XMLNode & root) } else { _with_cue = false; } - + if ((prop = root.property ("with-toc"))) { _with_toc = string_is_affirmative (prop->value()); } else { _with_toc = false; } - - + + if ((prop = root.property ("with-mp4chaps"))) { + _with_mp4chaps = string_is_affirmative (prop->value()); + } else { + _with_mp4chaps = false; + } + if ((prop = root.property ("command"))) { _command = prop->value(); } else { @@ -395,8 +439,25 @@ ExportFormatSpecification::set_state (const XMLNode & root) _normalize = (!prop->value().compare ("true")); } + // old formats before ~ 4.7-930ish if ((prop = child->property ("target"))) { - _normalize_target = atof (prop->value()); + _normalize_dbfs = atof (prop->value()); + } + + if ((prop = child->property ("loudness"))) { + _normalize_loudness = string_is_affirmative (prop->value()); + } + + if ((prop = child->property ("dbfs"))) { + _normalize_dbfs = atof (prop->value()); + } + + if ((prop = child->property ("lufs"))) { + _normalize_lufs = atof (prop->value()); + } + + if ((prop = child->property ("dbtp"))) { + _normalize_dbtp = atof (prop->value()); } } @@ -544,7 +605,11 @@ ExportFormatSpecification::description (bool include_name) list components; if (_normalize) { - components.push_back (_("normalize")); + if (_normalize_loudness) { + components.push_back (_("normalize loudness")); + } else { + components.push_back (_("normalize peak")); + } } if (_trim_beginning && _trim_end) { @@ -582,6 +647,9 @@ ExportFormatSpecification::description (bool include_name) case SR_96: components.push_back ("96 kHz"); break; + case SR_176_4: + components.push_back ("176.4 kHz"); + break; case SR_192: components.push_back ("192 kHz"); break; @@ -600,6 +668,10 @@ ExportFormatSpecification::description (bool include_name) components.push_back ("CUE"); } + if (_with_mp4chaps) { + components.push_back ("MP4ch"); + } + if (!_command.empty()) { components.push_back ("+"); } @@ -630,7 +702,7 @@ ExportFormatSpecification::get_option (XMLNode const * node, std::string const & XMLNodeList list (node->children ("Option")); for (XMLNodeList::iterator it = list.begin(); it != list.end(); ++it) { - XMLProperty * prop = (*it)->property ("name"); + XMLProperty const * prop = (*it)->property ("name"); if (prop && !name.compare (prop->value())) { prop = (*it)->property ("value"); if (prop) {