X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fwx%2Ftimeline_dialog.cc;h=dbf7ae232be2cd5f72dd8a247e98a80fff968fa7;hb=b666a794a130386bc01ede2143ef40bd6973eb32;hp=91d1f7b07d3652ecd67e0251dc75e9c68a08f837;hpb=21ce34c2cd04a2e7e133ff693b84c054182f4f91;p=dcpomatic.git diff --git a/src/wx/timeline_dialog.cc b/src/wx/timeline_dialog.cc index 91d1f7b07..dbf7ae232 100644 --- a/src/wx/timeline_dialog.cc +++ b/src/wx/timeline_dialog.cc @@ -19,23 +19,38 @@ #include #include +#include "lib/playlist.h" +#include "film_editor.h" #include "timeline_dialog.h" #include "wx_util.h" -#include "playlist.h" using std::list; using std::cout; using boost::shared_ptr; -TimelineDialog::TimelineDialog (wxWindow* parent, shared_ptr film) - : wxDialog (parent, wxID_ANY, _("Timeline"), wxDefaultPosition, wxSize (640, 512), wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxFULL_REPAINT_ON_RESIZE) - , _timeline (this, film) +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) { wxBoxSizer* sizer = new wxBoxSizer (wxVERTICAL); - + + wxBoxSizer* controls = new wxBoxSizer (wxHORIZONTAL); + _snap = new wxCheckBox (this, wxID_ANY, _("Snap")); + controls->Add (_snap); + + sizer->Add (controls, 0, wxALL, 12); sizer->Add (&_timeline, 1, wxEXPAND | wxALL, 12); SetSizer (sizer); sizer->Layout (); sizer->SetSizeHints (this); + + _snap->SetValue (_timeline.snap ()); + _snap->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&TimelineDialog::snap_toggled, this)); +} + +void +TimelineDialog::snap_toggled () +{ + _timeline.set_snap (_snap->GetValue ()); }