X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Flib%2Faudio_mapping.h;h=b0b75ac063372c8f258dc235a6675f44ad2b8e81;hb=c5b3d91fab31fde4c21e1cc5bb5adb1d6d26fcca;hp=a2de8306bbf376457788bb77884d4a523bbabee0;hpb=883d885dc8690519d205c8baa275385af8a39f4b;p=dcpomatic.git diff --git a/src/lib/audio_mapping.h b/src/lib/audio_mapping.h index a2de8306b..b0b75ac06 100644 --- a/src/lib/audio_mapping.h +++ b/src/lib/audio_mapping.h @@ -20,7 +20,7 @@ #ifndef DCPOMATIC_AUDIO_MAPPING_H #define DCPOMATIC_AUDIO_MAPPING_H -#include +#include #include #include @@ -32,27 +32,38 @@ namespace cxml { class Node; } +/** A many-to-many mapping from some content channels to DCP channels. + * The number of content channels is set on construction and fixed, + * and then each of those content channels are mapped to each DCP channel + * by a linear gain. + */ class AudioMapping { public: AudioMapping (); AudioMapping (int); - AudioMapping (boost::shared_ptr); + AudioMapping (boost::shared_ptr, int); + + /* Default copy constructor is fine */ void as_xml (xmlpp::Node *) const; - void add (int, libdcp::Channel); + void make_default (); - std::list dcp_to_content (libdcp::Channel) const; - std::list > content_to_dcp () const { - return _content_to_dcp; - } + void set (int, libdcp::Channel, float); + float get (int, libdcp::Channel) const; - std::list content_channels () const; - std::list content_to_dcp (int) const; + int content_channels () const { + return _content_channels; + } + std::string digest () const; + private: - std::list > _content_to_dcp; + void setup (int); + + int _content_channels; + std::vector > _gain; }; #endif