diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-02-18 00:15:30 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-05-13 08:54:58 +0200 |
| commit | 3a1ddb9e182be28a22c5bbc85c06ee6629b72fe6 (patch) | |
| tree | 5294bf4b097d12e0fb69affb307def8e897d76ee /src/tools | |
| parent | bab59a964fe7fe6dabf1fb3df95ed5d7ec8df88a (diff) | |
Add dcpomatic2_map tool (#2445).
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/dcpomatic_map.cc | 49 | ||||
| -rw-r--r-- | src/tools/wscript | 2 |
2 files changed, 50 insertions, 1 deletions
diff --git a/src/tools/dcpomatic_map.cc b/src/tools/dcpomatic_map.cc new file mode 100644 index 000000000..2817fdd75 --- /dev/null +++ b/src/tools/dcpomatic_map.cc @@ -0,0 +1,49 @@ +/* + Copyright (C) 2023 Carl Hetherington <cth@carlh.net> + + This file is part of DCP-o-matic. + + DCP-o-matic is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + DCP-o-matic is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>. + +*/ + + +/** @file src/tools/dcpomatic_map.cc + * @brief Command-line program to assemble new DCPs from CPLs and assets. + */ + + +#include "lib/cross.h" +#include "lib/map_cli.h" +#include "lib/util.h" +#include <iostream> + + +int +main(int argc, char* argv[]) +{ + ArgFixer fixer(argc, argv); + + dcpomatic_setup_path_encoding(); + dcpomatic_setup(); + + auto error = map_cli(fixer.argc(), fixer.argv(), [](std::string s) { std::cout << s << "\n"; }); + if (error) { + std::cerr << *error << "\n"; + exit (EXIT_FAILURE); + } + + return 0; +} + diff --git a/src/tools/wscript b/src/tools/wscript index 9a3b95a79..c3b2b5fe0 100644 --- a/src/tools/wscript +++ b/src/tools/wscript @@ -42,7 +42,7 @@ def build(bld): if bld.env.TARGET_LINUX: uselib += 'DL ' - cli_tools = ['dcpomatic_cli', 'dcpomatic_server_cli', 'server_test', 'dcpomatic_kdm_cli', 'dcpomatic_create'] + cli_tools = ['dcpomatic_cli', 'dcpomatic_server_cli', 'server_test', 'dcpomatic_kdm_cli', 'dcpomatic_create', 'dcpomatic_map'] if bld.env.ENABLE_DISK and not bld.env.DISABLE_GUI: cli_tools.append('dcpomatic_disk_writer') |
