2 * Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>
4 * This file is part of CasparCG (www.casparcg.com).
6 * CasparCG is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * CasparCG is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with CasparCG. If not, see <http://www.gnu.org/licenses/>.
19 * Author: Helge Norberg, helge.norberg@svt.se
26 #include <boost/property_tree/ptree.hpp>
27 #include <boost/property_tree/xml_parser.hpp>
31 std::wstring get_default_audio_config_xml()
36 <channel-layout name="mono" type="mono" num-channels="1" channel-order="FC" />
37 <channel-layout name="stereo" type="stereo" num-channels="2" channel-order="FL FR" />
38 <channel-layout name="matrix" type="matrix" num-channels="2" channel-order="ML MR" />
39 <channel-layout name="film" type="5.1" num-channels="6" channel-order="FL FC FR BL BR LFE" />
40 <channel-layout name="smpte" type="5.1" num-channels="6" channel-order="FL FR FC LFE BL BR" />
41 <channel-layout name="ebu_r123_8a" type="5.1+downmix" num-channels="8" channel-order="DL DR FL FR FC LFE BL BR" />
42 <channel-layout name="ebu_r123_8b" type="5.1+downmix" num-channels="8" channel-order="FL FR FC LFE BL BR DL DR" />
43 <channel-layout name="8ch" type="8ch" num-channels="8" />
44 <channel-layout name="16ch" type="16ch" num-channels="16" />
47 <mix-config from-type="mono" to-types="stereo, 5.1" mix="FL = FC | FR = FC" />
48 <mix-config from-type="mono" to-types="5.1+downmix" mix="FL = FC | FR = FC | DL = FC | DR = FC" />
49 <mix-config from-type="mono" to-types="matrix" mix="ML = FC | MR = FC" />
50 <mix-config from-type="stereo" to-types="mono" mix="FC < FL + FR" />
51 <mix-config from-type="stereo" to-types="matrix" mix="ML = FL | MR = FR" />
52 <mix-config from-type="stereo" to-types="5.1" mix="FL = FL | FR = FR" />
53 <mix-config from-type="stereo" to-types="5.1+downmix" mix="FL = FL | FR = FR | DL = FL | DR = FR" />
54 <mix-config from-type="5.1" to-types="mono" mix="FC < FL + FR + 0.707*FC + 0.707*BL + 0.707*BR" />
55 <mix-config from-type="5.1" to-types="stereo" mix="FL < FL + 0.707*FC + 0.707*BL | FR < FR + 0.707*FC + 0.707*BR" />
56 <mix-config from-type="5.1" to-types="5.1+downmix" mix="FL = FL | FR = FR | FC = FC | BL = BL | BR = BR | LFE = LFE | DL < FL + 0.707*FC + 0.707*BL | DR < FR + 0.707*FC + 0.707*BR" />
57 <mix-config from-type="5.1" to-types="matrix" mix="ML = 0.3204*FL + 0.293*FC + -0.293*BL + -0.293*BR | MR = 0.3204*FR + 0.293*FC + 0.293*BL + 0.293*BR" />
58 <mix-config from-type="5.1+stereomix" to-types="mono" mix="FC < DL + DR" />
59 <mix-config from-type="5.1+stereomix" to-types="stereo" mix="FL = DL | FR = DR" />
60 <mix-config from-type="5.1+stereomix" to-types="5.1" mix="FL = FL | FR = FR | FC = FC | BL = BL | BR = BR | LFE = LFE" />
61 <mix-config from-type="5.1+stereomix" to-types="matrix" mix="ML = 0.3204*FL + 0.293*FC + -0.293*BL + -0.293*BR | MR = 0.3204*FR + 0.293*FC + 0.293*BL + 0.293*BR" />
67 boost::property_tree::wptree get_default_audio_config()
69 std::wstringstream stream(get_default_audio_config_xml());
70 boost::property_tree::wptree result;
71 boost::property_tree::xml_parser::read_xml(stream, result, boost::property_tree::xml_parser::trim_whitespace | boost::property_tree::xml_parser::no_comments);