From dbd26fada835a44d7547007fc44273b2119f3e35 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 13 Jul 2014 21:56:17 +0100 Subject: [PATCH] Rename SoundProcessor -> CinemaSoundProcessor. --- ...processor.cc => cinema_sound_processor.cc} | 46 +++++++++---------- ...d_processor.h => cinema_sound_processor.h} | 35 +++++++------- src/lib/config.cc | 16 ++++--- src/lib/config.h | 12 ++--- src/lib/dolby_cp750.cc | 2 +- src/lib/dolby_cp750.h | 4 +- src/lib/util.cc | 4 +- src/lib/wscript | 3 +- src/wx/audio_panel.cc | 4 +- src/wx/film_editor.cc | 1 - 10 files changed, 67 insertions(+), 60 deletions(-) rename src/lib/{sound_processor.cc => cinema_sound_processor.cc} (55%) rename src/lib/{sound_processor.h => cinema_sound_processor.h} (56%) diff --git a/src/lib/sound_processor.cc b/src/lib/cinema_sound_processor.cc similarity index 55% rename from src/lib/sound_processor.cc rename to src/lib/cinema_sound_processor.cc index 9be6621cc..6a7905114 100644 --- a/src/lib/sound_processor.cc +++ b/src/lib/cinema_sound_processor.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012 Carl Hetherington + Copyright (C) 2012-2014 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -18,22 +18,22 @@ */ /** @file src/sound_processor.cc - * @brief A class to describe a sound processor. + * @brief CinemaSoundProcessor class. */ #include #include -#include "sound_processor.h" +#include "cinema_sound_processor.h" #include "dolby_cp750.h" using namespace std; -vector SoundProcessor::_sound_processors; +vector CinemaSoundProcessor::_cinema_sound_processors; /** @param i Our id. * @param n User-visible name. */ -SoundProcessor::SoundProcessor (string i, string n) +CinemaSoundProcessor::CinemaSoundProcessor (string i, string n) : _id (i) , _name (n) { @@ -41,33 +41,33 @@ SoundProcessor::SoundProcessor (string i, string n) } /** @return All available sound processors */ -vector -SoundProcessor::all () +vector +CinemaSoundProcessor::all () { - return _sound_processors; + return _cinema_sound_processors; } /** Set up the static _sound_processors vector; must be called before from_* * methods are used. */ void -SoundProcessor::setup_sound_processors () +CinemaSoundProcessor::setup_cinema_sound_processors () { - _sound_processors.push_back (new DolbyCP750); + _cinema_sound_processors.push_back (new DolbyCP750); } /** @param id One of our ids. * @return Corresponding sound processor, or 0. */ -SoundProcessor const * -SoundProcessor::from_id (string id) +CinemaSoundProcessor const * +CinemaSoundProcessor::from_id (string id) { - vector::iterator i = _sound_processors.begin (); - while (i != _sound_processors.end() && (*i)->id() != id) { + vector::iterator i = _cinema_sound_processors.begin (); + while (i != _cinema_sound_processors.end() && (*i)->id() != id) { ++i; } - if (i == _sound_processors.end ()) { + if (i == _cinema_sound_processors.end ()) { return 0; } @@ -78,14 +78,14 @@ SoundProcessor::from_id (string id) * @return Index of the sound processor with the list, or -1. */ int -SoundProcessor::as_index (SoundProcessor const * s) +CinemaSoundProcessor::as_index (CinemaSoundProcessor const * s) { - vector::size_type i = 0; - while (i < _sound_processors.size() && _sound_processors[i] != s) { + vector::size_type i = 0; + while (i < _cinema_sound_processors.size() && _cinema_sound_processors[i] != s) { ++i; } - if (i == _sound_processors.size ()) { + if (i == _cinema_sound_processors.size ()) { return -1; } @@ -95,9 +95,9 @@ SoundProcessor::as_index (SoundProcessor const * s) /** @param i An index returned from as_index(). * @return Corresponding sound processor. */ -SoundProcessor const * -SoundProcessor::from_index (int i) +CinemaSoundProcessor const * +CinemaSoundProcessor::from_index (int i) { - assert (i <= int(_sound_processors.size ())); - return _sound_processors[i]; + assert (i <= int(_cinema_sound_processors.size ())); + return _cinema_sound_processors[i]; } diff --git a/src/lib/sound_processor.h b/src/lib/cinema_sound_processor.h similarity index 56% rename from src/lib/sound_processor.h rename to src/lib/cinema_sound_processor.h index 8f2652243..f735b1227 100644 --- a/src/lib/sound_processor.h +++ b/src/lib/cinema_sound_processor.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2012 Carl Hetherington + Copyright (C) 2012-2014 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,24 +17,27 @@ */ -/** @file src/sound_processor.h - * @brief A class to describe a sound processor. +/** @file src/cinema_sound_processor.h + * @brief CinemaSoundProcessor class */ -#ifndef DCPOMATIC_SOUND_PROCESSOR_H -#define DCPOMATIC_SOUND_PROCESSOR_H +#ifndef DCPOMATIC_CINEMA_SOUND_PROCESSOR_H +#define DCPOMATIC_CINEMA_SOUND_PROCESSOR_H #include #include #include -/** @class SoundProcessor - * @brief Class to describe a sound processor. +/** @class CinemaSoundProcessor + * @brief Class to describe a cimema's sound processor. + * + * In other words, the box in the rack that handles sound decoding and processing + * in a cinema. */ -class SoundProcessor : public boost::noncopyable +class CinemaSoundProcessor : public boost::noncopyable { public: - SoundProcessor (std::string i, std::string n); + CinemaSoundProcessor (std::string i, std::string n); virtual float db_for_fader_change (float from, float to) const = 0; @@ -48,11 +51,11 @@ public: return _name; } - static std::vector all (); - static void setup_sound_processors (); - static SoundProcessor const * from_id (std::string id); - static SoundProcessor const * from_index (int); - static int as_index (SoundProcessor const *); + static std::vector all (); + static void setup_cinema_sound_processors (); + static CinemaSoundProcessor const * from_id (std::string id); + static CinemaSoundProcessor const * from_index (int); + static int as_index (CinemaSoundProcessor const *); private: /** id for our use */ @@ -60,8 +63,8 @@ private: /** user-visible name for this sound processor */ std::string _name; - /** sll available sound processors */ - static std::vector _sound_processors; + /** sll available cinema sound processors */ + static std::vector _cinema_sound_processors; }; #endif diff --git a/src/lib/config.cc b/src/lib/config.cc index bb1fcd211..209b924fa 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -32,7 +32,7 @@ #include "filter.h" #include "ratio.h" #include "dcp_content_type.h" -#include "sound_processor.h" +#include "cinema_sound_processor.h" #include "colour_conversion.h" #include "cinema.h" #include "util.h" @@ -60,7 +60,7 @@ Config::Config () , _server_port_base (6192) , _use_any_servers (true) , _tms_path (".") - , _sound_processor (SoundProcessor::from_id (N_("dolby_cp750"))) + , _cinema_sound_processor (CinemaSoundProcessor::from_id (N_("dolby_cp750"))) , _allow_any_dcp_frame_rate (false) , _default_still_length (10) , _default_container (Ratio::from_id ("185")) @@ -128,7 +128,11 @@ Config::read () c = f.optional_string_child ("SoundProcessor"); if (c) { - _sound_processor = SoundProcessor::from_id (c.get ()); + _cinema_sound_processor = CinemaSoundProcessor::from_id (c.get ()); + } + c = f.optional_string_child ("CinemaSoundProcessor"); + if (c) { + _cinema_sound_processor = CinemaSoundProcessor::from_id (c.get ()); } _language = f.optional_string_child ("Language"); @@ -244,7 +248,7 @@ Config::read_old_metadata () } else if (k == N_("tms_password")) { _tms_password = v; } else if (k == N_("sound_processor")) { - _sound_processor = SoundProcessor::from_id (v); + _cinema_sound_processor = CinemaSoundProcessor::from_id (v); } else if (k == "language") { _language = v; } else if (k == "default_container") { @@ -334,8 +338,8 @@ Config::write () const root->add_child("TMSPath")->add_child_text (_tms_path); root->add_child("TMSUser")->add_child_text (_tms_user); root->add_child("TMSPassword")->add_child_text (_tms_password); - if (_sound_processor) { - root->add_child("SoundProcessor")->add_child_text (_sound_processor->id ()); + if (_cinema_sound_processor) { + root->add_child("CinemaSoundProcessor")->add_child_text (_cinema_sound_processor->id ()); } if (_language) { root->add_child("Language")->add_child_text (_language.get()); diff --git a/src/lib/config.h b/src/lib/config.h index d9f104c7d..2bc07b683 100644 --- a/src/lib/config.h +++ b/src/lib/config.h @@ -35,7 +35,7 @@ class ServerDescription; class Scaler; class Filter; -class SoundProcessor; +class CinemaSoundProcessor; class DCPContentType; class Ratio; class Cinema; @@ -103,9 +103,9 @@ public: return _tms_password; } - /** @return The sound processor that we are using */ - SoundProcessor const * sound_processor () const { - return _sound_processor; + /** @return The cinema sound processor that we are using */ + CinemaSoundProcessor const * cinema_sound_processor () const { + return _cinema_sound_processor; } std::list > cinemas () const { @@ -394,8 +394,8 @@ private: std::string _tms_user; /** Password to log into the TMS with */ std::string _tms_password; - /** Our sound processor */ - SoundProcessor const * _sound_processor; + /** Our cinema sound processor */ + CinemaSoundProcessor const * _cinema_sound_processor; std::list _allowed_dcp_frame_rates; /** Allow any video frame rate for the DCP; if true, overrides _allowed_dcp_frame_rates */ bool _allow_any_dcp_frame_rate; diff --git a/src/lib/dolby_cp750.cc b/src/lib/dolby_cp750.cc index aeb469d29..317d129d9 100644 --- a/src/lib/dolby_cp750.cc +++ b/src/lib/dolby_cp750.cc @@ -24,7 +24,7 @@ using namespace std; DolbyCP750::DolbyCP750 () - : SoundProcessor ("dolby_cp750", _("Dolby CP650 and CP750")) + : CinemaSoundProcessor ("dolby_cp750", _("Dolby CP650 and CP750")) { } diff --git a/src/lib/dolby_cp750.h b/src/lib/dolby_cp750.h index b6c0e7df2..c545844fe 100644 --- a/src/lib/dolby_cp750.h +++ b/src/lib/dolby_cp750.h @@ -17,9 +17,9 @@ */ -#include "sound_processor.h" +#include "cinema_sound_processor.h" -class DolbyCP750 : public SoundProcessor +class DolbyCP750 : public CinemaSoundProcessor { public: DolbyCP750 (); diff --git a/src/lib/util.cc b/src/lib/util.cc index dd39e286e..d04f195af 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -64,7 +64,7 @@ extern "C" { #include "scaler.h" #include "dcp_content_type.h" #include "filter.h" -#include "sound_processor.h" +#include "cinema_sound_processor.h" #include "config.h" #include "ratio.h" #include "job.h" @@ -336,7 +336,7 @@ dcpomatic_setup () DCPContentType::setup_dcp_content_types (); Scaler::setup_scalers (); Filter::setup_filters (); - SoundProcessor::setup_sound_processors (); + CinemaSoundProcessor::setup_cinema_sound_processors (); AudioProcessor::setup_audio_processors (); ui_thread = boost::this_thread::get_id (); diff --git a/src/lib/wscript b/src/lib/wscript index 60150f4da..9c929a671 100644 --- a/src/lib/wscript +++ b/src/lib/wscript @@ -10,6 +10,7 @@ sources = """ audio_mapping.cc audio_processor.cc cinema.cc + cinema_sound_processor.cc colour_conversion.cc config.cc content.cc @@ -72,7 +73,7 @@ sources = """ single_stream_audio_content.cc sndfile_content.cc sndfile_decoder.cc - sound_processor.cc + sox_audio_processor.cc subrip.cc subrip_content.cc subrip_decoder.cc diff --git a/src/wx/audio_panel.cc b/src/wx/audio_panel.cc index 651ea93e1..b19142ec5 100644 --- a/src/wx/audio_panel.cc +++ b/src/wx/audio_panel.cc @@ -20,10 +20,10 @@ #include #include #include "lib/config.h" -#include "lib/sound_processor.h" #include "lib/ffmpeg_content.h" #include "lib/ffmpeg_audio_stream.h" #include "lib/audio_processor.h" +#include "lib/cinema_sound_processor.h" #include "audio_dialog.h" #include "audio_panel.h" #include "audio_mapping_view.h" @@ -175,7 +175,7 @@ AudioPanel::gain_calculate_button_clicked () } _gain->wrapped()->SetValue ( - Config::instance()->sound_processor()->db_for_fader_change ( + Config::instance()->cinema_sound_processor()->db_for_fader_change ( d->wanted_fader (), d->actual_fader () ) diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc index 151130f27..c80a2a16c 100644 --- a/src/wx/film_editor.cc +++ b/src/wx/film_editor.cc @@ -40,7 +40,6 @@ #include "lib/ffmpeg_content.h" #include "lib/sndfile_content.h" #include "lib/dcp_content_type.h" -#include "lib/sound_processor.h" #include "lib/scaler.h" #include "lib/playlist.h" #include "lib/content.h" -- 2.30.2