diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-03-24 11:56:51 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2022-03-24 11:56:51 +0100 |
| commit | fe3c593910ed2364add3bb06c0b5ea51554c338d (patch) | |
| tree | 1bd64ab8d8cf72865a3c1c81c0c7790ea480a402 /src/subtitle_asset_internal.cc | |
| parent | 5d002b3c904dd8fbad1bec8af119f3cd06b48d89 (diff) | |
Replace simple uses of raw_convert<string> with fmt.fmt
Diffstat (limited to 'src/subtitle_asset_internal.cc')
| -rw-r--r-- | src/subtitle_asset_internal.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/subtitle_asset_internal.cc b/src/subtitle_asset_internal.cc index 7a10f472..4524ff07 100644 --- a/src/subtitle_asset_internal.cc +++ b/src/subtitle_asset_internal.cc @@ -40,6 +40,7 @@ #include "subtitle_asset_internal.h" #include "subtitle_string.h" #include "compose.hpp" +#include <fmt/format.h> #include <cmath> @@ -60,8 +61,8 @@ order::Font::Font (shared_ptr<SubtitleString> s, Standard standard) } _values["Italic"] = s->italic() ? "yes" : "no"; _values["Color"] = s->colour().to_argb_string(); - _values["Size"] = raw_convert<string> (s->size()); _values["AspectAdjust"] = raw_convert<string>(s->aspect_adjust(), 1, true); + _values["Size"] = fmt::to_string(s->size()); _values["Effect"] = effect_to_string (s->effect()); _values["EffectColor"] = s->effect_colour().to_argb_string(); _values["Script"] = "normal"; @@ -227,15 +228,15 @@ xmlpp::Element* order::Subtitle::as_xml (xmlpp::Element* parent, Context& context) const { auto e = parent->add_child ("Subtitle"); - e->set_attribute ("SpotNumber", raw_convert<string> (context.spot_number++)); + e->set_attribute ("SpotNumber", fmt::to_string(context.spot_number++)); e->set_attribute ("TimeIn", _in.rebase(context.time_code_rate).as_string(context.standard)); e->set_attribute ("TimeOut", _out.rebase(context.time_code_rate).as_string(context.standard)); if (context.standard == Standard::SMPTE) { e->set_attribute ("FadeUpTime", _fade_up.rebase(context.time_code_rate).as_string(context.standard)); e->set_attribute ("FadeDownTime", _fade_down.rebase(context.time_code_rate).as_string(context.standard)); } else { - e->set_attribute ("FadeUpTime", raw_convert<string> (_fade_up.as_editable_units_ceil(context.time_code_rate))); - e->set_attribute ("FadeDownTime", raw_convert<string> (_fade_down.as_editable_units_ceil(context.time_code_rate))); + e->set_attribute ("FadeUpTime", fmt::to_string(_fade_up.as_editable_units_ceil(context.time_code_rate))); + e->set_attribute ("FadeDownTime", fmt::to_string(_fade_down.as_editable_units_ceil(context.time_code_rate))); } return e; } |
