/*
- 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
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)
return sel;
}
+
ContentList
ContentPanel::selected_video ()
{
return vc;
}
+
ContentList
ContentPanel::selected_audio ()
{
return ac;
}
+
ContentList
ContentPanel::selected_text ()
{
return sc;
}
+
FFmpegContentList
ContentPanel::selected_ffmpeg ()
{
return sc;
}
+
void
ContentPanel::film_changed (Film::Property p)
{
}
}
+
void
ContentPanel::item_deselected ()
{
signal_manager->when_idle (boost::bind (&ContentPanel::item_deselected_idle, this));
}
+
void
ContentPanel::item_deselected_idle ()
{
}
}
+
void
ContentPanel::item_selected ()
{
check_selection ();
}
+
void
ContentPanel::check_selection ()
{
SelectionChanged ();
}
+
void
ContentPanel::add_file_clicked ()
{
d->Destroy ();
}
+
void
ContentPanel::add_folder_clicked ()
{
}
}
+
void
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)
return false;
}
+
void
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 ()
_timing_panel->Enable (_generally_sensitive);
}
+
void
ContentPanel::set_film (shared_ptr<Film> film)
{
setup_sensitivity ();
}
+
void
ContentPanel::set_general_sensitivity (bool s)
{
setup_sensitivity ();
}
+
void
ContentPanel::earlier_clicked ()
{
}
}
+
void
ContentPanel::later_clicked ()
{
}
}
+
void
ContentPanel::set_selection (weak_ptr<Content> wc)
{
}
}
+
void
ContentPanel::set_selection (ContentList cl)
{
}
}
+
void
ContentPanel::setup ()
{
setup_sensitivity ();
}
+
void
ContentPanel::files_dropped (wxDropFilesEvent& event)
{
add_files (path_list);
}
+
void
ContentPanel::add_files (list<boost::filesystem::path> paths)
{
}
}
+
list<ContentSubPanel*>
ContentPanel::panels () const
{
/*
- 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;
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;