Rename TimelineAudioContentView -> ContentTimelineAudioView.
authorCarl Hetherington <cth@carlh.net>
Thu, 14 Dec 2023 23:40:41 +0000 (00:40 +0100)
committerCarl Hetherington <cth@carlh.net>
Mon, 11 Mar 2024 23:43:51 +0000 (00:43 +0100)
src/wx/content_menu.cc
src/wx/content_timeline.cc
src/wx/content_timeline_audio_view.cc [new file with mode: 0644]
src/wx/content_timeline_audio_view.h [new file with mode: 0644]
src/wx/timeline_audio_content_view.cc [deleted file]
src/wx/timeline_audio_content_view.h [deleted file]
src/wx/wscript

index 4af5a71b708d66f118d336e1412445274883e4a2..9f89835ff5e7fd922ee60ef903dace21b53fb524 100644 (file)
 #include "content_advanced_dialog.h"
 #include "content_menu.h"
 #include "content_properties_dialog.h"
+#include "content_timeline_audio_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 "timeline_audio_content_view.h"
 #include "wx_util.h"
 #include "lib/audio_content.h"
 #include "lib/config.h"
@@ -315,11 +315,11 @@ ContentMenu::remove ()
                        }
 
                        shared_ptr<TimelineVideoContentView> video;
