summaryrefslogtreecommitdiff
path: root/src/wx
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-05-25 01:07:35 +0100
committerCarl Hetherington <cth@carlh.net>2013-05-25 01:07:35 +0100
commit996b0c06e23bcb6b300d7b8799df94993692e07d (patch)
tree615ff0c372dac97321489e3cb7f316cb4cb9eeec /src/wx
parent4f03da3aa12525cb8389ddefee629f5d0b2ac0aa (diff)
parent907735ee6ca162583c7c9d20f5603a6db83a149f (diff)
Merge master and multifarious hackery.
Diffstat (limited to 'src/wx')
-rw-r--r--src/wx/film_editor.cc39
-rw-r--r--src/wx/film_viewer.cc10
2 files changed, 25 insertions, 24 deletions
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<string, string> 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<Content> 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<string, string> 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<Film> 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<Film> f)
film_content_changed (boost::shared_ptr<Content> (), FFmpegContentProperty::SUBTITLE_STREAM);
film_content_changed (boost::shared_ptr<Content> (), FFmpegContentProperty::AUDIO_STREAMS);
film_content_changed (boost::shared_ptr<Content> (), FFmpegContentProperty::AUDIO_STREAM);
+ film_content_changed (boost::shared_ptr<Content> (), 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<Content> c = selected_content ();
+ if (!c) {
+ return;
+ }
+
+ shared_ptr<FFmpegContent> fc = dynamic_pointer_cast<FFmpegContent> (c);
+ if (!fc) {
+ return;
+ }
+
+ FilterDialog* d = new FilterDialog (this, fc->filters());
+ d->ActiveChanged.connect (bind (&FFmpegContent::set_filters, fc, _1));
d->ShowModal ();
d->Destroy ();
}
diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc
index d08afe7a4..4b1fb442e 100644
--- a/src/wx/film_viewer.cc
+++ b/src/wx/film_viewer.cc
@@ -135,7 +135,6 @@ FilmViewer::film_changed (Film::Property p)
_panel->Update ();
break;
case Film::SCALER:
- case Film::FILTERS:
update_from_decoder ();
break;
default:
@@ -301,15 +300,8 @@ FilmViewer::raw_to_display ()
return;
}
- shared_ptr<const Image> input = _raw_frame;
-
- pair<string, string> const s = Filter::ffmpeg_strings (_film->filters());
- if (!s.second.empty ()) {
- input = input->post_process (s.second, true);
- }
-
/* Get a compacted image as we have to feed it to wxWidgets */
- _display_frame = input->scale_and_convert_to_rgb (_film_size, 0, _film->scaler(), false);
+ _display_frame = _raw_frame->scale_and_convert_to_rgb (_film_size, 0, _film->scaler(), false);
if (_raw_sub) {