From 53d472f6e4531586fb91e649c386fdfaecb6ecaf Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 11 Dec 2022 00:11:51 +0100 Subject: Extract named_channel.h --- src/lib/audio_content.h | 5 +++-- src/lib/audio_processor.h | 2 +- src/lib/film.h | 1 + src/lib/named_channel.cc | 30 +++++++++++++++++++++++++++++ src/lib/named_channel.h | 46 +++++++++++++++++++++++++++++++++++++++++++++ src/lib/types.cc | 6 ------ src/lib/types.h | 15 --------------- src/lib/wscript | 1 + src/wx/audio_mapping_view.h | 1 + 9 files changed, 83 insertions(+), 24 deletions(-) create mode 100644 src/lib/named_channel.cc create mode 100644 src/lib/named_channel.h diff --git a/src/lib/audio_content.h b/src/lib/audio_content.h index bd5a25b98..18f826ee6 100644 --- a/src/lib/audio_content.h +++ b/src/lib/audio_content.h @@ -28,9 +28,10 @@ #define DCPOMATIC_AUDIO_CONTENT_H -#include "content_part.h" -#include "audio_stream.h" #include "audio_mapping.h" +#include "audio_stream.h" +#include "content_part.h" +#include "named_channel.h" /** @class AudioContentProperty diff --git a/src/lib/audio_processor.h b/src/lib/audio_processor.h index e24506acd..4cfda1def 100644 --- a/src/lib/audio_processor.h +++ b/src/lib/audio_processor.h @@ -28,7 +28,7 @@ #define DCPOMATIC_AUDIO_PROCESSOR_H -#include "types.h" +#include "named_channel.h" #include #include #include diff --git a/src/lib/film.h b/src/lib/film.h index 55412c2e8..f3e05f083 100644 --- a/src/lib/film.h +++ b/src/lib/film.h @@ -33,6 +33,7 @@ #include "dcp_text_track.h" #include "dcpomatic_time.h" #include "frame_rate_change.h" +#include "named_channel.h" #include "resolution.h" #include "signaller.h" #include "transcode_job.h" diff --git a/src/lib/named_channel.cc b/src/lib/named_channel.cc new file mode 100644 index 000000000..f352b2120 --- /dev/null +++ b/src/lib/named_channel.cc @@ -0,0 +1,30 @@ +/* + Copyright (C) 2013-2021 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 "named_channel.h" + + +bool operator== (NamedChannel const& a, NamedChannel const& b) +{ + return a.name == b.name && a.index == b.index; +} + + diff --git a/src/lib/named_channel.h b/src/lib/named_channel.h new file mode 100644 index 000000000..f6a3fcf8c --- /dev/null +++ b/src/lib/named_channel.h @@ -0,0 +1,46 @@ +/* + Copyright (C) 2013-2021 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 . + +*/ + + +#ifndef DCPOMATIC_NAMED_CHANNEL_H +#define DCPOMATIC_NAMED_CHANNEL_H + + +#include + + +class NamedChannel +{ +public: + NamedChannel (std::string name_, int index_) + : name(name_) + , index(index_) + {} + + std::string name; + int index; +}; + + +bool operator== (NamedChannel const& a, NamedChannel const& b); + + +#endif + diff --git a/src/lib/types.cc b/src/lib/types.cc index d9108a942..69d27a1ce 100644 --- a/src/lib/types.cc +++ b/src/lib/types.cc @@ -167,12 +167,6 @@ CPLSummary::CPLSummary (boost::filesystem::path p) } -bool operator== (NamedChannel const& a, NamedChannel const& b) -{ - return a.name == b.name && a.index == b.index; -} - - string video_range_to_string (VideoRange r) { diff --git a/src/lib/types.h b/src/lib/types.h index ad9158c8c..9bf4c80b1 100644 --- a/src/lib/types.h +++ b/src/lib/types.h @@ -199,19 +199,4 @@ enum class EmailProtocol { }; -class NamedChannel -{ -public: - NamedChannel (std::string name_, int index_) - : name(name_) - , index(index_) - {} - - std::string name; - int index; -}; - - -bool operator== (NamedChannel const& a, NamedChannel const& b); - #endif diff --git a/src/lib/wscript b/src/lib/wscript index 447c0f478..f3e16fad8 100644 --- a/src/lib/wscript +++ b/src/lib/wscript @@ -146,6 +146,7 @@ sources = """ maths_util.cc memory_util.cc mid_side_decoder.cc + named_channel.cc overlaps.cc pixel_quanta.cc player.cc diff --git a/src/wx/audio_mapping_view.h b/src/wx/audio_mapping_view.h index 873fc5c93..3bdc8f1a9 100644 --- a/src/wx/audio_mapping_view.h +++ b/src/wx/audio_mapping_view.h @@ -25,6 +25,7 @@ #include "lib/audio_mapping.h" +#include "lib/named_channel.h" #include "lib/types.h" #include LIBDCP_DISABLE_WARNINGS -- cgit v1.2.3