#include <boost/test/unit_test.hpp>
#include "lib/subrip_content.h"
+#include "lib/dcp_subtitle_content.h"
#include "lib/film.h"
#include "lib/ratio.h"
#include "lib/dcp_content_type.h"
using std::cout;
using boost::shared_ptr;
-/** Build a small DCP with no picture and a single subtitle overlaid onto it */
-BOOST_AUTO_TEST_CASE (burnt_subtitle_test)
+/** Build a small DCP with no picture and a single subtitle overlaid onto it from a SubRip file */
+BOOST_AUTO_TEST_CASE (burnt_subtitle_test_subrip)
{
- shared_ptr<Film> film = new_test_film ("burnt_subtitle_test");
+ shared_ptr<Film> film = new_test_film ("burnt_subtitle_test_subrip");
film->set_container (Ratio::from_id ("185"));
film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
film->set_name ("frobozz");
- film->set_with_subtitles (true);
+ film->set_burn_subtitles (true);
shared_ptr<SubRipContent> content (new SubRipContent (film, "test/data/subrip2.srt"));
+ content->set_subtitle_use (true);
film->examine_and_add_content (content);
wait_for_jobs ();
film->make_dcp ();
wait_for_jobs ();
- check_dcp ("test/data/burnt_subtitle_test", film->dir (film->dcp_name ()));
+ check_dcp ("test/data/burnt_subtitle_test_subrip", film->dir (film->dcp_name ()));
+}
+
+/** Build a small DCP with no picture and a single subtitle overlaid onto it from a DCP XML file */
+BOOST_AUTO_TEST_CASE (burnt_subtitle_test_dcp)
+{
+ shared_ptr<Film> film = new_test_film ("burnt_subtitle_test_dcp");
+ film->set_container (Ratio::from_id ("185"));
+ film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
+ film->set_name ("frobozz");
+ film->set_burn_subtitles (true);
+ shared_ptr<DCPSubtitleContent> content (new DCPSubtitleContent (film, "test/data/dcp_sub.xml"));
+ content->set_subtitle_use (true);
+ film->examine_and_add_content (content);
+ wait_for_jobs ();
+ film->make_dcp ();
+ wait_for_jobs ();
+
+ check_dcp ("test/data/burnt_subtitle_test_dcp", film->dir (film->dcp_name ()));
}