X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fwx%2Fvideo_panel.cc;h=5c66588888a1c8f4a3a0f831d22972d0204dfafb;hb=7de09ede7bc6e34bea6ab3e7982efb51ca399b7d;hp=227f6c6477e8c6e375adb0f88c438b3a44566012;hpb=7ddba2932f3e577ecde3324a2094037252bdde18;p=dcpomatic.git diff --git a/src/wx/video_panel.cc b/src/wx/video_panel.cc index 227f6c647..5c6658888 100644 --- a/src/wx/video_panel.cc +++ b/src/wx/video_panel.cc @@ -204,7 +204,7 @@ VideoPanel::VideoPanel (ContentPanel* p) ++r; _description = new wxStaticText (this, wxID_ANY, wxT ("\n \n \n \n \n"), wxDefaultPosition, wxDefaultSize); - grid->Add (_description, wxGBPosition (r, 0), wxGBSpan (1, 4), wxEXPAND | wxALIGN_CENTER_VERTICAL | wxALL, 6); + grid->Add (_description, wxGBPosition (r, 0), wxGBSpan (1, 4), wxEXPAND | wxALIGN_CENTER_VERTICAL, 6); wxFont font = _description->GetFont(); font.SetStyle(wxFONTSTYLE_ITALIC); font.SetPointSize(font.GetPointSize() - 1); @@ -273,23 +273,20 @@ VideoPanel::film_content_changed (int property) } else if (property == VideoContentProperty::VIDEO_FRAME_RATE) { setup_description (); } else if (property == VideoContentProperty::COLOUR_CONVERSION) { - if (!vcs) { - checked_set (_colour_conversion, 0); - _edit_colour_conversion_button->Enable (false); - } else if (vcs->colour_conversion ()) { + if (vcs && vcs->colour_conversion ()) { optional preset = vcs->colour_conversion().get().preset (); vector cc = PresetColourConversion::all (); if (preset) { checked_set (_colour_conversion, preset.get() + 1); - _edit_colour_conversion_button->Enable (false); } else { checked_set (_colour_conversion, cc.size() + 1); - _edit_colour_conversion_button->Enable (true); } } else { checked_set (_colour_conversion, 0); - _edit_colour_conversion_button->Enable (false); } + + setup_sensitivity (); + } else if (property == FFmpegContentProperty::FILTERS) { if (fcs) { string p = Filter::ffmpeg_string (fcs->filters ()); @@ -402,7 +399,7 @@ VideoPanel::edit_colour_conversion_clicked () return; } - ContentColourConversionDialog* d = new ContentColourConversionDialog (this); + ContentColourConversionDialog* d = new ContentColourConversionDialog (this, vc.front()->yuv ()); d->set (vc.front()->colour_conversion().get_value_or (PresetColourConversion::all().front ().conversion)); d->ShowModal (); vc.front()->set_colour_conversion (d->get ()); @@ -468,7 +465,6 @@ VideoPanel::setup_sensitivity () _filters->Enable (false); _filters_button->Enable (false); _colour_conversion->Enable (false); - _edit_colour_conversion_button->Enable (false); } else { VideoContentList video_sel = _parent->selected_video (); FFmpegContentList ffmpeg_sel = _parent->selected_ffmpeg (); @@ -486,7 +482,18 @@ VideoPanel::setup_sensitivity () _filters->Enable (true); _filters_button->Enable (single && !ffmpeg_sel.empty ()); _colour_conversion->Enable (single && !video_sel.empty ()); - _edit_colour_conversion_button->Enable (true); + } + + VideoContentList vc = _parent->selected_video (); + shared_ptr vcs; + if (!vc.empty ()) { + vcs = vc.front (); + } + + if (vcs && vcs->colour_conversion ()) { + _edit_colour_conversion_button->Enable (!vcs->colour_conversion().get().preset()); + } else { + _edit_colour_conversion_button->Enable (false); } }