Basic display of markers above the playback timeline (#1921).
[dcpomatic.git] / src / wx / controls.cc
index a90ac79b40e5b89ab706a55a9e0a1a3ecb4b368d..6d4d2db3e727d3269165365fc62ec21be1a3f268 100644 (file)
@@ -24,6 +24,7 @@
 #include "controls.h"
 #include "dcpomatic_button.h"
 #include "film_viewer.h"
+#include "markers_panel.h"
 #include "playhead_to_frame_dialog.h"
 #include "playhead_to_timecode_dialog.h"
 #include "static_text.h"
 #include <wx/progdlg.h>
 
 
-using std::string;
-using std::list;
 using std::cout;
-using std::make_pair;
+using std::dynamic_pointer_cast;
 using std::exception;
-using boost::optional;
+using std::list;
+using std::make_pair;
 using std::shared_ptr;
+using std::string;
 using std::weak_ptr;
-using std::dynamic_pointer_cast;
+using boost::optional;
 #if BOOST_VERSION >= 106100
 using namespace boost::placeholders;
 #endif
@@ -62,6 +63,7 @@ using namespace dcpomatic;
 
 Controls::Controls (wxWindow* parent, shared_ptr<FilmViewer> viewer, bool editor_controls)
        : wxPanel (parent)
+       , _markers (new MarkersPanel(this, viewer))
        , _slider (new wxSlider(this, wxID_ANY, 0, 0, 4096))
        , _viewer (viewer)
        , _slider_being_moved (false)
@@ -107,7 +109,12 @@ Controls::Controls (wxWindow* parent, shared_ptr<FilmViewer> viewer, bool editor
        _button_sizer = new wxBoxSizer (wxHORIZONTAL);
        h_sizer->Add (_button_sizer, 0, wxEXPAND);
 
-       h_sizer->Add (_slider, 1, wxEXPAND);
+       {
+               auto box = new wxBoxSizer (wxVERTICAL);
+               box->Add (_markers, 0, wxEXPAND);
+               box->Add (_slider, 0, wxEXPAND);
+               h_sizer->Add (box, 1, wxEXPAND);
+       }
 
        _v_sizer->Add (h_sizer, 0, wxEXPAND | wxALL, 6);
 
@@ -466,6 +473,8 @@ Controls::set_film (shared_ptr<Film> film)
 
        _film = film;
 
+       _markers->set_film (_film);
+
        if (_film) {
                _film_change_connection = _film->Change.connect (boost::bind(&Controls::film_change, this, _1, _2));
        }