X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fimagemagick_content_dialog.cc;h=52f3cf1a78d4c28855618621682fcf781dc7a12f;hb=f49d66270bff2577d39474a0c1c18a7a1b1f14f6;hp=726e4b8e2c5db315fc21eaa84ba7e6d6494b329f;hpb=147cca5876dfbdf56e21289c3a36bec4b4850191;p=dcpomatic.git diff --git a/src/wx/imagemagick_content_dialog.cc b/src/wx/imagemagick_content_dialog.cc index 726e4b8e2..52f3cf1a7 100644 --- a/src/wx/imagemagick_content_dialog.cc +++ b/src/wx/imagemagick_content_dialog.cc @@ -1,3 +1,5 @@ +/* -*- c-basic-offset: 8; default-tab-width: 8; -*- */ + /* Copyright (C) 2013 Carl Hetherington @@ -23,9 +25,11 @@ #include "wx_util.h" using boost::shared_ptr; +using boost::dynamic_pointer_cast; ImageMagickContentDialog::ImageMagickContentDialog (wxWindow* parent, shared_ptr content) : wxDialog (parent, wxID_ANY, _("Image")) + , _content (content) { wxFlexGridSizer* grid = new wxFlexGridSizer (3, 6, 6); grid->AddGrowableCol (1, 1); @@ -53,10 +57,16 @@ ImageMagickContentDialog::ImageMagickContentDialog (wxWindow* parent, shared_ptr overall_sizer->SetSizeHints (this); checked_set (_video_length, content->video_length () / 24); + _video_length->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (ImageMagickContentDialog::video_length_changed), 0, this); } -int -ImageMagickContentDialog::video_length () const +void +ImageMagickContentDialog::video_length_changed (wxCommandEvent &) { - return _video_length->GetValue (); + shared_ptr c = _content.lock (); + if (!c) { + return; + } + + c->set_video_length (_video_length->GetValue() * 24); }