X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Ftimeline_dialog.cc;h=2da375ecdca76886a680429e40cda753bd153958;hb=b6c780d3107557d452c6612d715d01e2be52dbda;hp=dbf7ae232be2cd5f72dd8a247e98a80fff968fa7;hpb=1b1bc528ee5ca1fee1bd33f9fb6f79cd551e3b33;p=dcpomatic.git diff --git a/src/wx/timeline_dialog.cc b/src/wx/timeline_dialog.cc index dbf7ae232..2da375ecd 100644 --- a/src/wx/timeline_dialog.cc +++ b/src/wx/timeline_dialog.cc @@ -23,20 +23,24 @@ #include "film_editor.h" #include "timeline_dialog.h" #include "wx_util.h" +#include "content_panel.h" using std::list; using std::cout; using boost::shared_ptr; -TimelineDialog::TimelineDialog (FilmEditor* ed, shared_ptr film) - : wxDialog (ed, wxID_ANY, _("Timeline"), wxDefaultPosition, wxSize (640, 512), wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxFULL_REPAINT_ON_RESIZE) - , _timeline (this, ed, film) +TimelineDialog::TimelineDialog (ContentPanel* cp, shared_ptr film) + : wxDialog (cp->panel(), wxID_ANY, _("Timeline"), wxDefaultPosition, wxSize (640, 512), wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxFULL_REPAINT_ON_RESIZE) + , _film (film) + , _timeline (this, cp, film) { wxBoxSizer* sizer = new wxBoxSizer (wxVERTICAL); wxBoxSizer* controls = new wxBoxSizer (wxHORIZONTAL); _snap = new wxCheckBox (this, wxID_ANY, _("Snap")); controls->Add (_snap); + _sequence_video = new wxCheckBox (this, wxID_ANY, _("Keep video in sequence")); + controls->Add (_sequence_video, 1, wxLEFT, 12); sizer->Add (controls, 0, wxALL, 12); sizer->Add (&_timeline, 1, wxEXPAND | wxALL, 12); @@ -47,6 +51,10 @@ TimelineDialog::TimelineDialog (FilmEditor* ed, shared_ptr film) _snap->SetValue (_timeline.snap ()); _snap->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&TimelineDialog::snap_toggled, this)); + film_changed (Film::SEQUENCE_VIDEO); + _snap->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&TimelineDialog::sequence_video_toggled, this)); + + film->Changed.connect (bind (&TimelineDialog::film_changed, this, _1)); } void @@ -54,3 +62,27 @@ TimelineDialog::snap_toggled () { _timeline.set_snap (_snap->GetValue ()); } + +void +TimelineDialog::sequence_video_toggled () +{ + shared_ptr film = _film.lock (); + if (!film) { + return; + } + + film->set_sequence_video (_sequence_video->GetValue ()); +} + +void +TimelineDialog::film_changed (Film::Property p) +{ + shared_ptr film = _film.lock (); + if (!film) { + return; + } + + if (p == Film::SEQUENCE_VIDEO) { + _sequence_video->SetValue (film->sequence_video ()); + } +}