-                       shared_ptr<TimelineAudioContentView> audio;
+                       shared_ptr<ContentTimelineAudioView> audio;
 
                        for (auto j: _views) {
                                auto v = dynamic_pointer_cast<TimelineVideoContentView>(j);
-                               auto a = dynamic_pointer_cast<TimelineAudioContentView>(j);
+                               auto a = dynamic_pointer_cast<ContentTimelineAudioView>(j);
                                if (v && v->content() == fc) {
                                        video = v;
                                } else if (a && a->content() == fc) {
index 0f993108d1855cb8f6333792fa2718a2edcb2730..3efb15d3f7c4fe63916bb551a27108b7f94d78bf 100644 (file)
@@ -23,7 +23,7 @@
 #include "film_editor.h"
 #include "film_viewer.h"
 #include "content_timeline_atmos_view.h"
-#include "timeline_audio_content_view.h"
+#include "content_timeline_audio_view.h"
 #include "timeline_labels_view.h"
 #include "timeline_reels_view.h"
 #include "timeline_text_content_view.h"
@@ -307,7 +307,7 @@ ContentTimeline::recreate_views()
                }
 
                if (i->audio && !i->audio->mapping().mapped_output_channels().empty ()) {
-                       _views.push_back (make_shared<TimelineAudioContentView>(*this, i));
+                       _views.push_back(make_shared<ContentTimelineAudioView>(*this, i));
                }
 
                for (auto j: i->text) {
@@ -406,13 +406,13 @@ place(shared_ptr<const Film> film, ContentTimelineViewList& views, int& tracks)
 struct AudioMappingComparator {
        bool operator()(shared_ptr<ContentTimelineView> a, shared_ptr<ContentTimelineView> b) {
                int la = -1;
-               auto cva = dynamic_pointer_cast<TimelineAudioContentView>(a);
+               auto cva = dynamic_pointer_cast<ContentTimelineAudioView>(a);
                if (cva) {
                        auto oc = cva->content()->audio->mapping().mapped_output_channels();
                        la = *min_element(boost::begin(oc), boost::end(oc));
                }
                int lb = -1;
-               auto cvb = dynamic_pointer_cast<TimelineAudioContentView>(b);
+               auto cvb = dynamic_pointer_cast<ContentTimelineAudioView>(b);
                if (cvb) {
                        auto oc = cvb->content()->audio->mapping().mapped_output_channels();
                        lb = *min_element(boost::begin(oc), boost::end(oc));
@@ -474,7 +474,7 @@ ContentTimeline::assign_tracks()
 
        auto views = _views;
        sort(views.begin(), views.end(), AudioMappingComparator());
-       int const audio_tracks = place<TimelineAudioContentView> (film, views, _tracks);
+       int const audio_tracks = place<ContentTimelineAudioView>(film, views, _tracks);
 
        _labels_view->set_video_tracks (video_tracks);
        _labels_view->set_audio_tracks (audio_tracks);
diff --git a/src/wx/content_timeline_audio_view.cc b/src/wx/content_timeline_audio_view.cc
new file mode 100644 (file)
index 0000000..9604ee7
--- /dev/null
@@ -0,0 +1,85 @@
+/*
+    Copyright (C) 2013-2018 Carl Hetherington <cth@carlh.net>
+
+    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 <http://www.gnu.org/licenses/>.
+
+*/
+
+
+#include "content_timeline_audio_view.h"
+#include "wx_util.h"
+#include "lib/audio_content.h"
+#include "lib/util.h"
+
+
+using std::dynamic_pointer_cast;
+using std::list;
+using std::shared_ptr;
+
+
+/** @class ContentTimelineAudioView
+ *  @brief Content timeline view for AudioContent.
+ */
+
+
+ContentTimelineAudioView::ContentTimelineAudioView(ContentTimeline& tl, shared_ptr<Content> c)
+       : TimelineContentView (tl, c)
+{
+
+}
+
+wxColour
+ContentTimelineAudioView::background_colour () const
+{
+       return wxColour (149, 121, 232, 255);
+}
+
+wxColour
+ContentTimelineAudioView::foreground_colour () const
+{
+       return wxColour (0, 0, 0, 255);
+}
+
+wxString
+ContentTimelineAudioView::label () const
+{
+       wxString s = TimelineContentView::label ();
+       shared_ptr<AudioContent> ac = content()->audio;
+       DCPOMATIC_ASSERT (ac);
+
+       if (ac->gain() > 0.01) {
+               s += wxString::Format (" +%.1fdB", ac->gain());
+       } else if (ac->gain() < -0.01) {
+               s += wxString::Format (" %.1fdB", ac->gain());
+       }
+
+       if (ac->delay() > 0) {
+               s += wxString::Format (_(" delayed by %dms"), ac->delay());
+       } else if (ac->delay() < 0) {
+               s += wxString::Format (_(" advanced by %dms"), -ac->delay());
+       }
+
+       list<int> mapped = ac->mapping().mapped_output_channels();
+       if (!mapped.empty ()) {
+               s += wxString::FromUTF8(" → ");
+               for (auto i: mapped) {
+                       s += std_to_wx(short_audio_channel_name(i)) + ", ";
+               }
+               s = s.Left(s.Length() - 2);
+       }
+
+       return s;
+}
diff --git a/src/wx/content_timeline_audio_view.h b/src/wx/content_timeline_audio_view.h
new file mode 100644 (file)
index 0000000..719c253
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+    Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net>
+
+    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 <http://www.gnu.org/licenses/>.
+
+*/
+
+
+#include "timeline_content_view.h"
+
+
+/** @class ContentTimelineAudioView
+ *  @brief Content timeline view for AudioContent.
+ */
+class ContentTimelineAudioView : public TimelineContentView
+{
+public:
+       ContentTimelineAudioView(ContentTimeline& tl, std::shared_ptr<Content> c);
+
+private:
+       bool active () const override {
+               return true;
+       }
+       wxColour background_colour () const override;
+       wxColour foreground_colour () const override;
+       wxString label () const override;
+};
diff --git a/src/wx/timeline_audio_content_view.cc b/src/wx/timeline_audio_content_view.cc
deleted file mode 100644 (file)
index 2920bf4..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
-    Copyright (C) 2013-2018 Carl Hetherington <cth@carlh.net>
-
-    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 <http://www.gnu.org/licenses/>.
-
-*/
-
-
-#include "timeline_audio_content_view.h"
-#include "wx_util.h"
-#include "lib/audio_content.h"
-#include "lib/util.h"
-
-
-using std::dynamic_pointer_cast;
-using std::list;
-using std::shared_ptr;
-
-
-/** @class TimelineAudioContentView
- *  @brief Timeline view for AudioContent.
- */
-
-
-TimelineAudioContentView::TimelineAudioContentView(ContentTimeline& tl, shared_ptr<Content> c)
-       : TimelineContentView (tl, c)
-{
-
-}
-
-wxColour
-TimelineAudioContentView::background_colour () const
-{
-       return wxColour (149, 121, 232, 255);
-}
-
-wxColour
-TimelineAudioContentView::foreground_colour () const
-{
-       return wxColour (0, 0, 0, 255);
-}
-
-wxString
-TimelineAudioContentView::label () const
-{
-       wxString s = TimelineContentView::label ();
-       shared_ptr<AudioContent> ac = content()->audio;
-       DCPOMATIC_ASSERT (ac);
-
-       if (ac->gain() > 0.01) {
-               s += wxString::Format (" +%.1fdB", ac->gain());
-       } else if (ac->gain() < -0.01) {
-               s += wxString::Format (" %.1fdB", ac->gain());
-       }
-
-       if (ac->delay() > 0) {
-               s += wxString::Format (_(" delayed by %dms"), ac->delay());
-       } else if (ac->delay() < 0) {
-               s += wxString::Format (_(" advanced by %dms"), -ac->delay());
-       }
-
-       list<int> mapped = ac->mapping().mapped_output_channels();
-       if (!mapped.empty ()) {
-               s += wxString::FromUTF8(" → ");
-               for (auto i: mapped) {
-                       s += std_to_wx(short_audio_channel_name(i)) + ", ";
-               }
-               s = s.Left(s.Length() - 2);
-       }
-
-       return s;
-}
diff --git a/src/wx/timeline_audio_content_view.h b/src/wx/timeline_audio_content_view.h
deleted file mode 100644 (file)
index 29849ad..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
-    Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net>
-
-    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 <http://www.gnu.org/licenses/>.
-
-*/
-
-
-#include "timeline_content_view.h"
-
-
-/** @class TimelineAudioContentView
- *  @brief Timeline view for AudioContent.
- */
-class TimelineAudioContentView : public TimelineContentView
-{
-public:
-       TimelineAudioContentView(ContentTimeline& tl, std::shared_ptr<Content> c);
-
-private:
-       bool active () const override {
-               return true;
-       }
-       wxColour background_colour () const override;
-       wxColour foreground_colour () const override;
-       wxString label () const override;
-};
index f9573bd6d0d820c6e8eb5af0b9ef72f9a134f183..c2bcd72c5752609084867a84e0e9038e7df04b9d 100644 (file)
@@ -50,6 +50,7 @@ sources = """
           content_sub_panel.cc
           content_timeline.cc
           content_timeline_atmos_view.cc
+          content_timeline_audio_view.cc
           content_timeline_dialog.cc
           content_timeline_view.cc
           content_version_dialog.cc
@@ -166,7 +167,6 @@ sources = """
           timecode.cc
           timeline.cc
           timeline_content_view.cc
-          timeline_audio_content_view.cc
           timeline_labels_view.cc
           timeline_text_content_view.cc
           timeline_reels_view.cc