Add accessors.
[libdcp.git] / src / sound_asset_writer.cc
index 3cb25db59b733fa224d663a1540b7ecf34cbbae6..8df4d911a0334377bbe01f7b71e71581cba0f648 100644 (file)
@@ -36,7 +36,7 @@
 #include "exceptions.h"
 #include "dcp_assert.h"
 #include "compose.hpp"
-#include "encryption_context.h"
+#include "crypto_context.h"
 #include <asdcp/AS_DCP.h>
 #include <iostream>
 
@@ -53,8 +53,8 @@ struct SoundAssetWriter::ASDCPState
        ASDCP::PCM::AudioDescriptor desc;
 };
 
-SoundAssetWriter::SoundAssetWriter (SoundAsset* asset, boost::filesystem::path file, Standard standard)
-       : AssetWriter (asset, file, standard)
+SoundAssetWriter::SoundAssetWriter (SoundAsset* asset, boost::filesystem::path file)
+       : AssetWriter (asset, file)
        , _state (new SoundAssetWriter::ASDCPState)
        , _asset (asset)
        , _frame_buffer_offset (0)
@@ -68,7 +68,7 @@ SoundAssetWriter::SoundAssetWriter (SoundAsset* asset, boost::filesystem::path f
        _state->desc.BlockAlign = 3 * _asset->channels();
        _state->desc.AvgBps = _asset->sampling_rate() * _state->desc.BlockAlign;
        _state->desc.LinkedTrackID = 0;
-       if (standard == INTEROP) {
+       if (asset->standard() == INTEROP) {
                _state->desc.ChannelFormat = ASDCP::PCM::CF_NONE;
        } else {
                /* Just use WTF ("wild track format") for SMPTE for now; searches suggest that this
@@ -86,7 +86,7 @@ SoundAssetWriter::SoundAssetWriter (SoundAsset* asset, boost::filesystem::path f
        _state->frame_buffer.Size (ASDCP::PCM::CalcFrameBufferSize (_state->desc));
        memset (_state->frame_buffer.Data(), 0, _state->frame_buffer.Capacity());
 
-       _asset->fill_writer_info (&_state->writer_info, _asset->id(), standard);
+       _asset->fill_writer_info (&_state->writer_info, _asset->id());
 }
 
 void
@@ -143,7 +143,7 @@ SoundAssetWriter::write (float const * const * data, int frames)
 void
 SoundAssetWriter::write_current_frame ()
 {
-       ASDCP::Result_t const r = _state->mxf_writer.WriteFrame (_state->frame_buffer, _encryption_context->encryption(), _encryption_context->hmac());
+       ASDCP::Result_t const r = _state->mxf_writer.WriteFrame (_state->frame_buffer, _crypto_context->context(), _crypto_context->hmac());
        if (ASDCP_FAILURE (r)) {
                boost::throw_exception (MiscError (String::compose ("could not write audio MXF frame (%1)", int (r))));
        }