From 1a9f9c30e355ff8c3085d7514984df02942a6336 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 15 Dec 2023 01:04:26 +0100 Subject: Rename TimelineVideoContentView -> ContentTimelineVideoView. --- src/wx/content_menu.cc | 6 ++-- src/wx/content_timeline.cc | 6 ++-- src/wx/content_timeline_video_view.cc | 63 +++++++++++++++++++++++++++++++++++ src/wx/content_timeline_video_view.h | 37 ++++++++++++++++++++ src/wx/timeline_video_content_view.cc | 63 ----------------------------------- src/wx/timeline_video_content_view.h | 37 -------------------- src/wx/wscript | 2 +- 7 files changed, 107 insertions(+), 107 deletions(-) create mode 100644 src/wx/content_timeline_video_view.cc create mode 100644 src/wx/content_timeline_video_view.h delete mode 100644 src/wx/timeline_video_content_view.cc delete mode 100644 src/wx/timeline_video_content_view.h diff --git a/src/wx/content_menu.cc b/src/wx/content_menu.cc index 9f89835ff..9c50d56da 100644 --- a/src/wx/content_menu.cc +++ b/src/wx/content_menu.cc @@ -24,12 +24,12 @@ #include "content_menu.h" #include "content_properties_dialog.h" #include "content_timeline_audio_view.h" +#include "content_timeline_video_view.h" #include "dir_dialog.h" #include "file_dialog.h" #include "film_viewer.h" #include "id.h" #include "repeat_dialog.h" -#include "timeline_video_content_view.h" #include "wx_util.h" #include "lib/audio_content.h" #include "lib/config.h" @@ -314,11 +314,11 @@ ContentMenu::remove () continue; } - shared_ptr video; + shared_ptr video; shared_ptr audio; for (auto j: _views) { - auto v = dynamic_pointer_cast(j); + auto v = dynamic_pointer_cast(j); auto a = dynamic_pointer_cast(j); if (v && v->content() == fc) { video = v; diff --git a/src/wx/content_timeline.cc b/src/wx/content_timeline.cc index 3efb15d3f..5e104f3b7 100644 --- a/src/wx/content_timeline.cc +++ b/src/wx/content_timeline.cc @@ -24,11 +24,11 @@ #include "film_viewer.h" #include "content_timeline_atmos_view.h" #include "content_timeline_audio_view.h" +#include "content_timeline_video_view.h" #include "timeline_labels_view.h" #include "timeline_reels_view.h" #include "timeline_text_content_view.h" #include "timeline_time_axis_view.h" -#include "timeline_video_content_view.h" #include "wx_util.h" #include "lib/atmos_mxf_content.h" #include "lib/audio_content.h" @@ -303,7 +303,7 @@ ContentTimeline::recreate_views() for (auto i: film->content ()) { if (i->video) { - _views.push_back (make_shared(*this, i)); + _views.push_back(make_shared(*this, i)); } if (i->audio && !i->audio->mapping().mapped_output_channels().empty ()) { @@ -450,7 +450,7 @@ ContentTimeline::assign_tracks() } } - int const video_tracks = place (film, _views, _tracks); + int const video_tracks = place(film, _views, _tracks); int const text_tracks = place (film, _views, _tracks); /* Atmos */ diff --git a/src/wx/content_timeline_video_view.cc b/src/wx/content_timeline_video_view.cc new file mode 100644 index 000000000..63b26a570 --- /dev/null +++ b/src/wx/content_timeline_video_view.cc @@ -0,0 +1,63 @@ +/* + Copyright (C) 2013-2019 Carl Hetherington + + This file is part of DCP-o-matic. + + DCP-o-matic is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + DCP-o-matic is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with DCP-o-matic. If not, see . + +*/ + + +#include "lib/image_content.h" +#include "lib/video_content.h" +#include "content_timeline_video_view.h" + + +using std::dynamic_pointer_cast; +using std::shared_ptr; + + +ContentTimelineVideoView::ContentTimelineVideoView(ContentTimeline& tl, shared_ptr c) + : TimelineContentView (tl, c) +{ + +} + +wxColour +ContentTimelineVideoView::background_colour() const +{ + if (!active()) { + return wxColour (210, 210, 210, 128); + } + + return wxColour (242, 92, 120, 255); +} + +wxColour +ContentTimelineVideoView::foreground_colour() const +{ + if (!active()) { + return wxColour (180, 180, 180, 128); + } + + return wxColour (0, 0, 0, 255); +} + +bool +ContentTimelineVideoView::active() const +{ + auto c = _content.lock(); + DCPOMATIC_ASSERT (c); + return c->video && c->video->use(); +} diff --git a/src/wx/content_timeline_video_view.h b/src/wx/content_timeline_video_view.h new file mode 100644 index 000000000..940a1a305 --- /dev/null +++ b/src/wx/content_timeline_video_view.h @@ -0,0 +1,37 @@ +/* + Copyright (C) 2013-2015 Carl Hetherington + + This file is part of DCP-o-matic. + + DCP-o-matic is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + DCP-o-matic is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with DCP-o-matic. If not, see . + +*/ + + +#include "timeline_content_view.h" + + +/** @class ContentTimelineVideoView + * @brief Content timeline view for VideoContent. + */ +class ContentTimelineVideoView : public TimelineContentView +{ +public: + ContentTimelineVideoView(ContentTimeline& tl, std::shared_ptr c); + +private: + bool active () const override; + wxColour background_colour () const override; + wxColour foreground_colour () const override; +}; diff --git a/src/wx/timeline_video_content_view.cc b/src/wx/timeline_video_content_view.cc deleted file mode 100644 index d72b1e149..000000000 --- a/src/wx/timeline_video_content_view.cc +++ /dev/null @@ -1,63 +0,0 @@ -/* - Copyright (C) 2013-2019 Carl Hetherington - - This file is part of DCP-o-matic. - - DCP-o-matic is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - DCP-o-matic is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with DCP-o-matic. If not, see . - -*/ - - -#include "lib/image_content.h" -#include "lib/video_content.h" -#include "timeline_video_content_view.h" - - -using std::dynamic_pointer_cast; -using std::shared_ptr; - - -TimelineVideoContentView::TimelineVideoContentView(ContentTimeline& tl, shared_ptr c) - : TimelineContentView (tl, c) -{ - -} - -wxColour -TimelineVideoContentView::background_colour () const -{ - if (!active()) { - return wxColour (210, 210, 210, 128); - } - - return wxColour (242, 92, 120, 255); -} - -wxColour -TimelineVideoContentView::foreground_colour () const -{ - if (!active()) { - return wxColour (180, 180, 180, 128); - } - - return wxColour (0, 0, 0, 255); -} - -bool -TimelineVideoContentView::active () const -{ - shared_ptr c = _content.lock (); - DCPOMATIC_ASSERT (c); - return c->video && c->video->use(); -} diff --git a/src/wx/timeline_video_content_view.h b/src/wx/timeline_video_content_view.h deleted file mode 100644 index 507f3caed..000000000 --- a/src/wx/timeline_video_content_view.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - Copyright (C) 2013-2015 Carl Hetherington - - This file is part of DCP-o-matic. - - DCP-o-matic is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - DCP-o-matic is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with DCP-o-matic. If not, see . - -*/ - - -#include "timeline_content_view.h" - - -/** @class TimelineVideoContentView - * @brief Timeline view for VideoContent. - */ -class TimelineVideoContentView : public TimelineContentView -{ -public: - TimelineVideoContentView(ContentTimeline& tl, std::shared_ptr c); - -private: - bool active () const override; - wxColour background_colour () const override; - wxColour foreground_colour () const override; -}; diff --git a/src/wx/wscript b/src/wx/wscript index c2bcd72c5..a3e3c06ed 100644 --- a/src/wx/wscript +++ b/src/wx/wscript @@ -52,6 +52,7 @@ sources = """ content_timeline_atmos_view.cc content_timeline_audio_view.cc content_timeline_dialog.cc + content_timeline_video_view.cc content_timeline_view.cc content_version_dialog.cc content_view.cc @@ -171,7 +172,6 @@ sources = """ timeline_text_content_view.cc timeline_reels_view.cc timeline_time_axis_view.cc - timeline_video_content_view.cc timing_panel.cc try_unmount_dialog.cc update_dialog.cc -- cgit v1.2.3