summaryrefslogtreecommitdiff
path: root/src/lib/film.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-07-09 22:53:27 +0200
committerCarl Hetherington <cth@carlh.net>2025-07-10 20:50:32 +0200
commit62c34b28567a097e8f22576e7d7891bd3dbe0ac0 (patch)
tree2a0440ed2bdb58c608582b75da6c877527dd6bda /src/lib/film.cc
parent2c499921a9f8615c8368d8161cb43c9a93c67311 (diff)
Replace String::compose with fmt.
sed -i "/Plural-Forms/n;/%100/n;/scanf/n;s/%[123456789]/{}/g" src/lib/*.cc src/lib/*.h src/wx/*.cc src/tools/*.cc src/lib/po/*.po src/wx/po/*.po src/tools/po/*.po test/*.cc sed -i "s/String::compose */fmt::format/g" src/lib/*.cc src/lib/*.h src/wx/*.cc src/tools/*.cc test/*.cc
Diffstat (limited to 'src/lib/film.cc')
-rw-r--r--src/lib/film.cc32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/lib/film.cc b/src/lib/film.cc
index 1be1c0607..e4e07392a 100644
--- a/src/lib/film.cc
+++ b/src/lib/film.cc
@@ -498,7 +498,7 @@ Film::write_metadata()
try {
metadata()->write_to_file_formatted(filename.string());
} catch (xmlpp::exception& e) {
- throw FileError(String::compose("Could not write metadata file (%1)", e.what()), filename.string());
+ throw FileError(fmt::format("Could not write metadata file ({})", e.what()), filename.string());
}
set_dirty(false);
}
@@ -522,7 +522,7 @@ Film::read_metadata(optional<boost::filesystem::path> path)
if (dcp::filesystem::exists(file("metadata")) && !dcp::filesystem::exists(file(metadata_file))) {
throw runtime_error(
variant::insert_dcpomatic(
- _("This film was created with an older version of %1, and unfortunately it cannot "
+ _("This film was created with an older version of {}, and unfortunately it cannot "
"be loaded into this version. You will need to create a new Film, re-add your "
"content and set it up again. Sorry!")
)
@@ -541,10 +541,10 @@ Film::read_metadata(optional<boost::filesystem::path> path)
_state_version = f.number_child<int>("Version");
if (_state_version > current_state_version) {
- throw runtime_error(variant::insert_dcpomatic(_("This film was created with a newer version of %1, and it cannot be loaded into this version. Sorry!")));
+ throw runtime_error(variant::insert_dcpomatic(_("This film was created with a newer version of {}, and it cannot be loaded into this version. Sorry!")));
} else if (_state_version < current_state_version) {
/* This is an older version; save a copy (if we haven't already) */
- auto const older = path->parent_path() / String::compose("metadata.%1.xml", _state_version);
+ auto const older = path->parent_path() / fmt::format("metadata.{}.xml", _state_version);
if (!dcp::filesystem::is_regular_file(older)) {
try {
dcp::filesystem::copy_file(*path, older);
@@ -1060,7 +1060,7 @@ Film::isdcf_name(bool if_created_now) const
if (!ch.first && !ch.second) {
isdcf_name += "_MOS";
} else if (ch.first) {
- isdcf_name += String::compose("_%1%2", ch.first, ch.second);
+ isdcf_name += fmt::format("_{}{}", ch.first, ch.second);
}
if (audio_channels() > static_cast<int>(dcp::Channel::HI) && find(mapped.begin(), mapped.end(), static_cast<int>(dcp::Channel::HI)) != mapped.end()) {
@@ -1643,7 +1643,7 @@ Film::check_reel_boundaries_for_atmos()
} else {
set_reel_type(ReelType::SINGLE);
}
- Message(variant::insert_dcpomatic("%1 had to change your reel settings to accommodate the Atmos content"));
+ Message(variant::insert_dcpomatic("{} had to change your reel settings to accommodate the Atmos content"));
}
}
@@ -1665,7 +1665,7 @@ Film::check_settings_consistency()
Message(_("You have more than one piece of Atmos content, and they do not have the same frame rate. You must remove some Atmos content."));
} else if (atmos_rates.size() == 1 && *atmos_rates.begin() != video_frame_rate()) {
set_video_frame_rate(*atmos_rates.begin(), false);
- Message(variant::insert_dcpomatic(_("%1 had to change your settings so that the film's frame rate is the same as that of your Atmos content.")));
+ Message(variant::insert_dcpomatic(_("{} had to change your settings so that the film's frame rate is the same as that of your Atmos content.")));
}
if (!atmos_rates.empty()) {
@@ -1699,7 +1699,7 @@ Film::check_settings_consistency()
}
if (change_made) {
- Message(variant::insert_dcpomatic(_("%1 had to change your settings for referring to DCPs as OV. Please review those settings to make sure they are what you want.")));
+ Message(variant::insert_dcpomatic(_("{} had to change your settings for referring to DCPs as OV. Please review those settings to make sure they are what you want.")));
}
if (reel_type() == ReelType::CUSTOM) {
@@ -1710,9 +1710,9 @@ Film::check_settings_consistency()
if (too_late != boundaries.end()) {
if (std::distance(too_late, boundaries.end()) > 1) {
- Message(variant::insert_dcpomatic(_("%1 had to remove some of your custom reel boundaries as they no longer lie within the film.")));
+ Message(variant::insert_dcpomatic(_("{} had to remove some of your custom reel boundaries as they no longer lie within the film.")));
} else {
- Message(variant::insert_dcpomatic(_("%1 had to remove one of your custom reel boundaries as it no longer lies within the film.")));
+ Message(variant::insert_dcpomatic(_("{} had to remove one of your custom reel boundaries as it no longer lies within the film.")));
}
boundaries.erase(too_late, boundaries.end());
set_custom_reel_boundaries(boundaries);
@@ -1835,7 +1835,7 @@ Film::make_kdm(boost::filesystem::path cpl_file, dcp::LocalTime from, dcp::Local
bool done = false;
for (auto const& k: imported_keys) {
if (k.id() == asset->key_id().get()) {
- LOG_GENERAL("Using imported key for %1", asset->key_id().get());
+ LOG_GENERAL("Using imported key for {}", asset->key_id().get());
keys[asset] = k.key();
done = true;
}
@@ -1843,7 +1843,7 @@ Film::make_kdm(boost::filesystem::path cpl_file, dcp::LocalTime from, dcp::Local
if (!done) {
/* No imported key; it must be an asset that we encrypted */
- LOG_GENERAL("Using our own key for %1", asset->key_id().get());
+ LOG_GENERAL("Using our own key for {}", asset->key_id().get());
keys[asset] = key();
}
}
@@ -2437,9 +2437,9 @@ Film::read_remembered_assets() const
assets.push_back(RememberedAsset(node));
}
} catch (std::exception& e) {
- LOG_ERROR("Could not read assets file %1 (%2)", filename.string(), e.what());
+ LOG_ERROR("Could not read assets file {} ({})", filename.string(), e.what());
} catch (...) {
- LOG_ERROR("Could not read assets file %1", filename.string());
+ LOG_ERROR("Could not read assets file {}", filename.string());
}
return assets;
@@ -2459,9 +2459,9 @@ Film::write_remembered_assets(vector<RememberedAsset> const& assets) const
try {
doc->write_to_file_formatted(dcp::filesystem::fix_long_path(file(assets_file)).string());
} catch (std::exception& e) {
- LOG_ERROR("Could not write assets file %1 (%2)", file(assets_file).string(), e.what());
+ LOG_ERROR("Could not write assets file {} ({})", file(assets_file).string(), e.what());
} catch (...) {
- LOG_ERROR("Could not write assets file %1", file(assets_file).string());
+ LOG_ERROR("Could not write assets file {}", file(assets_file).string());
}
}