Formatting / C++11 tidying.
authorCarl Hetherington <cth@carlh.net>
Sun, 4 Apr 2021 21:01:49 +0000 (23:01 +0200)
committerCarl Hetherington <cth@carlh.net>
Sun, 4 Apr 2021 21:01:49 +0000 (23:01 +0200)
src/wx/content_panel.cc
src/wx/content_panel.h

index 96d3cd2513cf0c3ca966714282764b9d9ee35877..7789e7b786b4fc8366b3d10f32d24d21bf1406a9 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2019 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
-#include "content_panel.h"
-#include "wx_util.h"
-#include "video_panel.h"
+
 #include "audio_panel.h"
+#include "content_panel.h"
+#include "dcpomatic_button.h"
+#include "film_viewer.h"
+#include "image_sequence_dialog.h"
 #include "text_panel.h"
-#include "timing_panel.h"
 #include "timeline_dialog.h"
-#include "image_sequence_dialog.h"
-#include "film_viewer.h"
-#include "dcpomatic_button.h"
+#include "timing_panel.h"
+#include "video_panel.h"
+#include "wx_util.h"
 #include "lib/audio_content.h"
-#include "lib/text_content.h"
-#include "lib/video_content.h"
-#include "lib/ffmpeg_content.h"
-#include "lib/content_factory.h"
-#include "lib/image_content.h"
-#include "lib/dcp_content.h"
 #include "lib/case_insensitive_sorter.h"
-#include "lib/playlist.h"
+#include "lib/compose.hpp"
 #include "lib/config.h"
+#include "lib/content_factory.h"
+#include "lib/dcp_content.h"
+#include "lib/dcpomatic_log.h"
+#include "lib/ffmpeg_content.h"
+#include "lib/image_content.h"
 #include "lib/log.h"
-#include "lib/compose.hpp"
-#include "lib/string_text_file_content.h"
+#include "lib/playlist.h"
 #include "lib/string_text_file.h"
-#include "lib/dcpomatic_log.h"
+#include "lib/string_text_file_content.h"
+#include "lib/text_content.h"
+#include "lib/video_content.h"
 #include <wx/wx.h>
 #include <wx/notebook.h>
 #include <wx/listctrl.h>
 #include <boost/filesystem.hpp>
 #include <iostream>
 
-using std::list;
-using std::string;
+
 using std::cout;
-using std::vector;
-using std::max;
+using std::dynamic_pointer_cast;
 using std::exception;
+using std::list;
+using std::make_shared;
+using std::max;
 using std::shared_ptr;
+using std::string;
+using std::vector;
 using std::weak_ptr;
-using std::dynamic_pointer_cast;
 using boost::optional;
 using namespace dcpomatic;
 #if BOOST_VERSION >= 106100
@@ -67,11 +70,7 @@ using namespace boost::placeholders;
 
 
 ContentPanel::ContentPanel (wxNotebook* n, shared_ptr<Film> film, weak_ptr<FilmViewer> viewer)
-       : _video_panel (0)
-       , _audio_panel (0)
-       , _timeline_dialog (0)
-       , _parent (n)
-       , _last_selected_tab (0)
+       : _parent (n)
        , _film (film)
        , _film_viewer (viewer)
        , _generally_sensitive (true)
@@ -177,6 +176,7 @@ ContentPanel::selected ()
        return sel;
 }
 
+
 ContentList
 ContentPanel::selected_video ()
 {
@@ -191,6 +191,7 @@ ContentPanel::selected_video ()
        return vc;
 }
 
+
 ContentList
 ContentPanel::selected_audio ()
 {
@@ -205,6 +206,7 @@ ContentPanel::selected_audio ()
        return ac;
 }
 
+
 ContentList
 ContentPanel::selected_text ()
 {
@@ -219,6 +221,7 @@ ContentPanel::selected_text ()
        return sc;
 }
 
+
 FFmpegContentList
 ContentPanel::selected_ffmpeg ()
 {
@@ -234,6 +237,7 @@ ContentPanel::selected_ffmpeg ()
        return sc;
 }
 
+
 void
 ContentPanel::film_changed (Film::Property p)
 {
@@ -251,6 +255,7 @@ ContentPanel::film_changed (Film::Property p)
        }
 }
 
+
 void
 ContentPanel::item_deselected ()
 {
@@ -261,6 +266,7 @@ ContentPanel::item_deselected ()
        signal_manager->when_idle (boost::bind (&ContentPanel::item_deselected_idle, this));
 }
 
+
 void
 ContentPanel::item_deselected_idle ()
 {
@@ -269,6 +275,7 @@ ContentPanel::item_deselected_idle ()
        }
 }
 
+
 void
 ContentPanel::item_selected ()
 {
@@ -276,6 +283,7 @@ ContentPanel::item_selected ()
        check_selection ();
 }
 
