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());
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;
void
-AudioDelay::flush ()
+AudioDelay::flush()
{
- _tail.reset ();
+ _tail.reset();
}
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;
using std::string;
-AudioPoint::AudioPoint ()
+AudioPoint::AudioPoint()
{
for (int i = 0; i < COUNT; ++i) {
_data[i] = 0;
}
-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];
AudioPoint &
-AudioPoint::operator= (AudioPoint const & other)
+AudioPoint::operator=(AudioPoint const & other)
{
if (this == &other) {
return *this;
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]));
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];
}
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);
class RNG
{
public:
- RNG (int32_t seed);
+ RNG(int32_t seed);
- int32_t get ();
+ int32_t get();
private:
uint32_t _state;
using boost::optional;
-BOOST_AUTO_TEST_CASE (atmos_passthrough_test)
+BOOST_AUTO_TEST_CASE(atmos_passthrough_test)
{
Cleanup cl;
&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;
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());
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;
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();
}