X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fcaption_panel.cc;h=c70a9ad8c843368e483a4c179f57fe7ba2b7ab3a;hb=27b83475435dda4e84a90cf59a52f150905c4ab1;hp=20a0ad143c3a2e402eeab9a712039a11f42fdc15;hpb=9cb73fbc0fa4643612f01665bc6d9fc430656f32;p=dcpomatic.git diff --git a/src/wx/caption_panel.cc b/src/wx/caption_panel.cc index 20a0ad143..c70a9ad8c 100644 --- a/src/wx/caption_panel.cc +++ b/src/wx/caption_panel.cc @@ -28,11 +28,11 @@ #include "lib/ffmpeg_content.h" #include "lib/text_caption_file_content.h" #include "lib/ffmpeg_subtitle_stream.h" -#include "lib/dcp_text_content.h" +#include "lib/dcp_subtitle_content.h" #include "lib/text_caption_file_decoder.h" -#include "lib/dcp_text_decoder.h" +#include "lib/dcp_subtitle_decoder.h" #include "lib/dcp_content.h" -#include "lib/text_content.h" +#include "lib/caption_content.h" #include "lib/decoder_factory.h" #include #include @@ -216,16 +216,16 @@ CaptionPanel::film_content_changed (int property) } } setup_sensitivity (); - } else if (property == TextContentProperty::USE) { - checked_set (_use, scs ? scs->subtitle->use() : false); + } else if (property == CaptionContentProperty::USE) { + checked_set (_use, scs ? scs->caption->use() : false); setup_sensitivity (); - } else if (property == TextContentProperty::TYPE) { + } else if (property == CaptionContentProperty::TYPE) { if (scs) { - switch (scs->subtitle->type()) { - case TEXT_SUBTITLE: + switch (scs->caption->type()) { + case CAPTION_OPEN: _type->SetSelection (0); break; - case TEXT_CLOSED_CAPTION: + case CAPTION_CLOSED: _type->SetSelection (1); break; default: @@ -235,20 +235,20 @@ CaptionPanel::film_content_changed (int property) _type->SetSelection (0); } setup_sensitivity (); - } else if (property == TextContentProperty::BURN) { - checked_set (_burn, scs ? scs->subtitle->burn() : false); - } else if (property == TextContentProperty::X_OFFSET) { - checked_set (_x_offset, scs ? lrint (scs->subtitle->x_offset() * 100) : 0); - } else if (property == TextContentProperty::Y_OFFSET) { - checked_set (_y_offset, scs ? lrint (scs->subtitle->y_offset() * 100) : 0); - } else if (property == TextContentProperty::X_SCALE) { - checked_set (_x_scale, scs ? lrint (scs->subtitle->x_scale() * 100) : 100); - } else if (property == TextContentProperty::Y_SCALE) { - checked_set (_y_scale, scs ? lrint (scs->subtitle->y_scale() * 100) : 100); - } else if (property == TextContentProperty::LINE_SPACING) { - checked_set (_line_spacing, scs ? lrint (scs->subtitle->line_spacing() * 100) : 100); - } else if (property == TextContentProperty::LANGUAGE) { - checked_set (_language, scs ? scs->subtitle->language() : ""); + } else if (property == CaptionContentProperty::BURN) { + checked_set (_burn, scs ? scs->caption->burn() : false); + } else if (property == CaptionContentProperty::X_OFFSET) { + checked_set (_x_offset, scs ? lrint (scs->caption->x_offset() * 100) : 0); + } else if (property == CaptionContentProperty::Y_OFFSET) { + checked_set (_y_offset, scs ? lrint (scs->caption->y_offset() * 100) : 0); + } else if (property == CaptionContentProperty::X_SCALE) { + checked_set (_x_scale, scs ? lrint (scs->caption->x_scale() * 100) : 100); + } else if (property == CaptionContentProperty::Y_SCALE) { + checked_set (_y_scale, scs ? lrint (scs->caption->y_scale() * 100) : 100); + } else if (property == CaptionContentProperty::LINE_SPACING) { + checked_set (_line_spacing, scs ? lrint (scs->caption->line_spacing() * 100) : 100); + } else if (property == CaptionContentProperty::LANGUAGE) { + checked_set (_language, scs ? scs->caption->language() : ""); } else if (property == DCPContentProperty::REFERENCE_SUBTITLE) { if (scs) { shared_ptr dcp = dynamic_pointer_cast (scs); @@ -267,7 +267,7 @@ void CaptionPanel::use_toggled () { BOOST_FOREACH (shared_ptr i, _parent->selected_subtitle ()) { - i->subtitle->set_use (_use->GetValue()); + i->caption->set_use (_use->GetValue()); } } @@ -277,10 +277,10 @@ CaptionPanel::type_changed () BOOST_FOREACH (shared_ptr i, _parent->selected_subtitle()) { switch (_type->GetSelection()) { case 0: - i->subtitle->set_type (TEXT_SUBTITLE); + i->caption->set_type (CAPTION_OPEN); break; case 1: - i->subtitle->set_type (TEXT_CLOSED_CAPTION); + i->caption->set_type (CAPTION_CLOSED); break; } } @@ -290,7 +290,7 @@ void CaptionPanel::burn_toggled () { BOOST_FOREACH (shared_ptr i, _parent->selected_subtitle ()) { - i->subtitle->set_burn (_burn->GetValue()); + i->caption->set_burn (_burn->GetValue()); } } @@ -305,9 +305,9 @@ CaptionPanel::setup_sensitivity () shared_ptr fc = boost::dynamic_pointer_cast (i); shared_ptr sc = boost::dynamic_pointer_cast (i); shared_ptr dc = boost::dynamic_pointer_cast (i); - shared_ptr dsc = boost::dynamic_pointer_cast (i); + shared_ptr dsc = boost::dynamic_pointer_cast (i); if (fc) { - if (fc->subtitle) { + if (fc->caption) { ++ffmpeg_subs; ++any_subs; } @@ -373,7 +373,7 @@ void CaptionPanel::x_offset_changed () { BOOST_FOREACH (shared_ptr i, _parent->selected_subtitle ()) { - i->subtitle->set_x_offset (_x_offset->GetValue() / 100.0); + i->caption->set_x_offset (_x_offset->GetValue() / 100.0); } } @@ -381,7 +381,7 @@ void CaptionPanel::y_offset_changed () { BOOST_FOREACH (shared_ptr i, _parent->selected_subtitle ()) { - i->subtitle->set_y_offset (_y_offset->GetValue() / 100.0); + i->caption->set_y_offset (_y_offset->GetValue() / 100.0); } } @@ -390,7 +390,7 @@ CaptionPanel::x_scale_changed () { ContentList c = _parent->selected_subtitle (); if (c.size() == 1) { - c.front()->subtitle->set_x_scale (_x_scale->GetValue() / 100.0); + c.front()->caption->set_x_scale (_x_scale->GetValue() / 100.0); } } @@ -398,7 +398,7 @@ void CaptionPanel::y_scale_changed () { BOOST_FOREACH (shared_ptr i, _parent->selected_subtitle ()) { - i->subtitle->set_y_scale (_y_scale->GetValue() / 100.0); + i->caption->set_y_scale (_y_scale->GetValue() / 100.0); } } @@ -406,7 +406,7 @@ void CaptionPanel::line_spacing_changed () { BOOST_FOREACH (shared_ptr i, _parent->selected_subtitle ()) { - i->subtitle->set_line_spacing (_line_spacing->GetValue() / 100.0); + i->caption->set_line_spacing (_line_spacing->GetValue() / 100.0); } } @@ -414,7 +414,7 @@ void CaptionPanel::language_changed () { BOOST_FOREACH (shared_ptr i, _parent->selected_subtitle ()) { - i->subtitle->set_language (wx_to_std (_language->GetValue())); + i->caption->set_language (wx_to_std (_language->GetValue())); } } @@ -422,16 +422,16 @@ void CaptionPanel::content_selection_changed () { film_content_changed (FFmpegContentProperty::SUBTITLE_STREAMS); - film_content_changed (TextContentProperty::USE); - film_content_changed (TextContentProperty::BURN); - film_content_changed (TextContentProperty::X_OFFSET); - film_content_changed (TextContentProperty::Y_OFFSET); - film_content_changed (TextContentProperty::X_SCALE); - film_content_changed (TextContentProperty::Y_SCALE); - film_content_changed (TextContentProperty::LINE_SPACING); - film_content_changed (TextContentProperty::LANGUAGE); - film_content_changed (TextContentProperty::FONTS); - film_content_changed (TextContentProperty::TYPE); + film_content_changed (CaptionContentProperty::USE); + film_content_changed (CaptionContentProperty::BURN); + film_content_changed (CaptionContentProperty::X_OFFSET); + film_content_changed (CaptionContentProperty::Y_OFFSET); + film_content_changed (CaptionContentProperty::X_SCALE); + film_content_changed (CaptionContentProperty::Y_SCALE); + film_content_changed (CaptionContentProperty::LINE_SPACING); + film_content_changed (CaptionContentProperty::LANGUAGE); + film_content_changed (CaptionContentProperty::FONTS); + film_content_changed (CaptionContentProperty::TYPE); film_content_changed (DCPContentProperty::REFERENCE_SUBTITLE); }