+
+string
+video_asset_filename (shared_ptr<dcp::PictureAsset> asset)
+{
+ dcp::NameFormat::Map values;
+ values["type"] = "j2c";
+ values["id"] = asset->id();
+ return Config::instance()->dcp_filename_format().get(values) + ".mxf";
+}
+
+string
+audio_asset_filename (shared_ptr<dcp::SoundAsset> asset)
+{
+ dcp::NameFormat::Map values;
+ values["type"] = "pcm";
+ values["id"] = asset->id();
+ return Config::instance()->dcp_filename_format().get(values) + ".mxf";
+}
+
+float
+relaxed_string_to_float (string s)
+{
+ try {
+ boost::algorithm::replace_all (s, ",", ".");
+ return lexical_cast<float> (s);
+ } catch (bad_lexical_cast) {
+ boost::algorithm::replace_all (s, ".", ",");
+ return lexical_cast<float> (s);
+ }
+}
+
+bool
+string_not_empty (string s)
+{
+ return !s.empty ();
+}