X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Faudio_mapping.h;h=a76d83a370f703dceded47e1d5aff6e90cd472e3;hb=94201bd2a5a4cb391b7f2bdeba56b928fed7cfe1;hp=ed2c3f28d28517eb9aaeb4a13c1380c84a85cf64;hpb=bfc0b96db6cc6c2e94d93f9c4239adca14a6bb0c;p=dcpomatic.git diff --git a/src/lib/audio_mapping.h b/src/lib/audio_mapping.h index ed2c3f28d..a76d83a37 100644 --- a/src/lib/audio_mapping.h +++ b/src/lib/audio_mapping.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2013 Carl Hetherington + Copyright (C) 2013-2014 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,12 +17,17 @@ */ +/** @file src/lib/audio_mapping.h + * @brief AudioMapping class. + */ + #ifndef DCPOMATIC_AUDIO_MAPPING_H #define DCPOMATIC_AUDIO_MAPPING_H -#include -#include +#include #include +#include +#include namespace xmlpp { class Node; @@ -32,29 +37,40 @@ namespace cxml { class Node; } +/** @class AudioMapping. + * @brief 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 (int channels); + AudioMapping (cxml::ConstNodePtr, 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, dcp::Channel, float); + float get (int, dcp::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