#include <dcp/smpte_subtitle_asset.h>
#include <boost/filesystem.hpp>
-using std::cout;
-using std::string;
+using std::dynamic_pointer_cast;
using std::exception;
+using std::make_shared;
using std::shared_ptr;
+using std::string;
using boost::optional;
-using std::dynamic_pointer_cast;
using namespace sub;
static Time
string smpte_error;
try {
- sc.reset (new dcp::InteropSubtitleAsset (file));
+ sc = make_shared<dcp::InteropSubtitleAsset>(file);
} catch (exception& e) {
interop_error = e.what ();
}
if (!sc) {
try {
- sc.reset (new dcp::SMPTESubtitleAsset (file));
+ sc = make_shared<dcp::SMPTESubtitleAsset>(file);
} catch (exception& e) {
smpte_error = e.what();
}
}
if (!sc) {
- throw DCPError (String::compose ("Could not read subtitles (%1 / %2)", interop_error, smpte_error));
+ throw DCPError(String::compose("Could not read subtitles (%1 / %2)", interop_error, smpte_error));
}
sub::string_to_effect (string s)
{
if (s == "none") {
- return optional<Effect> ();
+ return {};
} else if (s == "border") {
return BORDER;
} else if (s == "shadow") {