X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Ftimeline_dialog.cc;h=a63c219dbfb43ca3966cd076653f6a9afd18e44c;hb=f58d9e44302151dea9f594acd9fc27a331fa77fb;hp=35d5eec2105b5190ccaedd91973706c29895aa1f;hpb=a183c1776cfd020a37d028ebb0f641352f49697b;p=dcpomatic.git diff --git a/src/wx/timeline_dialog.cc b/src/wx/timeline_dialog.cc index 35d5eec21..a63c219db 100644 --- a/src/wx/timeline_dialog.cc +++ b/src/wx/timeline_dialog.cc @@ -19,24 +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 (FilmEditor* ed, shared_ptr film) - : wxDialog (ed, wxID_ANY, _("Timeline"), wxDefaultPosition, wxSize (640, 512), wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxFULL_REPAINT_ON_RESIZE) +DCPTimelineDialog::DCPTimelineDialog (FilmEditor* ed, shared_ptr film) + : wxDialog (ed, wxID_ANY, _("DCPTimeline"), 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 (&DCPTimelineDialog::snap_toggled, this)); +} + +void +DCPTimelineDialog::snap_toggled () +{ + _timeline.set_snap (_snap->GetValue ()); }