Rename SoundProcessor -> CinemaSoundProcessor.
authorCarl Hetherington <cth@carlh.net>
Sun, 13 Jul 2014 20:56:17 +0000 (21:56 +0100)
committerCarl Hetherington <cth@carlh.net>
Sun, 13 Jul 2014 20:56:17 +0000 (21:56 +0100)
12 files changed:
src/lib/cinema_sound_processor.cc [new file with mode: 0644]
src/lib/cinema_sound_processor.h [new file with mode: 0644]
src/lib/config.cc
src/lib/config.h
src/lib/dolby_cp750.cc
src/lib/dolby_cp750.h
src/lib/sound_processor.cc [deleted file]
src/lib/sound_processor.h [deleted file]
src/lib/util.cc
src/lib/wscript
src/wx/audio_panel.cc
src/wx/film_editor.cc

diff --git a/src/lib/cinema_sound_processor.cc b/src/lib/cinema_sound_processor.cc
new file mode 100644 (file)
index 0000000..6a79051
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+    Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
+
+    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
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program 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 this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+/** @file src/sound_processor.cc
+ *  @brief CinemaSoundProcessor class.
+ */
+
+#include <iostream>
+#include <cassert>
+#include "cinema_sound_processor.h"
+#include "dolby_cp750.h"
+
+using namespace std;
+
+vector<CinemaSoundProcessor const *> CinemaSoundProcessor::_cinema_sound_processors;
+
+/** @param i Our id.
+ *  @param n User-visible name.
+ */
+CinemaSoundProcessor::CinemaSoundProcessor (string i, string n)
+       : _id (i)
+       , _name (n)
+{
+
+}
+
+/** @return All available sound processors */
+vector<CinemaSoundProcessor const *>
+CinemaSoundProcessor::all ()
+{
+       return _cinema_sound_processors;
+}
+
+/** Set up the static _sound_processors vector; must be called before from_*
+ *  methods are used.
+ */
+void
+CinemaSoundProcessor::setup_cinema_sound_processors ()
+{
+       _cinema_sound_processors.push_back (new DolbyCP750);
+}
+
+/** @param id One of our ids.
+ *  @return Corresponding sound processor, or 0.
+ */
+CinemaSoundProcessor const *
+CinemaSoundProcessor::from_id (string id)
+{
+       vector<CinemaSoundProcessor const *>::iterator i = _cinema_sound_processors.begin ();
+       while (i != _cinema_sound_processors.end() && (*i)->id() != id) {
+               ++i;
+       }
+
+       if (i == _cinema_sound_processors.end ()) {
+               return 0;
+       }
+
+       return *i;
+}
+
+/** @param s A sound processor from our static list.
+ *  @return Index of the sound processor with the list, or -1.
+ */
+int
+CinemaSoundProcessor::as_index (CinemaSoundProcessor const * s)
+{
+       vector<CinemaSoundProcessor*>::size_type i = 0;
+       while (i < _cinema_sound_processors.size() && _cinema_sound_processors[i] != s) {
+               ++i;
+       }
+
+       if (i == _cinema_sound_processors.size ()) {
+               return -1;
+       }
+
+       return i;
+}
+
+/** @param i An index returned from as_index().
+ *  @return Corresponding sound processor.
+ */
+CinemaSoundProcessor const *
+CinemaSoundProcessor::from_index (int i)
+{
+       assert (i <= int(_cinema_sound_processors.size ()));
+       return _cinema_sound_processors[i];
+}
diff --git a/src/lib/cinema_sound_processor.h b/src/lib/cinema_sound_processor.h
new file mode 100644 (file)
index 0000000..f735b12
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+    Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
+
+    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
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program 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 this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+/** @file src/cinema_sound_processor.h
+ *  @brief CinemaSoundProcessor class
+ */
+
+#ifndef DCPOMATIC_CINEMA_SOUND_PROCESSOR_H
+#define DCPOMATIC_CINEMA_SOUND_PROCESSOR_H
+
+#include <string>
+#include <vector>
+#include <boost/utility.hpp>
+
+/** @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 CinemaSoundProcessor : public boost::noncopyable
+{
+public:
+       CinemaSoundProcessor (std::string i, std::string n);
+
+       virtual float db_for_fader_change (float from, float to) const = 0;
+
+       /** @return id for our use */
+       std::string id () const {
+               return _id;
+       }
+
+       /** @return user-visible name for this sound processor */
+       std::string name () const {
+               return _name;
+       }
+       
+       static std::vector<CinemaSoundProcessor const *> 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 */
+       std::string _id;
+       /** user-visible name for this sound processor */
+       std::string _name;
+
+       /** sll available cinema sound processors */
+       static std::vector<CinemaSoundProcessor const *> _cinema_sound_processors;
+};
+
+#endif
index bb1fcd21173655a276055bf0becdcc67527396b5..209b924fa494abe23d9201b033e2afca80c6a11e 100644 (file)
@@ -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());
index d9f104c7dec1a9c33cb29b0310ffc6c386367be4..2bc07b68389102deb7a933ea6ec441817f64c479 100644 (file)
@@ -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<boost::shared_ptr<Cinema> > 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<int> _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;
index aeb469d293a6e6385b82160e61596b35198b50a1..317d129d99f0abcba3af6c78d4bf904baf05010c 100644 (file)
@@ -24,7 +24,7 @@
 using namespace std;
 
 DolbyCP750::DolbyCP750 ()
