X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Faudio_mapping.h;h=f3096764c79c248ddb3bb0a0519efbd6caaa9f8f;hb=09806bc8d6a48fc79d923ec1cdf6f90176bf8b6a;hp=7d76e4f5a0643066285086522cd66d12d81ceaea;hpb=237a0052c60af768f4d62b00321932918b7ba4d9;p=dcpomatic.git diff --git a/src/lib/audio_mapping.h b/src/lib/audio_mapping.h index 7d76e4f5a..f3096764c 100644 --- a/src/lib/audio_mapping.h +++ b/src/lib/audio_mapping.h @@ -1,5 +1,3 @@ -/* -*- c-basic-offset: 8; default-tab-width: 8; -*- */ - /* Copyright (C) 2013 Carl Hetherington @@ -22,8 +20,8 @@ #ifndef DCPOMATIC_AUDIO_MAPPING_H #define DCPOMATIC_AUDIO_MAPPING_H -#include -#include +#include +#include #include namespace xmlpp { @@ -34,27 +32,36 @@ 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); - - std::list dcp_to_content (libdcp::Channel) const; - std::list > content_to_dcp () const { - return _content_to_dcp; - } + void make_default (); - std::list content_channels () const; - std::list content_to_dcp (int) const; + void set (int, dcp::Channel, float); + float get (int, dcp::Channel) const; + int content_channels () const { + return _content_channels; + } + private: - std::list > _content_to_dcp; + void setup (int); + + int _content_channels; + std::vector > _gain; }; #endif