X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Flib%2Fcinema_sound_processor.cc;h=1eaf8e1fcd1904e456995190ee690e45daa22241;hp=bd60f7d710e2acef17813225baa62fe8a09e7d4d;hb=da44da6f31f97d39ca91c35955e573e76371f2c2;hpb=2da4caba7871455c097c0ed940dd6f2332dbda5d diff --git a/src/lib/cinema_sound_processor.cc b/src/lib/cinema_sound_processor.cc index bd60f7d71..1eaf8e1fc 100644 --- a/src/lib/cinema_sound_processor.cc +++ b/src/lib/cinema_sound_processor.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2014 Carl Hetherington + Copyright (C) 2012-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -18,10 +18,12 @@ */ + /** @file src/sound_processor.cc * @brief CinemaSoundProcessor class. */ + #include "cinema_sound_processor.h" #include "dolby_cp750.h" #include "usl.h" @@ -30,10 +32,13 @@ #include #include + using namespace std; + vector CinemaSoundProcessor::_cinema_sound_processors; + /** @param i Our id. * @param n User-visible name. */ @@ -47,6 +52,7 @@ CinemaSoundProcessor::CinemaSoundProcessor (string i, string n, float knee, floa } + /** @return All available sound processors */ vector CinemaSoundProcessor::all () @@ -54,6 +60,7 @@ CinemaSoundProcessor::all () return _cinema_sound_processors; } + /** Set up the static _sound_processors vector; must be called before from_* * methods are used. */ @@ -65,24 +72,26 @@ CinemaSoundProcessor::setup_cinema_sound_processors () _cinema_sound_processors.push_back (new DatasatAP2x); } + /** @param id One of our ids. * @return Corresponding sound processor, or 0. */ CinemaSoundProcessor const * CinemaSoundProcessor::from_id (string id) { - vector::iterator i = _cinema_sound_processors.begin (); + auto i = _cinema_sound_processors.begin (); while (i != _cinema_sound_processors.end() && (*i)->id() != id) { ++i; } if (i == _cinema_sound_processors.end ()) { - return 0; + return nullptr; } return *i; } + /** @param s A sound processor from our static list. * @return Index of the sound processor with the list, or -1. */ @@ -101,6 +110,7 @@ CinemaSoundProcessor::as_index (CinemaSoundProcessor const * s) return i; } + /** @param i An index returned from as_index(). * @return Corresponding sound processor. */ @@ -111,6 +121,7 @@ CinemaSoundProcessor::from_index (int i) return _cinema_sound_processors[i]; } + float CinemaSoundProcessor::db_for_fader_change (float from, float to) const {