diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-04-13 16:34:22 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-05-18 11:50:29 +0100 |
| commit | 775ae0e37bbec115d742feade0adc614a9a2301c (patch) | |
| tree | 3f9b7d86c547b2340b09ec4e3b157e88de44ff2e /src/wx | |
| parent | 334b94526f2c1271718a94fe97cfa843cf6ef7a1 (diff) | |
Subtitle rearrangements.
Diffstat (limited to 'src/wx')
| -rw-r--r-- | src/wx/content_panel.cc | 9 | ||||
| -rw-r--r-- | src/wx/content_panel.h | 2 | ||||
| -rw-r--r-- | src/wx/dcp_panel.cc | 1 | ||||
| -rw-r--r-- | src/wx/fonts_dialog.cc | 13 | ||||
| -rw-r--r-- | src/wx/fonts_dialog.h | 8 | ||||
| -rw-r--r-- | src/wx/hints_dialog.cc | 5 | ||||
| -rw-r--r-- | src/wx/hints_dialog.h | 3 | ||||
| -rw-r--r-- | src/wx/subtitle_panel.cc | 65 | ||||
| -rw-r--r-- | src/wx/subtitle_panel.h | 2 | ||||
| -rw-r--r-- | src/wx/text_subtitle_appearance_dialog.cc | 15 | ||||
| -rw-r--r-- | src/wx/timeline.cc | 5 | ||||
| -rw-r--r-- | src/wx/timeline_content_view.h | 5 | ||||
| -rw-r--r-- | src/wx/timeline_subtitle_content_view.cc | 13 | ||||
| -rw-r--r-- | src/wx/timeline_subtitle_content_view.h | 7 | ||||
| -rw-r--r-- | src/wx/timing_panel.cc | 9 | ||||
| -rw-r--r-- | src/wx/video_panel.cc | 2 |
16 files changed, 84 insertions, 80 deletions
diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc index 55dd671e9..ad4894897 100644 --- a/src/wx/content_panel.cc +++ b/src/wx/content_panel.cc @@ -178,15 +178,14 @@ ContentPanel::selected_audio () return ac; } -SubtitleContentList +ContentList ContentPanel::selected_subtitle () { - SubtitleContentList sc; + ContentList sc; BOOST_FOREACH (shared_ptr<Content> i, selected ()) { - shared_ptr<SubtitleContent> t = dynamic_pointer_cast<SubtitleContent> (i); - if (t) { - sc.push_back (t); + if (i->subtitle) { + sc.push_back (i); } } diff --git a/src/wx/content_panel.h b/src/wx/content_panel.h index e735213d3..f4e2dbae2 100644 --- a/src/wx/content_panel.h +++ b/src/wx/content_panel.h @@ -61,7 +61,7 @@ public: ContentList selected (); ContentList selected_video (); AudioContentList selected_audio (); - SubtitleContentList selected_subtitle (); + ContentList selected_subtitle (); FFmpegContentList selected_ffmpeg (); void add_file_clicked (); diff --git a/src/wx/dcp_panel.cc b/src/wx/dcp_panel.cc index 42d2f1537..c62767c9d 100644 --- a/src/wx/dcp_panel.cc +++ b/src/wx/dcp_panel.cc @@ -30,6 +30,7 @@ #include "lib/ffmpeg_content.h" #include "lib/audio_processor.h" #include "lib/video_content.h" +#include "lib/subtitle_content.h" #include "lib/dcp_content.h" #include <dcp/key.h> #include <dcp/raw_convert.h> diff --git a/src/wx/fonts_dialog.cc b/src/wx/fonts_dialog.cc index b79580d7c..3f8bca239 100644 --- a/src/wx/fonts_dialog.cc +++ b/src/wx/fonts_dialog.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2014-2015 Carl Hetherington <cth@carlh.net> + Copyright (C) 2014-2016 Carl Hetherington <cth@carlh.net> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -22,6 +22,7 @@ #include "system_font_dialog.h" #include "font_files_dialog.h" #include "lib/font.h" +#include "lib/content.h" #include "lib/subtitle_content.h" #include <wx/wx.h> #include <boost/foreach.hpp> @@ -32,7 +33,7 @@ using std::string; using std::cout; using boost::shared_ptr; -FontsDialog::FontsDialog (wxWindow* parent, shared_ptr<SubtitleContent> content) +FontsDialog::FontsDialog (wxWindow* parent, shared_ptr<Content> content) : wxDialog (parent, wxID_ANY, _("Fonts")) , _content (content) { @@ -96,14 +97,14 @@ FontsDialog::FontsDialog (wxWindow* parent, shared_ptr<SubtitleContent> content) void FontsDialog::setup () { - shared_ptr<SubtitleContent> content = _content.lock (); + shared_ptr<Content> content = _content.lock (); if (!content) { return; } _fonts->DeleteAllItems (); size_t n = 0; - BOOST_FOREACH (shared_ptr<Font> i, content->fonts ()) { + BOOST_FOREACH (shared_ptr<Font> i, content->subtitle->fonts ()) { wxListItem item; item.SetId (n); _fonts->InsertItem (item); @@ -133,7 +134,7 @@ FontsDialog::setup_sensitivity () void FontsDialog::edit_clicked () { - shared_ptr<SubtitleContent> content = _content.lock (); + shared_ptr<Content> content = _content.lock (); if (!content) { return; } @@ -141,7 +142,7 @@ FontsDialog::edit_clicked () int const item = _fonts->GetNextItem (-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); string const id = wx_to_std (_fonts->GetItemText (item, 0)); shared_ptr<Font> font; - BOOST_FOREACH (shared_ptr<Font> i, content->fonts()) { + BOOST_FOREACH (shared_ptr<Font> i, content->subtitle->fonts()) { if (i->id() == id) { font = i; } diff --git a/src/wx/fonts_dialog.h b/src/wx/fonts_dialog.h index e04dc9937..723414a6b 100644 --- a/src/wx/fonts_dialog.h +++ b/src/wx/fonts_dialog.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2014-2015 Carl Hetherington <cth@carlh.net> + Copyright (C) 2014-2016 Carl Hetherington <cth@carlh.net> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -23,12 +23,12 @@ #include <boost/weak_ptr.hpp> #include <boost/filesystem.hpp> -class SubtitleContent; +class Content; class FontsDialog : public wxDialog { public: - FontsDialog (wxWindow* parent, boost::shared_ptr<SubtitleContent>); + FontsDialog (wxWindow* parent, boost::shared_ptr<Content>); private: void setup (); @@ -36,7 +36,7 @@ private: void selection_changed (); void edit_clicked (); - boost::weak_ptr<SubtitleContent> _content; + boost::weak_ptr<Content> _content; wxListCtrl* _fonts; wxButton* _edit; }; diff --git a/src/wx/hints_dialog.cc b/src/wx/hints_dialog.cc index 2cf109e55..75643c312 100644 --- a/src/wx/hints_dialog.cc +++ b/src/wx/hints_dialog.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net> + Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,12 +17,13 @@ */ +#include "hints_dialog.h" #include "lib/film.h" #include "lib/ratio.h" #include "lib/video_content.h" #include "lib/subtitle_content.h" #include "lib/font.h" -#include "hints_dialog.h" +#include "lib/content.h" #include <wx/richtext/richtextctrl.h> #include <boost/algorithm/string.hpp> #include <boost/foreach.hpp> diff --git a/src/wx/hints_dialog.h b/src/wx/hints_dialog.h index f4ef00aa2..abf718e8f 100644 --- a/src/wx/hints_dialog.h +++ b/src/wx/hints_dialog.h @@ -17,8 +17,9 @@ */ -#include <boost/weak_ptr.hpp> #include <wx/wx.h> +#include <boost/weak_ptr.hpp> +#include <boost/signals2.hpp> class wxRichTextCtrl; class Film; diff --git a/src/wx/subtitle_panel.cc b/src/wx/subtitle_panel.cc index a53679673..6b910afae 100644 --- a/src/wx/subtitle_panel.cc +++ b/src/wx/subtitle_panel.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net> + Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -32,6 +32,7 @@ #include "lib/text_subtitle_decoder.h" #include "lib/dcp_subtitle_decoder.h" #include "lib/dcp_content.h" +#include "lib/subtitle_content.h" #include <wx/spinctrl.h> #include <boost/foreach.hpp> @@ -157,14 +158,14 @@ void SubtitlePanel::film_content_changed (int property) { FFmpegContentList fc = _parent->selected_ffmpeg (); - SubtitleContentList sc = _parent->selected_subtitle (); + ContentList sc = _parent->selected_subtitle (); shared_ptr<FFmpegContent> fcs; if (fc.size() == 1) { fcs = fc.front (); } - shared_ptr<SubtitleContent> scs; + shared_ptr<Content> scs; if (sc.size() == 1) { scs = sc.front (); } @@ -185,20 +186,20 @@ SubtitlePanel::film_content_changed (int property) } setup_sensitivity (); } else if (property == SubtitleContentProperty::USE_SUBTITLES) { - checked_set (_use, scs ? scs->use_subtitles() : false); + checked_set (_use, scs ? scs->subtitle->use_subtitles() : false); setup_sensitivity (); } else if (property == SubtitleContentProperty::BURN_SUBTITLES) { - checked_set (_burn, scs ? scs->burn_subtitles() : false); + checked_set (_burn, scs ? scs->subtitle->burn_subtitles() : false); } else if (property == SubtitleContentProperty::SUBTITLE_X_OFFSET) { - checked_set (_x_offset, scs ? lrint (scs->subtitle_x_offset() * 100) : 0); + checked_set (_x_offset, scs ? lrint (scs->subtitle->subtitle_x_offset() * 100) : 0); } else if (property == SubtitleContentProperty::SUBTITLE_Y_OFFSET) { - checked_set (_y_offset, scs ? lrint (scs->subtitle_y_offset() * 100) : 0); + checked_set (_y_offset, scs ? lrint (scs->subtitle->subtitle_y_offset() * 100) : 0); } else if (property == SubtitleContentProperty::SUBTITLE_X_SCALE) { - checked_set (_x_scale, scs ? lrint (scs->subtitle_x_scale() * 100) : 100); + checked_set (_x_scale, scs ? lrint (scs->subtitle->subtitle_x_scale() * 100) : 100); } else if (property == SubtitleContentProperty::SUBTITLE_Y_SCALE) { - checked_set (_y_scale, scs ? lrint (scs->subtitle_y_scale() * 100) : 100); + checked_set (_y_scale, scs ? lrint (scs->subtitle->subtitle_y_scale() * 100) : 100); } else if (property == SubtitleContentProperty::SUBTITLE_LANGUAGE) { - checked_set (_language, scs ? scs->subtitle_language() : ""); + checked_set (_language, scs ? scs->subtitle->subtitle_language() : ""); } else if (property == DCPContentProperty::REFERENCE_SUBTITLE) { if (scs) { shared_ptr<DCPContent> dcp = dynamic_pointer_cast<DCPContent> (scs); @@ -214,16 +215,16 @@ SubtitlePanel::film_content_changed (int property) void SubtitlePanel::use_toggled () { - BOOST_FOREACH (shared_ptr<SubtitleContent> i, _parent->selected_subtitle ()) { - i->set_use_subtitles (_use->GetValue()); + BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_subtitle ()) { + i->subtitle->set_use_subtitles (_use->GetValue()); } } void SubtitlePanel::burn_toggled () { - BOOST_FOREACH (shared_ptr<SubtitleContent> i, _parent->selected_subtitle ()) { - i->set_burn_subtitles (_burn->GetValue()); + BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_subtitle ()) { + i->subtitle->set_burn_subtitles (_burn->GetValue()); } } @@ -235,13 +236,13 @@ SubtitlePanel::setup_sensitivity () int text_subs = 0; int dcp_subs = 0; int image_subs = 0; - SubtitleContentList sel = _parent->selected_subtitle (); - BOOST_FOREACH (shared_ptr<SubtitleContent> i, sel) { + ContentList sel = _parent->selected_subtitle (); + BOOST_FOREACH (shared_ptr<Content> i, sel) { shared_ptr<const FFmpegContent> fc = boost::dynamic_pointer_cast<const FFmpegContent> (i); shared_ptr<const TextSubtitleContent> sc = boost::dynamic_pointer_cast<const TextSubtitleContent> (i); shared_ptr<const DCPSubtitleContent> dsc = boost::dynamic_pointer_cast<const DCPSubtitleContent> (i); if (fc) { - if (fc->has_subtitles ()) { + if (fc->subtitle) { ++ffmpeg_subs; ++any_subs; } @@ -255,10 +256,10 @@ SubtitlePanel::setup_sensitivity () ++any_subs; } - if (i->has_image_subtitles ()) { + if (i->subtitle->has_image_subtitles ()) { ++image_subs; /* We must burn image subtitles at the moment */ - i->set_burn_subtitles (true); + i->subtitle->set_burn_subtitles (true); } } @@ -312,41 +313,41 @@ SubtitlePanel::stream_changed () void SubtitlePanel::x_offset_changed () { - BOOST_FOREACH (shared_ptr<SubtitleContent> i, _parent->selected_subtitle ()) { - i->set_subtitle_x_offset (_x_offset->GetValue() / 100.0); + BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_subtitle ()) { + i->subtitle->set_subtitle_x_offset (_x_offset->GetValue() / 100.0); } } void SubtitlePanel::y_offset_changed () { - BOOST_FOREACH (shared_ptr<SubtitleContent> i, _parent->selected_subtitle ()) { - i->set_subtitle_y_offset (_y_offset->GetValue() / 100.0); + BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_subtitle ()) { + i->subtitle->set_subtitle_y_offset (_y_offset->GetValue() / 100.0); } } void SubtitlePanel::x_scale_changed () { - SubtitleContentList c = _parent->selected_subtitle (); + ContentList c = _parent->selected_subtitle (); if (c.size() == 1) { - c.front()->set_subtitle_x_scale (_x_scale->GetValue() / 100.0); + c.front()->subtitle->set_subtitle_x_scale (_x_scale->GetValue() / 100.0); } } void SubtitlePanel::y_scale_changed () { - BOOST_FOREACH (shared_ptr<SubtitleContent> i, _parent->selected_subtitle ()) { - i->set_subtitle_y_scale (_y_scale->GetValue() / 100.0); + BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_subtitle ()) { + i->subtitle->set_subtitle_y_scale (_y_scale->GetValue() / 100.0); } } void SubtitlePanel::language_changed () { - BOOST_FOREACH (shared_ptr<SubtitleContent> i, _parent->selected_subtitle ()) { - i->set_subtitle_language (wx_to_std (_language->GetValue())); + BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_subtitle ()) { + i->subtitle->set_subtitle_language (wx_to_std (_language->GetValue())); } } @@ -373,7 +374,7 @@ SubtitlePanel::subtitle_view_clicked () _subtitle_view = 0; } - SubtitleContentList c = _parent->selected_subtitle (); + ContentList c = _parent->selected_subtitle (); DCPOMATIC_ASSERT (c.size() == 1); shared_ptr<SubtitleDecoder> decoder; @@ -402,7 +403,7 @@ SubtitlePanel::fonts_dialog_clicked () _fonts_dialog = 0; } - SubtitleContentList c = _parent->selected_subtitle (); + ContentList c = _parent->selected_subtitle (); DCPOMATIC_ASSERT (c.size() == 1); _fonts_dialog = new FontsDialog (this, c.front ()); @@ -428,7 +429,7 @@ SubtitlePanel::reference_clicked () void SubtitlePanel::appearance_dialog_clicked () { - SubtitleContentList c = _parent->selected_subtitle (); + ContentList c = _parent->selected_subtitle (); DCPOMATIC_ASSERT (c.size() == 1); shared_ptr<TextSubtitleContent> sr = dynamic_pointer_cast<TextSubtitleContent> (c.front ()); diff --git a/src/wx/subtitle_panel.h b/src/wx/subtitle_panel.h index 3dbae9909..f72b3c248 100644 --- a/src/wx/subtitle_panel.h +++ b/src/wx/subtitle_panel.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net> + Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/wx/text_subtitle_appearance_dialog.cc b/src/wx/text_subtitle_appearance_dialog.cc index bdab2c615..63df4fc20 100644 --- a/src/wx/text_subtitle_appearance_dialog.cc +++ b/src/wx/text_subtitle_appearance_dialog.cc @@ -19,6 +19,7 @@ #include "text_subtitle_appearance_dialog.h" #include "lib/text_subtitle_content.h" +#include "lib/subtitle_content.h" #include <wx/wx.h> #include <wx/clrpicker.h> @@ -42,17 +43,19 @@ TextSubtitleAppearanceDialog::TextSubtitleAppearanceDialog (wxWindow* parent, sh layout (); - _colour->SetColour (wxColour (_content->colour().r, _content->colour().g, _content->colour().b)); - _outline->SetValue (_content->outline ()); - _outline_colour->SetColour (wxColour (_content->outline_colour().r, _content->outline_colour().g, _content->outline_colour().b)); + _colour->SetColour (wxColour (_content->subtitle->colour().r, _content->subtitle->colour().g, _content->subtitle->colour().b)); + _outline->SetValue (_content->subtitle->outline ()); + _outline_colour->SetColour ( + wxColour (_content->subtitle->outline_colour().r, _content->subtitle->outline_colour().g, _content->subtitle->outline_colour().b) + ); } void TextSubtitleAppearanceDialog::apply () { wxColour const c = _colour->GetColour (); - _content->set_colour (dcp::Colour (c.Red(), c.Green(), c.Blue())); - _content->set_outline (_outline->GetValue ()); + _content->subtitle->set_colour (dcp::Colour (c.Red(), c.Green(), c.Blue())); + _content->subtitle->set_outline (_outline->GetValue ()); wxColour const oc = _outline_colour->GetColour (); - _content->set_outline_colour (dcp::Colour (oc.Red(), oc.Green(), oc.Blue())); + _content->subtitle->set_outline_colour (dcp::Colour (oc.Red(), oc.Green(), oc.Blue())); } diff --git a/src/wx/timeline.cc b/src/wx/timeline.cc index 31981deea..56af6f771 100644 --- a/src/wx/timeline.cc +++ b/src/wx/timeline.cc @@ -154,9 +154,8 @@ Timeline::recreate_views () _views.push_back (shared_ptr<TimelineView> (new TimelineAudioContentView (*this, i))); } - shared_ptr<SubtitleContent> sc = dynamic_pointer_cast<SubtitleContent> (i); - if (sc && sc->has_subtitles ()) { - _views.push_back (shared_ptr<TimelineView> (new TimelineSubtitleContentView (*this, sc))); + if (i->subtitle) { + _views.push_back (shared_ptr<TimelineView> (new TimelineSubtitleContentView (*this, i))); } } diff --git a/src/wx/timeline_content_view.h b/src/wx/timeline_content_view.h index b1b8ecd5d..046f0fecf 100644 --- a/src/wx/timeline_content_view.h +++ b/src/wx/timeline_content_view.h @@ -47,13 +47,16 @@ public: virtual wxColour background_colour () const = 0; virtual wxColour foreground_colour () const = 0; +protected: + + boost::weak_ptr<Content> _content; + private: void do_paint (wxGraphicsContext* gc, std::list<dcpomatic::Rect<int> > overlaps); int y_pos (int t) const; void content_changed (int p); - boost::weak_ptr<Content> _content; boost::optional<int> _track; bool _selected; diff --git a/src/wx/timeline_subtitle_content_view.cc b/src/wx/timeline_subtitle_content_view.cc index 2b6f8c4a9..83360ac42 100644 --- a/src/wx/timeline_subtitle_content_view.cc +++ b/src/wx/timeline_subtitle_content_view.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net> + Copyright (C) 2013-2016 Carl Hetherington <cth@carlh.net> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -19,12 +19,12 @@ #include "timeline_subtitle_content_view.h" #include "lib/subtitle_content.h" +#include "lib/content.h" using boost::shared_ptr; -TimelineSubtitleContentView::TimelineSubtitleContentView (Timeline& tl, shared_ptr<SubtitleContent> c) +TimelineSubtitleContentView::TimelineSubtitleContentView (Timeline& tl, shared_ptr<Content> c) : TimelineContentView (tl, c) - , _subtitle_content (c) { } @@ -32,7 +32,6 @@ TimelineSubtitleContentView::TimelineSubtitleContentView (Timeline& tl, shared_p wxColour TimelineSubtitleContentView::background_colour () const { - shared_ptr<SubtitleContent> sc = _subtitle_content.lock (); if (!active ()) { return wxColour (210, 210, 210, 128); } @@ -43,7 +42,6 @@ TimelineSubtitleContentView::background_colour () const wxColour TimelineSubtitleContentView::foreground_colour () const { - shared_ptr<SubtitleContent> sc = _subtitle_content.lock (); if (!active ()) { return wxColour (180, 180, 180, 128); } @@ -54,6 +52,7 @@ TimelineSubtitleContentView::foreground_colour () const bool TimelineSubtitleContentView::active () const { - shared_ptr<SubtitleContent> sc = _subtitle_content.lock (); - return sc && sc->use_subtitles(); + shared_ptr<Content> c = _content.lock (); + DCPOMATIC_ASSERT (c); + return c->subtitle && c->subtitle->use_subtitles(); } diff --git a/src/wx/timeline_subtitle_content_view.h b/src/wx/timeline_subtitle_content_view.h index 6b59912a3..d2b6a5a3c 100644 --- a/src/wx/timeline_subtitle_content_view.h +++ b/src/wx/timeline_subtitle_content_view.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net> + Copyright (C) 2013-2016 Carl Hetherington <cth@carlh.net> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -27,13 +27,10 @@ class SubtitleContent; class TimelineSubtitleContentView : public TimelineContentView { public: - TimelineSubtitleContentView (Timeline& tl, boost::shared_ptr<SubtitleContent> c); + TimelineSubtitleContentView (Timeline& tl, boost::shared_ptr<Content> c); private: bool active () const; wxColour background_colour () const; wxColour foreground_colour () const; - - boost::weak_ptr<SubtitleContent> _subtitle_content; }; - diff --git a/src/wx/timing_panel.cc b/src/wx/timing_panel.cc index 241b0f706..18a07add4 100644 --- a/src/wx/timing_panel.cc +++ b/src/wx/timing_panel.cc @@ -264,21 +264,20 @@ TimingPanel::film_content_changed (int property) int count_ac = 0; shared_ptr<const Content> ac; int count_sc = 0; - shared_ptr<const SubtitleContent> sc; + shared_ptr<const Content> sc; BOOST_FOREACH (shared_ptr<const Content> i, _parent->selected ()) { if (i->video) { check_vc.insert (i->video->video_frame_rate ()); vc = i; } shared_ptr<const AudioContent> at = dynamic_pointer_cast<const AudioContent> (i); - if (at) { + if (i->audio) { ++count_ac; ac = at; } - shared_ptr<const SubtitleContent> st = dynamic_pointer_cast<const SubtitleContent> (i); - if (st) { + if (i->subtitle) { ++count_sc; - sc = st; + sc = i; } } diff --git a/src/wx/video_panel.cc b/src/wx/video_panel.cc index f6f234a0d..718c3dd86 100644 --- a/src/wx/video_panel.cc +++ b/src/wx/video_panel.cc @@ -408,7 +408,7 @@ VideoPanel::edit_colour_conversion_clicked () return; } - ContentColourConversionDialog* d = new ContentColourConversionDialog (this, vc.front()->yuv ()); + ContentColourConversionDialog* d = new ContentColourConversionDialog (this, vc.front()->video->yuv ()); d->set (vc.front()->video->colour_conversion().get_value_or (PresetColourConversion::all().front ().conversion)); d->ShowModal (); vc.front()->video->set_colour_conversion (d->get ()); |
