| 48 | }; |
| 49 | |
| 50 | static CommandLine |
| 51 | ParseCommandLine(int argc, char **argv) |
| 52 | { |
| 53 | CommandLine c; |
| 54 | |
| 55 | OptionParser option_parser(option_defs, argc, argv); |
| 56 | while (auto o = option_parser.Next()) { |
| 57 | switch (Option(o.index)) { |
| 58 | case OPTION_VERBOSE: |
| 59 | c.verbose = true; |
| 60 | break; |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | auto args = option_parser.GetRemaining(); |
| 65 | if (args.size() < 2 || args.size() > 3) |
| 66 | throw std::runtime_error("Usage: run_filter CONFIG NAME [FORMAT] <IN"); |
| 67 | |
| 68 | c.config_path = args[0]; |
| 69 | c.filter_name = args[1]; |
| 70 | |
| 71 | if (args.size() > 2) |
| 72 | c.audio_format = ParseAudioFormat(args[2], false); |
| 73 | |
| 74 | return c; |
| 75 | } |
| 76 | |
| 77 | static std::unique_ptr<PreparedFilter> |
| 78 | LoadFilter(const ConfigData &config, const char *name) |
no test coverage detected