From 50931fab031d9dcdba131cb07ddd13e3528ab697 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 15 Dec 2023 01:32:41 +0100 Subject: Rename TimelineTextContentView -> ContentTimelineTextView. --- src/wx/content_timeline.cc | 6 ++-- src/wx/content_timeline_text_view.cc | 61 ++++++++++++++++++++++++++++++++++++ src/wx/content_timeline_text_view.h | 42 +++++++++++++++++++++++++ src/wx/timeline_text_content_view.cc | 61 ------------------------------------ src/wx/timeline_text_content_view.h | 42 ------------------------- src/wx/wscript | 2 +- 6 files changed, 107 insertions(+), 107 deletions(-) create mode 100644 src/wx/content_timeline_text_view.cc create mode 100644 src/wx/content_timeline_text_view.h delete mode 100644 src/wx/timeline_text_content_view.cc delete mode 100644 src/wx/timeline_text_content_view.h (limited to 'src') diff --git a/src/wx/content_timeline.cc b/src/wx/content_timeline.cc index 5e104f3b7..7257f3587 100644 --- a/src/wx/content_timeline.cc +++ b/src/wx/content_timeline.cc @@ -24,10 +24,10 @@ #include "film_viewer.h" #include "content_timeline_atmos_view.h" #include "content_timeline_audio_view.h" +#include "content_timeline_text_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 "wx_util.h" #include "lib/atmos_mxf_content.h" @@ -311,7 +311,7 @@ ContentTimeline::recreate_views() } for (auto j: i->text) { - _views.push_back (make_shared(*this, i, j)); + _views.push_back(make_shared(*this, i, j)); } if (i->atmos) { @@ -451,7 +451,7 @@ ContentTimeline::assign_tracks() } int const video_tracks = place(film, _views, _tracks); - int const text_tracks = place (film, _views, _tracks); + int const text_tracks = place(film, _views, _tracks); /* Atmos */ diff --git a/src/wx/content_timeline_text_view.cc b/src/wx/content_timeline_text_view.cc new file mode 100644 index 000000000..3b7eeebce --- /dev/null +++ b/src/wx/content_timeline_text_view.cc @@ -0,0 +1,61 @@ +/* + Copyright (C) 2013-2018 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 "content_timeline_text_view.h" +#include "lib/text_content.h" +#include "lib/content.h" + + +using std::shared_ptr; + + +ContentTimelineTextView::ContentTimelineTextView(ContentTimeline& tl, shared_ptr c, shared_ptr caption) + : TimelineContentView (tl, c) + , _caption (caption) +{ + +} + +wxColour +ContentTimelineTextView::background_colour() const +{ + if (!active ()) { + return wxColour (210, 210, 210, 128); + } + + return wxColour (163, 255, 154, 255); +} + +wxColour +ContentTimelineTextView::foreground_colour() const +{ + if (!active ()) { + return wxColour (180, 180, 180, 128); + } + + return wxColour (0, 0, 0, 255); +} + +bool +ContentTimelineTextView::active() const +{ + return _caption->use(); +} diff --git a/src/wx/content_timeline_text_view.h b/src/wx/content_timeline_text_view.h new file mode 100644 index 000000000..8d37ad489 --- /dev/null +++ b/src/wx/content_timeline_text_view.h @@ -0,0 +1,42 @@ +/* + Copyright (C) 2013-2016 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 TextContent; + + +/** @class ContentTimelineTextView + * @brief Content timeline view for TextContent. + */ +class ContentTimelineTextView : public TimelineContentView +{ +public: + ContentTimelineTextView(ContentTimeline& tl, std::shared_ptr, std::shared_ptr); + +private: + bool active () const override; + wxColour background_colour () const override; + wxColour foreground_colour () const override; + + std::shared_ptr _caption; +}; diff --git a/src/wx/timeline_text_content_view.cc b/src/wx/timeline_text_content_view.cc deleted file mode 100644 index bc099d4d6..000000000 --- a/src/wx/timeline_text_content_view.cc +++ /dev/null @@ -1,61 +0,0 @@ -/* - Copyright (C) 2013-2018 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_text_content_view.h" -#include "lib/text_content.h" -#include "lib/content.h" - - -using std::shared_ptr; - - -TimelineTextContentView::TimelineTextContentView(ContentTimeline& tl, shared_ptr c, shared_ptr caption) - : TimelineContentView (tl, c) - , _caption (caption) -{ - -} - -wxColour -TimelineTextContentView::background_colour () const -{ - if (!active ()) { - return wxColour (210, 210, 210, 128); - } - - return wxColour (163, 255, 154, 255); -} - -wxColour -TimelineTextContentView::foreground_colour () const -{ - if (!active ()) { - return wxColour (180, 180, 180, 128); - } - - return wxColour (0, 0, 0, 255); -} - -bool -TimelineTextContentView::active () const -{ - return _caption->use(); -} diff --git a/src/wx/timeline_text_content_view.h b/src/wx/timeline_text_content_view.h deleted file mode 100644 index c33c2662e..000000000 --- a/src/wx/timeline_text_content_view.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - Copyright (C) 2013-2016 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 TextContent; - - -/** @class TimelineTextContentView - * @brief Timeline view for TextContent. - */ -class TimelineTextContentView : public TimelineContentView -{ -public: - TimelineTextContentView(ContentTimeline& tl, std::shared_ptr, std::shared_ptr); - -private: - bool active () const override; - wxColour background_colour () const override; - wxColour foreground_colour () const override; - - std::shared_ptr _caption; -}; diff --git a/src/wx/wscript b/src/wx/wscript index a3e3c06ed..c644af96c 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_text_view.cc content_timeline_video_view.cc content_timeline_view.cc content_version_dialog.cc @@ -169,7 +170,6 @@ sources = """ timeline.cc timeline_content_view.cc timeline_labels_view.cc - timeline_text_content_view.cc timeline_reels_view.cc timeline_time_axis_view.cc timing_panel.cc -- cgit v1.2.3