White space: audio_delay.{cc,h} audio_point.{cc,h} rng.{cc,h} atmos_test.cc
authorCarl Hetherington <cth@carlh.net>
Fri, 24 Jan 2025 23:56:12 +0000 (00:56 +0100)
committerCarl Hetherington <cth@carlh.net>
Fri, 24 Jan 2025 23:56:12 +0000 (00:56 +0100)
src/lib/audio_delay.cc
src/lib/audio_delay.h
src/lib/audio_point.cc
src/lib/audio_point.h
src/lib/rng.cc
src/lib/rng.h
test/atmos_test.cc

index d06d9e73023055d8d060ae322bd64cc63e379f0c..2329b3679235d0932c8e501e426687ce85d1f240 100644 (file)
@@ -30,18 +30,18 @@ using std::make_shared;
 using std::shared_ptr;
 
 
-AudioDelay::AudioDelay (int samples)
-       : _samples (samples)
+AudioDelay::AudioDelay(int samples)
+       : _samples(samples)
 {
 
 }
 
 
 shared_ptr<AudioBuffers>
-AudioDelay::run (shared_ptr<const AudioBuffers> in)
+AudioDelay::run(shared_ptr<const AudioBuffers> in)
 {
        /* You can't call this with varying channel counts */
-       DCPOMATIC_ASSERT (!_tail || in->channels() == _tail->channels());
+       DCPOMATIC_ASSERT(!_tail || in->channels() == _tail->channels());
 
        auto out = make_shared<AudioBuffers>(in->channels(), in->frames());
 
@@ -49,37 +49,37 @@ AudioDelay::run (shared_ptr<const AudioBuffers> in)
 
                if (!_tail) {
                        /* No tail; use silence */
-                       out->make_silent (0, _samples);
+                       out->make_silent(0, _samples);
                } else {
                        /* Copy tail */
-                       out->copy_from (_tail.get(), _samples, 0, 0);
+                       out->copy_from(_tail.get(), _samples, 0, 0);
                }
 
                /* Copy in to out */
-               out->copy_from (in.get(), in->frames() - _samples, 0, _samples);
+               out->copy_from(in.get(), in->frames() - _samples, 0, _samples);
 
                /* Keep tail */
                if (!_tail) {
                        _tail = make_shared<AudioBuffers>(in->channels(), _samples);
                }
-               _tail->copy_from (in.get(), _samples, in->frames() - _samples, 0);
+               _tail->copy_from(in.get(), _samples, in->frames() - _samples, 0);
 
        } else {
 
                /* First part of the tail into the output */
                if (_tail) {
-                       out->copy_from (_tail.get(), out->frames(), 0, 0);
+                       out->copy_from(_tail.get(), out->frames(), 0, 0);
                } else {
-                       out->make_silent ();
+                       out->make_silent();
                        _tail = make_shared<AudioBuffers>(out->channels(), _samples);
-                       _tail->make_silent ();
+                       _tail->make_silent();
                }
 
                /* Shuffle the tail down */
-               _tail->move (_tail->frames() - out->frames(), out->frames(), 0);
+               _tail->move(_tail->frames() - out->frames(), out->frames(), 0);
 
                /* Copy input into the tail */
-               _tail->copy_from (in.get(), in->frames(), 0, _tail->frames() - in->frames());
+               _tail->copy_from(in.get(), in->frames(), 0, _tail->frames() - in->frames());
        }
 
        return out;
@@ -87,7 +87,7 @@ AudioDelay::run (shared_ptr<const AudioBuffers> in)
 
 
 void
-AudioDelay::flush ()
+AudioDelay::flush()
 {
-       _tail.reset ();
+       _tail.reset();
 }
