Rename ContentAtmos -> PieceAtmos and pass atmos through Piece.
[dcpomatic.git] / src / lib / piece.cc
index 69469c02e2c3524ab63647127f0fadb0dfe59ce4..452b34222a8459de37af1c19a22b5efe4af6c695 100644 (file)
@@ -19,6 +19,8 @@
 */
 
 
+#include "atmos_decoder.h"
+#include "atmos_metadata.h"
 #include "audio_content.h"
 #include "audio_decoder.h"
 #include "content.h"
@@ -74,6 +76,10 @@ Piece::Piece (weak_ptr<const Film> film, shared_ptr<Content> content, shared_ptr
                i->Stop.connect (boost::bind(&Piece::stop, this, content, i->content(), _1));
        }
 
+       if (_decoder->atmos) {
+               _decoder->atmos->Data.connect (boost::bind(&Piece::atmos, this, _1, _2, _3));
+       }
+
        _decoder->Flush.connect (boost::bind(&Piece::flush, this));
 }
 
@@ -152,6 +158,13 @@ Piece::stop (weak_ptr<const Content> content, weak_ptr<const TextContent> text,
 }
 
 
+void
+Piece::atmos (shared_ptr<const dcp::AtmosFrame> data, Frame frame, AtmosMetadata metadata)
+{
+       Atmos (PieceAtmos(data, frame, metadata));
+}
+
+
 void
 Piece::update_pull_to (DCPTime& pull_to) const
 {