std::shared_ptr
[dcpomatic.git] / src / wx / film_editor.cc
index 59b44cd8c0e3ab53949352a6ac312fb672b1ed2c..ce91c3cc49565a06e288c27dfca0f3f13c891983 100644 (file)
 using std::cout;
 using std::string;
 using std::list;
-using boost::shared_ptr;
-using boost::weak_ptr;
+using std::shared_ptr;
+using std::weak_ptr;
 using boost::optional;
+#if BOOST_VERSION >= 106100
+using namespace boost::placeholders;
+#endif
 
 FilmEditor::FilmEditor (wxWindow* parent, weak_ptr<FilmViewer> viewer)
        : wxPanel (parent)
@@ -52,7 +55,7 @@ FilmEditor::FilmEditor (wxWindow* parent, weak_ptr<FilmViewer> viewer)
 
        _content_panel = new ContentPanel (_main_notebook, _film, viewer);
        _main_notebook->AddPage (_content_panel->window(), _("Content"), true);
-       _dcp_panel = new DCPPanel (_main_notebook, _film);
+       _dcp_panel = new DCPPanel (_main_notebook, _film, viewer);
        _main_notebook->AddPage (_dcp_panel->panel (), _("DCP"), false);
 
        JobManager::instance()->ActiveJobsChanged.connect (
@@ -125,18 +128,21 @@ FilmEditor::set_film (shared_ptr<Film> film)
        _content_panel->set_film (_film);
        _dcp_panel->set_film (_film);
 
-       if (_film) {
-               _film->Change.connect (bind (&FilmEditor::film_change, this, _1, _2));
-               _film->ContentChange.connect (bind (&FilmEditor::film_content_change, this, _1, _3));
+       if (!_film) {
+               FileChanged ("");
+               return;
        }
 
-       if (_film && _film->directory()) {
+       _film->Change.connect (bind (&FilmEditor::film_change, this, _1, _2));
+       _film->ContentChange.connect (bind (&FilmEditor::film_content_change, this, _1, _3));
+
+       if (_film->directory()) {
                FileChanged (_film->directory().get());
        } else {
                FileChanged ("");
        }
 
-       if (!_film->content().empty ()) {
+       if (!_film->content().empty()) {
                _content_panel->set_selection (_film->content().front ());
        }
 }
@@ -153,3 +159,11 @@ FilmEditor::active_jobs_changed (optional<string> j)
 {
        set_general_sensitivity (!j);
 }
+
+
+void
+FilmEditor::first_shown ()
+{
+       _content_panel->first_shown ();
+}
+