1414from ..fileio .bw64 .chunks import FormatInfoChunk
1515from ..fileio .adm import timing_fixes
1616import logging
17+ import textwrap
1718from .error_handler import error_handler
1819
1920
@@ -39,13 +40,34 @@ class OfflineRenderDriver(object):
3940
4041 blocksize = 8192
4142
43+ @classmethod
44+ def get_systems_help (cls ):
45+ formats_string = ", " .join (bs2051 .layout_names )
46+
47+ from ..core import hoa
48+ norm_names = ", " .join (hoa .norm_functions )
49+
50+ text = f"""\
51+ output system, accoring to ITU-R BS.2051
52+
53+ available systems:
54+ { formats_string }
55+
56+ HOA output can be specified as "hoa_norm_order_n" or "ambix_n" where:
57+ - norm is the normalization style, one of { norm_names }
58+ - order is the channel order, currently only ACN
59+ - n is the maximum order (e.g. 1 for first-order)
60+
61+ ambix_n is equivalent to hoa_SN3D_ACN_n
62+ """
63+
64+ return textwrap .dedent (text )
65+
4266 @classmethod
4367 def add_args (cls , parser ):
4468 """Add arguments to an ArgumentParser that can be used by from_args."""
45- formats_string = ", " .join (bs2051 .layout_names )
4669 parser .add_argument ("-s" , "--system" , required = True , metavar = "target_system" ,
47- help = "Target output system, accoring to ITU-R BS.2051. "
48- "Available systems are: {}" .format (formats_string ))
70+ help = cls .get_systems_help ())
4971
5072 parser .add_argument ("-l" , "--layout" , type = argparse .FileType ("r" ), metavar = "layout_file" ,
5173 help = "Layout config file" )
@@ -221,7 +243,7 @@ def run(self, input_file, output_file):
221243
222244
223245def make_parser ():
224- parser = argparse .ArgumentParser (description = "EBU ADM renderer" )
246+ parser = argparse .ArgumentParser (description = "EBU ADM renderer" , formatter_class = argparse . RawTextHelpFormatter )
225247
226248 parser .add_argument ("-d" , "--debug" ,
227249 help = "print debug information when an error occurs" ,
0 commit comments