X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;ds=inline;f=src%2Flib%2Faudio_mapping.h;h=8be8eeb6fa030cfbb27099abdf4c18a4d9b3e519;hb=04533b9cf34ce8089113015715083ee9c5b2b001;hp=3c471d3f4f16aaead62df787c4c7666e5226e8aa;hpb=21ce34c2cd04a2e7e133ff693b84c054182f4f91;p=dcpomatic.git diff --git a/src/lib/audio_mapping.h b/src/lib/audio_mapping.h index 3c471d3f4..8be8eeb6f 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 @@ -20,31 +20,51 @@ #ifndef DCPOMATIC_AUDIO_MAPPING_H #define DCPOMATIC_AUDIO_MAPPING_H -#include -#include -#include +#include #include -#include "audio_content.h" +#include +#include +namespace xmlpp { + class Node; +} + +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 channels); + AudioMapping (cxml::ConstNodePtr, int); + + /* Default copy constructor is fine */ + void as_xml (xmlpp::Node *) const; - void set_from_xml (boost::shared_ptr); - void add (int, libdcp::Channel); + void make_default (); - int dcp_channels () const; - 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