+
 void
 ContentPanel::check_selection ()
 {
@@ -401,6 +409,7 @@ ContentPanel::check_selection ()
        SelectionChanged ();
 }
 
+
 void
 ContentPanel::add_file_clicked ()
 {
@@ -441,6 +450,7 @@ ContentPanel::add_file_clicked ()
        d->Destroy ();
 }
 
+
 void
 ContentPanel::add_folder_clicked ()
 {
@@ -486,6 +496,7 @@ ContentPanel::add_folder_clicked ()
        }
 }
 
+
 void
 ContentPanel::add_dcp_clicked ()
 {
@@ -499,12 +510,13 @@ ContentPanel::add_dcp_clicked ()
        }
 
        try {
-               _film->examine_and_add_content (shared_ptr<Content> (new DCPContent (path)));
+               _film->examine_and_add_content (make_shared<DCPContent>(path));
        } catch (exception& e) {
                error_dialog (_parent, e.what());
        }
 }
 
+
 /** @return true if this remove "click" should be ignored */
 bool
 ContentPanel::remove_clicked (bool hotkey)
@@ -524,6 +536,7 @@ ContentPanel::remove_clicked (bool hotkey)
        return false;
 }
 
+
 void
 ContentPanel::timeline_clicked ()
 {
@@ -541,12 +554,14 @@ ContentPanel::timeline_clicked ()
        _timeline_dialog->Show ();
 }
 
+
 void
 ContentPanel::right_click (wxListEvent& ev)
 {
        _menu->popup (_film, selected (), TimelineContentViewList (), ev.GetPoint ());
 }
 
+
 /** Set up broad sensitivity based on the type of content that is selected */
 void
 ContentPanel::setup_sensitivity ()
@@ -578,6 +593,7 @@ ContentPanel::setup_sensitivity ()
        _timing_panel->Enable (_generally_sensitive);
 }
 
+
 void
 ContentPanel::set_film (shared_ptr<Film> film)
 {
@@ -597,6 +613,7 @@ ContentPanel::set_film (shared_ptr<Film> film)
        setup_sensitivity ();
 }
 
+
 void
 ContentPanel::set_general_sensitivity (bool s)
 {
@@ -604,6 +621,7 @@ ContentPanel::set_general_sensitivity (bool s)
        setup_sensitivity ();
 }
 
+
 void
 ContentPanel::earlier_clicked ()
 {
@@ -614,6 +632,7 @@ ContentPanel::earlier_clicked ()
        }
 }
 
+
 void
 ContentPanel::later_clicked ()
 {
@@ -624,6 +643,7 @@ ContentPanel::later_clicked ()
        }
 }
 
+
 void
 ContentPanel::set_selection (weak_ptr<Content> wc)
 {
@@ -637,6 +657,7 @@ ContentPanel::set_selection (weak_ptr<Content> wc)
        }
 }
 
+
 void
 ContentPanel::set_selection (ContentList cl)
 {
@@ -681,6 +702,7 @@ ContentPanel::film_content_changed (int property)
        }
 }
 
+
 void
 ContentPanel::setup ()
 {
@@ -749,6 +771,7 @@ ContentPanel::setup ()
        setup_sensitivity ();
 }
 
+
 void
 ContentPanel::files_dropped (wxDropFilesEvent& event)
 {
@@ -765,6 +788,7 @@ ContentPanel::files_dropped (wxDropFilesEvent& event)
        add_files (path_list);
 }
 
+
 void
 ContentPanel::add_files (list<boost::filesystem::path> paths)
 {
@@ -788,6 +812,7 @@ ContentPanel::add_files (list<boost::filesystem::path> paths)
        }
 }
 
+
 list<ContentSubPanel*>
 ContentPanel::panels () const
 {
index 70568ccc044bf2be3230de382008a4ae122b71ea..2a74df215fcbdf03588e5e8f5590be04068e0ad6 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2019 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include "content_menu.h"
-#include "lib/types.h"
 #include "lib/film.h"
+#include "lib/types.h"
 #include <wx/splitter.h>
 #include <list>
 
+
 class wxNotebook;
 class wxPanel;
 class wxSizer;
@@ -135,14 +137,14 @@ private:
        wxButton* _earlier;
        wxButton* _later;
        wxButton* _timeline;
-       VideoPanel* _video_panel;
-       AudioPanel* _audio_panel;
+       VideoPanel* _video_panel = nullptr;
+       AudioPanel* _audio_panel = nullptr;
        TextPanel* _text_panel[static_cast<int>(TextType::COUNT)];
        TimingPanel* _timing_panel;
        ContentMenu* _menu;
-       TimelineDialog* _timeline_dialog;
+       TimelineDialog* _timeline_dialog = nullptr;
        wxNotebook* _parent;
-       wxWindow* _last_selected_tab;
+       wxWindow* _last_selected_tab = nullptr;
 
        std::shared_ptr<Film> _film;
        std::weak_ptr<FilmViewer> _film_viewer;