index 5f3f89a6596d9037e86a1c217ce1f8008c60e20a..b0266f54c93a6b65701382fc40b095a4689e180d 100644 (file)
@@ -31,9 +31,9 @@ class AudioBuffers;
 class AudioDelay
 {
 public:
-       explicit AudioDelay (int samples);
-       std::shared_ptr<AudioBuffers> run (std::shared_ptr<const AudioBuffers> in);
-       void flush ();
+       explicit AudioDelay(int samples);
+       std::shared_ptr<AudioBuffers> run(std::shared_ptr<const AudioBuffers> in);
+       void flush();
 
 private:
        std::shared_ptr<AudioBuffers> _tail;
index efd342dd14dde6d716cc6e8bcbdbfcde586da586..a5243bdce584280b1475d7cfe6e387aa6a7c951c 100644 (file)
@@ -30,7 +30,7 @@ LIBDCP_ENABLE_WARNINGS
 using std::string;
 
 
-AudioPoint::AudioPoint ()
+AudioPoint::AudioPoint()
 {
        for (int i = 0; i < COUNT; ++i) {
                _data[i] = 0;
@@ -38,14 +38,14 @@ AudioPoint::AudioPoint ()
 }
 
 
-AudioPoint::AudioPoint (cxml::ConstNodePtr node)
+AudioPoint::AudioPoint(cxml::ConstNodePtr node)
 {
        _data[PEAK] = node->number_child<float>("Peak");
        _data[RMS] = node->number_child<float>("RMS");
 }
 
 
-AudioPoint::AudioPoint (AudioPoint const & other)
+AudioPoint::AudioPoint(AudioPoint const & other)
 {
        for (int i = 0; i < COUNT; ++i) {
                _data[i] = other._data[i];
@@ -54,7 +54,7 @@ AudioPoint::AudioPoint (AudioPoint const & other)
 
 
 AudioPoint &
-AudioPoint::operator= (AudioPoint const & other)
+AudioPoint::operator=(AudioPoint const & other)
 {
        if (this == &other) {
                return *this;
@@ -69,7 +69,7 @@ AudioPoint::operator= (AudioPoint const & other)
 
 
 void
-AudioPoint::as_xml (xmlpp::Element* parent) const
+AudioPoint::as_xml(xmlpp::Element* parent) const
 {
        cxml::add_text_child(parent, "Peak", fmt::to_string(_data[PEAK]));
        cxml::add_text_child(parent, "RMS", fmt::to_string(_data[RMS]));
index e7c232728a778604bbbe95a8332a4eea20933ad6..49646a8dc5f6b2827638dad820a26a60d8ad8cb8 100644 (file)
@@ -40,14 +40,14 @@ public:
                COUNT
        };
 
-       AudioPoint ();
-       explicit AudioPoint (cxml::ConstNodePtr node);
-       AudioPoint (AudioPoint const &);
-       AudioPoint& operator= (AudioPoint const &);
+       AudioPoint();
+       explicit AudioPoint(cxml::ConstNodePtr node);
+       AudioPoint(AudioPoint const &);
+       AudioPoint& operator=(AudioPoint const &);
 
-       void as_xml (xmlpp::Element *) const;
+       void as_xml(xmlpp::Element *) const;
 
-       inline float& operator[] (int t) {
+       inline float& operator[](int t) {
                return _data[t];
        }
 
index 4d82cf721ec00310e9b938df6982f7c63544a38d..b267761684f956669392eac346ba5fda035ce7ed 100644 (file)
 using namespace dcpomatic;
 
 
-RNG::RNG (int32_t seed)
-       : _state (static_cast<uint32_t>(seed))
+RNG::RNG(int32_t seed)
+       : _state(static_cast<uint32_t>(seed))
 {
 
 }
 
 
-int32_t RNG::get ()
+int32_t RNG::get()
 {
        uint32_t const b = ((_state >> 0) ^ (_state >> 1) ^ (_state >> 2) ^ (_state >> 7));
        _state = (_state >> 1) | (b << 23);
index e3dc0c50dae50f19d173be612b989456d8678533..d03988e7c3c63eaa1f4f8c60f58fb7712c804f9e 100644 (file)
@@ -31,9 +31,9 @@ namespace dcpomatic {
 class RNG
 {
 public:
-       RNG (int32_t seed);
+       RNG(int32_t seed);
 
-       int32_t get ();
+       int32_t get();
 
 private:
        uint32_t _state;
index ef7449f20713febac4acd84fcfbcaccef499257c..33a427321e4bd4caa6bb8cd3632aacf709263bf1 100644 (file)
@@ -41,7 +41,7 @@ using std::vector;
 using boost::optional;
 
 
-BOOST_AUTO_TEST_CASE (atmos_passthrough_test)
+BOOST_AUTO_TEST_CASE(atmos_passthrough_test)
 {
        Cleanup cl;
 
@@ -51,16 +51,16 @@ BOOST_AUTO_TEST_CASE (atmos_passthrough_test)
                &cl
                );
 
-       make_and_verify_dcp (film, {dcp::VerificationNote::Code::MISSING_CPL_METADATA});
+       make_and_verify_dcp(film, {dcp::VerificationNote::Code::MISSING_CPL_METADATA});
 
        auto ref = TestPaths::private_data() / "atmos_asset.mxf";
-       BOOST_REQUIRE (mxf_atmos_files_same(ref, dcp_file(film, "atmos"), true));
+       BOOST_REQUIRE(mxf_atmos_files_same(ref, dcp_file(film, "atmos"), true));
 
-       cl.run ();
+       cl.run();
 }
 
 
-BOOST_AUTO_TEST_CASE (atmos_encrypted_passthrough_test)
+BOOST_AUTO_TEST_CASE(atmos_encrypted_passthrough_test)
 {
        Cleanup cl;
 
@@ -68,11 +68,11 @@ BOOST_AUTO_TEST_CASE (atmos_encrypted_passthrough_test)
        auto content = content_factory(TestPaths::private_data() / "atmos_asset.mxf");
        auto film = new_test_film("atmos_encrypted_passthrough_test", content, &cl);
 
-       film->set_encrypted (true);
-       film->_key = dcp::Key ("4fac12927eb122af1c2781aa91f3a4cc");
-       make_and_verify_dcp (film, { dcp::VerificationNote::Code::MISSING_CPL_METADATA });
+       film->set_encrypted(true);
+       film->_key = dcp::Key("4fac12927eb122af1c2781aa91f3a4cc");
+       make_and_verify_dcp(film, { dcp::VerificationNote::Code::MISSING_CPL_METADATA });
 
-       BOOST_REQUIRE (!mxf_atmos_files_same(ref, dcp_file(film, "atmos")));
+       BOOST_REQUIRE(!mxf_atmos_files_same(ref, dcp_file(film, "atmos")));
 
        auto signer = Config::instance()->signer_chain();
        BOOST_REQUIRE(signer->valid());
@@ -81,17 +81,17 @@ BOOST_AUTO_TEST_CASE (atmos_encrypted_passthrough_test)
        auto const kdm = decrypted_kdm.encrypt(signer, Config::instance()->decryption_chain()->leaf(), {}, dcp::Formulation::MODIFIED_TRANSITIONAL_1, false, {});
 
        auto content2 = make_shared<DCPContent>(film->dir(film->dcp_name()));
-       content2->add_kdm (kdm);
+       content2->add_kdm(kdm);
        auto film2 = new_test_film("atmos_encrypted_passthrough_test2", {content2}, &cl);
-       make_and_verify_dcp (film2, { dcp::VerificationNote::Code::MISSING_CPL_METADATA });
+       make_and_verify_dcp(film2, { dcp::VerificationNote::Code::MISSING_CPL_METADATA });
 
-       BOOST_CHECK (mxf_atmos_files_same(ref, dcp_file(film2, "atmos"), true));
+       BOOST_CHECK(mxf_atmos_files_same(ref, dcp_file(film2, "atmos"), true));
 
-       cl.run ();
+       cl.run();
 }
 
 
-BOOST_AUTO_TEST_CASE (atmos_trim_test)
+BOOST_AUTO_TEST_CASE(atmos_trim_test)
 {
        Cleanup cl;
 
@@ -102,7 +102,7 @@ BOOST_AUTO_TEST_CASE (atmos_trim_test)
        content[0]->set_trim_start(film, dcpomatic::ContentTime::from_seconds(1));
 
        /* Just check that the encode runs; I'm not sure how to test the MXF */
-       make_and_verify_dcp (film, { dcp::VerificationNote::Code::MISSING_CPL_METADATA });
+       make_and_verify_dcp(film, { dcp::VerificationNote::Code::MISSING_CPL_METADATA });
 
        cl.run();
 }