-       : SoundProcessor ("dolby_cp750", _("Dolby CP650 and CP750"))
+       : CinemaSoundProcessor ("dolby_cp750", _("Dolby CP650 and CP750"))
 {
 
 }
index b6c0e7df29915bec52085167bda2aa5cbab3cc4c..c545844fe584bca13cc425bc26a48452c4438387 100644 (file)
@@ -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/sound_processor.cc b/src/lib/sound_processor.cc
deleted file mode 100644 (file)
index 9be6621..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
-    Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
-
-    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
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program 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 this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-/** @file src/sound_processor.cc
- *  @brief A class to describe a sound processor.
- */
-
-#include <iostream>
-#include <cassert>
-#include "sound_processor.h"
-#include "dolby_cp750.h"
-
-using namespace std;
-
-vector<SoundProcessor const *> SoundProcessor::_sound_processors;
-
-/** @param i Our id.
- *  @param n User-visible name.
- */
-SoundProcessor::SoundProcessor (string i, string n)
-       : _id (i)
-       , _name (n)
-{
-
-}
-
-/** @return All available sound processors */
-vector<SoundProcessor const *>
-SoundProcessor::all ()
-{
-       return _sound_processors;
-}
-
-/** Set up the static _sound_processors vector; must be called before from_*
- *  methods are used.
- */
-void
-SoundProcessor::setup_sound_processors ()
-{
-       _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)
-{
-       vector<SoundProcessor const *>::iterator i = _sound_processors.begin ();
-       while (i != _sound_processors.end() && (*i)->id() != id) {
-               ++i;
-       }
-
-       if (i == _sound_processors.end ()) {
-               return 0;
-       }
-
-       return *i;
-}
-
-/** @param s A sound processor from our static list.
- *  @return Index of the sound processor with the list, or -1.
- */
-int
-SoundProcessor::as_index (SoundProcessor const * s)
-{
-       vector<SoundProcessor*>::size_type i = 0;
-       while (i < _sound_processors.size() && _sound_processors[i] != s) {
-               ++i;
-       }
-
-       if (i == _sound_processors.size ()) {
-               return -1;
-       }
-
-       return i;
-}
-
-/** @param i An index returned from as_index().
- *  @return Corresponding sound processor.
- */
-SoundProcessor const *
-SoundProcessor::from_index (int i)
-{
-       assert (i <= int(_sound_processors.size ()));
-       return _sound_processors[i];
-}
diff --git a/src/lib/sound_processor.h b/src/lib/sound_processor.h
deleted file mode 100644 (file)
index 8f26522..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
-    Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
-
-    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
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program 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 this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-/** @file src/sound_processor.h
- *  @brief A class to describe a sound processor.
- */
-
-#ifndef DCPOMATIC_SOUND_PROCESSOR_H
-#define DCPOMATIC_SOUND_PROCESSOR_H
-
-#include <string>
-#include <vector>
-#include <boost/utility.hpp>
-
-/** @class SoundProcessor
- *  @brief Class to describe a sound processor.
- */
-class SoundProcessor : public boost::noncopyable
-{
-public:
-       SoundProcessor (std::string i, std::string n);
-
-       virtual float db_for_fader_change (float from, float to) const = 0;
-
-       /** @return id for our use */
-       std::string id () const {
-               return _id;
-       }
-
-       /** @return user-visible name for this sound processor */
-       std::string name () const {
-               return _name;
-       }
-       
-       static std::vector<SoundProcessor const *> 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 *);
-
-private:
-       /** id for our use */
-       std::string _id;
-       /** user-visible name for this sound processor */
-       std::string _name;
-
-       /** sll available sound processors */
-       static std::vector<SoundProcessor const *> _sound_processors;
-};
-
-#endif
index dd39e286e110608dadbe2de842703e6297d49f46..d04f195aff6bbfdbb64b030dba3aed40f37bf0e2 100644 (file)
@@ -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 ();
index 60150f4da5216f55a8f458aef8f12679d767d23f..9c929a671c9cbe7bbe8a6cc7f42cb184b8284644 100644 (file)
@@ -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
index 651ea93e10d317e1706c210283a4b5f36b09ef85..b19142ec5b0942c7cbe8daef411c9eed816dc779 100644 (file)
 #include <boost/lexical_cast.hpp>
 #include <wx/spinctrl.h>
 #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 ()
                        )
index 151130f270e9ca486d9600484ee6f30a99c947c5..c80a2a16cd5706510a649ad7ad5db603d83afe99 100644 (file)
@@ -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"