wxSizer* s = new wxBoxSizer (wxHORIZONTAL);
wxClientDC dc (this);
- wxSize size = dc.GetTextExtent (wxT ("A quite long name"));
+ wxSize size = dc.GetTextExtent (wxT ("A quite long-ish name"));
size.SetHeight (-1);
_filters = new wxStaticText (this, wxID_ANY, _("None"), wxDefaultPosition, size);
++r;
{
- add_label_to_grid_bag_sizer (grid, this, _("Colour conversion"), true, wxGBPosition (r, 0));
+ _enable_colour_conversion = new wxCheckBox (this, wxID_ANY, _("Colour conversion"));
+ grid->Add (_enable_colour_conversion, wxGBPosition (r, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
+
wxSizer* s = new wxBoxSizer (wxHORIZONTAL);
wxClientDC dc (this);
- wxSize size = dc.GetTextExtent (wxT ("A quite long name"));
+ wxSize size = dc.GetTextExtent (wxT ("A quite long-ish name"));
size.SetHeight (-1);
_colour_conversion = new wxStaticText (this, wxID_ANY, wxT (""), wxDefaultPosition, size);
_frame_type->wrapped()->Append (_("3D right only"));
_filters_button->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&VideoPanel::edit_filters_clicked, this));
+ _enable_colour_conversion->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&VideoPanel::enable_colour_conversion_clicked, this));
_colour_conversion_button->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&VideoPanel::edit_colour_conversion_clicked, this));
}
} else if (property == VideoContentProperty::VIDEO_FRAME_RATE) {
setup_description ();
} else if (property == VideoContentProperty::COLOUR_CONVERSION) {
- optional<size_t> preset = vcs ? vcs->colour_conversion().preset () : optional<size_t> ();
- vector<PresetColourConversion> cc = Config::instance()->colour_conversions ();
- _colour_conversion->SetLabel (preset ? std_to_wx (cc[preset.get()].name) : _("Custom"));
+ if (!vcs) {
+ _colour_conversion->SetLabel (wxT (""));
+ } else if (vcs->colour_conversion ()) {
+ optional<size_t> preset = vcs->colour_conversion().get().preset ();
+ vector<PresetColourConversion> cc = Config::instance()->colour_conversions ();
+ _colour_conversion->SetLabel (preset ? std_to_wx (cc[preset.get()].name) : _("Custom"));
+ _enable_colour_conversion->SetValue (true);
+ _colour_conversion->Enable (true);
+ _colour_conversion_button->Enable (true);
+ } else {
+ _colour_conversion->SetLabel (_("None"));
+ _enable_colour_conversion->SetValue (false);
+ _colour_conversion->Enable (false);
+ _colour_conversion_button->Enable (false);
+ }
} else if (property == FFmpegContentProperty::FILTERS) {
if (fcs) {
string const p = Filter::ffmpeg_string (fcs->filters ());
return;
}
- ColourConversion conversion = vc.front()->colour_conversion ();
+ if (!vc.front()->colour_conversion ()) {
+ return;
+ }
+
+ ColourConversion conversion = vc.front()->colour_conversion().get ();
ContentColourConversionDialog* d = new ContentColourConversionDialog (this);
d->set (conversion);
d->ShowModal ();
film_content_changed (VideoContentProperty::COLOUR_CONVERSION);
film_content_changed (FFmpegContentProperty::FILTERS);
}
+
+void
+VideoPanel::enable_colour_conversion_clicked ()
+{
+ VideoContentList vc = _editor->selected_video_content ();
+ if (vc.size() != 1) {
+ return;
+ }
+
+ if (_enable_colour_conversion->GetValue()) {
+ vc.front()->set_default_colour_conversion ();
+ } else {
+ vc.front()->unset_colour_conversion ();
+ }
+}