X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Faudio_mapping.h;h=8be8eeb6fa030cfbb27099abdf4c18a4d9b3e519;hb=8102046b2f29e0c7b234c29bf204b056cb30e64f;hp=9a507b550e958a8d0928adf2f1a9733eb79db708;hpb=5778f4c92793a7950f02206e735a00731c87b090;p=dcpomatic.git diff --git a/src/lib/audio_mapping.h b/src/lib/audio_mapping.h index 9a507b550..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,9 +20,10 @@ #ifndef DCPOMATIC_AUDIO_MAPPING_H #define DCPOMATIC_AUDIO_MAPPING_H -#include -#include +#include #include +#include +#include namespace xmlpp { class Node; @@ -34,37 +35,36 @@ namespace cxml { /** 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 can be mapped to zero or - * more DCP channels. + * 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; int content_channels () const { return _content_channels; } - - std::list content_to_dcp (int) const; + std::string digest () const; + private: + void setup (int); + int _content_channels; - std::list > _content_to_dcp; + std::vector > _gain; }; #endif