X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fwx%2Ffilm_editor.cc;fp=src%2Fwx%2Ffilm_editor.cc;h=36d63b8055a4b7de144c8facdc1ac40f5d37cc8a;hb=996b0c06e23bcb6b300d7b8799df94993692e07d;hp=5cf0b789713a363da28d2dc494b416c93c5dff46;hpb=4f03da3aa12525cb8389ddefee629f5d0b2ac0aa;p=dcpomatic.git diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc index 5cf0b7897..36d63b805 100644 --- a/src/wx/film_editor.cc +++ b/src/wx/film_editor.cc @@ -590,18 +590,6 @@ FilmEditor::film_changed (Film::Property p) case Film::CONTAINER: setup_container (); break; - case Film::FILTERS: - { - pair p = Filter::ffmpeg_strings (_film->filters ()); - if (p.first.empty () && p.second.empty ()) { - _filters->SetLabel (_("None")); - } else { - string const b = p.first + " " + p.second; - _filters->SetLabel (std_to_wx (b)); - } - _dcp_sizer->Layout (); - break; - } case Film::NAME: checked_set (_name, _film->name()); setup_dcp_name (); @@ -722,6 +710,17 @@ FilmEditor::film_content_changed (weak_ptr weak_content, int property) } else if (property == FFmpegContentProperty::AUDIO_STREAM) { setup_dcp_name (); setup_show_audio_sensitivity (); + } else if (property == FFmpegContentProperty::FILTERS) { + if (ffmpeg_content) { + pair p = Filter::ffmpeg_strings (ffmpeg_content->filters ()); + if (p.first.empty () && p.second.empty ()) { + _filters->SetLabel (_("None")); + } else { + string const b = p.first + " " + p.second; + _filters->SetLabel (std_to_wx (b)); + } + _dcp_sizer->Layout (); + } } } @@ -809,7 +808,6 @@ FilmEditor::set_film (shared_ptr f) film_changed (Film::LOOP); film_changed (Film::DCP_CONTENT_TYPE); film_changed (Film::CONTAINER); - film_changed (Film::FILTERS); film_changed (Film::SCALER); film_changed (Film::WITH_SUBTITLES); film_changed (Film::SUBTITLE_OFFSET); @@ -826,6 +824,7 @@ FilmEditor::set_film (shared_ptr f) film_content_changed (boost::shared_ptr (), FFmpegContentProperty::SUBTITLE_STREAM); film_content_changed (boost::shared_ptr (), FFmpegContentProperty::AUDIO_STREAMS); film_content_changed (boost::shared_ptr (), FFmpegContentProperty::AUDIO_STREAM); + film_content_changed (boost::shared_ptr (), FFmpegContentProperty::FILTERS); } /** Updates the sensitivity of lots of widgets to a given value. @@ -867,8 +866,18 @@ FilmEditor::set_things_sensitive (bool s) void FilmEditor::edit_filters_clicked (wxCommandEvent &) { - FilterDialog* d = new FilterDialog (this, _film->filters()); - d->ActiveChanged.connect (bind (&Film::set_filters, _film, _1)); + shared_ptr c = selected_content (); + if (!c) { + return; + } + + shared_ptr fc = dynamic_pointer_cast (c); + if (!fc) { + return; + } + + FilterDialog* d = new FilterDialog (this, fc->filters()); + d->ActiveChanged.connect (bind (&FFmpegContent::set_filters, fc, _1)); d->ShowModal (); d->Destroy (); }