diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-04-06 23:57:46 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-04-06 23:57:46 +0100 |
| commit | c921cfe23b593d7c367ad76094308c5f08037374 (patch) | |
| tree | d010137615eb3817e57edaf0b0753ef924569965 /src/lib/audio_mapping.h | |
| parent | 8750efb9e072cf3b42e6c3c29521c7031c0b5dfd (diff) | |
Various work on audio channel mapping.
Diffstat (limited to 'src/lib/audio_mapping.h')
| -rw-r--r-- | src/lib/audio_mapping.h | 52 |
1 files changed, 29 insertions, 23 deletions
diff --git a/src/lib/audio_mapping.h b/src/lib/audio_mapping.h index 8804bde06..10ac20b48 100644 --- a/src/lib/audio_mapping.h +++ b/src/lib/audio_mapping.h @@ -17,37 +17,43 @@ */ -#include <vector> -#include <map> -#include <boost/optional.hpp> +#ifndef DVDOMATIC_AUDIO_MAPPING_H +#define DVDOMATIC_AUDIO_MAPPING_H + +#include <list> +#include <string> #include <libdcp/types.h> +#include <boost/shared_ptr.hpp> +#include "audio_content.h" class AudioMapping { public: - virtual boost::optional<libdcp::Channel> source_to_dcp (int c) const = 0; - virtual boost::optional<int> dcp_to_source (libdcp::Channel c) const = 0; -}; - -class AutomaticAudioMapping : public AudioMapping -{ -public: - AutomaticAudioMapping (int); + struct Channel { + Channel (boost::weak_ptr<const AudioContent> c, int i) + : content (c) + , index (i) + {} + + boost::weak_ptr<const AudioContent> content; + int index; + }; + + void add (Channel, libdcp::Channel); - boost::optional<libdcp::Channel> source_to_dcp (int c) const; - boost::optional<int> dcp_to_source (libdcp::Channel c) const; int dcp_channels () const; - -private: - int _source_channels; -}; + std::list<Channel> dcp_to_content (libdcp::Channel) const; + std::list<std::pair<Channel, libdcp::Channel> > content_to_dcp () const { + return _content_to_dcp; + } -class ConfiguredAudioMapping : public AudioMapping -{ -public: - boost::optional<libdcp::Channel> source_to_dcp (int c) const; - boost::optional<int> dcp_to_source (libdcp::Channel c) const; + std::list<Channel> content_channels () const; + std::list<libdcp::Channel> content_to_dcp (Channel) const; private: - std::map<int, libdcp::Channel> _source_to_dcp; + std::list<std::pair<Channel, libdcp::Channel> > _content_to_dcp; }; + +extern bool operator== (AudioMapping::Channel const &, AudioMapping::Channel const &); + +#endif |
