summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-07-13 21:56:17 +0100
committerCarl Hetherington <cth@carlh.net>2014-07-13 21:56:17 +0100
commitdbd26fada835a44d7547007fc44273b2119f3e35 (patch)
tree2693d80bc9a65c767f876e623a8db26a9c12fe27 /src/lib
parent3ddd928233130695d7f4eeee47a71409d8c04de7 (diff)
Rename SoundProcessor -> CinemaSoundProcessor.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/cinema_sound_processor.cc (renamed from src/lib/sound_processor.cc)46
-rw-r--r--src/lib/cinema_sound_processor.h (renamed from src/lib/sound_processor.h)35
-rw-r--r--src/lib/config.cc16
-rw-r--r--src/lib/config.h12
-rw-r--r--src/lib/dolby_cp750.cc2
-rw-r--r--src/lib/dolby_cp750.h4
-rw-r--r--src/lib/util.cc4
-rw-r--r--src/lib/wscript3
8 files changed, 65 insertions, 57 deletions
diff --git a/src/lib/sound_processor.cc b/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 <cth@carlh.net>
+ 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
@@ -18,22 +18,22 @@
*/
/** @file src/sound_processor.cc
- * @brief A class to describe a sound processor.
+ * @brief CinemaSoundProcessor class.
*/
#include <iostream>
#include <cassert>
-#include "sound_processor.h"
+#include "cinema_sound_processor.h"
#include "dolby_cp750.h"
using namespace std;
-vector<SoundProcessor const *> SoundProcessor::_sound_processors;
+vector<CinemaSoundProcessor const *> 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 const *>
-SoundProcessor::all ()
+vector<CinemaSoundProcessor const *>
+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<SoundProcessor const *>::iterator i = _sound_processors.begin ();
- while (i != _sound_processors.end() && (*i)->id() != id) {
+ vector<CinemaSoundProcessor const *>::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<SoundProcessor*>::size_type i = 0;
- while (i < _sound_processors.size() && _sound_processors[i] != s) {
+ vector<CinemaSoundProcessor*>::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
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 <cth@carlh.net>
+ 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
@@ -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 <string>
#include <vector>
#include <boost/utility.hpp>
-/** @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<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 *);
+ 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 */
@@ -60,8 +63,8 @@ private:
/** user-visible name for this sound processor */
std::string _name;
- /** sll available sound processors */
- static std::vector<SoundProcessor const *> _sound_processors;
+ /** sll available cinema sound processors */
+ static std::vector<CinemaSoundProcessor const *> _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<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;
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