From: Carl Hetherington Date: Wed, 26 Oct 2022 13:16:30 +0000 (+0200) Subject: Allow move construction of ActiveText. X-Git-Tag: v2.16.32~5 X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=4b01fa582bc6a30ce75be72275238e6cc7d0dfbe Allow move construction of ActiveText. --- diff --git a/src/lib/active_text.cc b/src/lib/active_text.cc index 1e0fd6adb..2a5c4d836 100644 --- a/src/lib/active_text.cc +++ b/src/lib/active_text.cc @@ -32,6 +32,23 @@ using boost::optional; using namespace dcpomatic; +ActiveText::ActiveText(ActiveText&& other) + : _data(std::move(other._data)) +{ + +} + + +ActiveText& +ActiveText::operator=(ActiveText&& other) +{ + if (this != &other) { + _data = std::move(other._data); + } + return *this; +} + + /** Get the open captions that should be burnt into a given period. * @param period Period of interest. * @param always_burn_captions Always burn captions even if their content is not set to burn. diff --git a/src/lib/active_text.h b/src/lib/active_text.h index d5ce4cb07..5430f9681 100644 --- a/src/lib/active_text.h +++ b/src/lib/active_text.h @@ -45,6 +45,9 @@ public: ActiveText (ActiveText const&) = delete; ActiveText& operator= (ActiveText const&) = delete; + ActiveText(ActiveText&& other); + ActiveText& operator=(ActiveText&& other); + std::list get_burnt (dcpomatic::DCPTimePeriod period, bool always_burn_captions) const; void clear_before (dcpomatic::DCPTime time); void clear ();