+void
+ContentAdvancedDialog::setup_filters ()
+{
+ shared_ptr<FFmpegContent> fcs = dynamic_pointer_cast<FFmpegContent>(_content);
+ if (!fcs) {
+ checked_set (_filters, _("None"));
+ _filters->Enable (false);
+ _filters_button->Enable (false);
+ return;
+ }
+
+ string p = Filter::ffmpeg_string (fcs->filters());
+ if (p.empty()) {
+ checked_set (_filters, _("None"));
+ } else {
+ if (p.length() > 25) {
+ p = p.substr(0, 25) + "...";
+ }
+ checked_set (_filters, p);
+ }
+}
+
+
+void
+ContentAdvancedDialog::edit_filters ()
+{
+ shared_ptr<FFmpegContent> fcs = dynamic_pointer_cast<FFmpegContent>(_content);
+ if (!fcs) {
+ return;
+ }
+
+ FilterDialog* d = new FilterDialog (this, fcs->filters());
+ d->ActiveChanged.connect (bind(&ContentAdvancedDialog::filters_changed, this, _1));
+ d->ShowModal ();
+ d->Destroy ();
+}
+
+
+void
+ContentAdvancedDialog::filters_changed (vector<Filter const *> filters)
+{
+ shared_ptr<FFmpegContent> fcs = dynamic_pointer_cast<FFmpegContent>(_content);
+ if (!fcs) {
+ return;
+ }
+
+ fcs->set_filters (filters);
+ setup_filters ();
+}
+