mirror of
https://github.com/tkmxqrdxddd/davinci-video-converter
synced 2026-03-29 23:35:32 +02:00
feat: add devcontainer/nix support and refactor into modules
- Add .devcontainer/devcontainer.json for Podman development - Add shell.nix for Nix users - Refactor monolithic main.cpp into modular components: - parser: argument parsing - validator: configuration validation - converter: ffmpeg command building/execution - Update Makefile with proper dependencies and test target - Simplify build.sh to use make - Update README with development environment docs
This commit is contained in:
15
src/include/config.hpp
Normal file
15
src/include/config.hpp
Normal file
@@ -0,0 +1,15 @@
|
||||
#ifndef CONFIG_HPP
|
||||
#define CONFIG_HPP
|
||||
|
||||
#include <string>
|
||||
|
||||
struct Config {
|
||||
std::string input_path;
|
||||
std::string output_path;
|
||||
std::string codec = "h264";
|
||||
std::string quality = "medium";
|
||||
int crf = 23;
|
||||
bool verbose = false;
|
||||
};
|
||||
|
||||
#endif // CONFIG_HPP
|
||||
10
src/include/converter.hpp
Normal file
10
src/include/converter.hpp
Normal file
@@ -0,0 +1,10 @@
|
||||
#ifndef CONVERTER_HPP
|
||||
#define CONVERTER_HPP
|
||||
|
||||
#include "config.hpp"
|
||||
#include <string>
|
||||
|
||||
std::string build_ffmpeg_command(const Config& config);
|
||||
int execute_conversion(const std::string& command, bool verbose);
|
||||
|
||||
#endif // CONVERTER_HPP
|
||||
9
src/include/parser.hpp
Normal file
9
src/include/parser.hpp
Normal file
@@ -0,0 +1,9 @@
|
||||
#ifndef PARSER_HPP
|
||||
#define PARSER_HPP
|
||||
|
||||
#include "config.hpp"
|
||||
|
||||
Config parse_arguments(int argc, char* argv[]);
|
||||
void print_usage(const char* program_name);
|
||||
|
||||
#endif // PARSER_HPP
|
||||
9
src/include/validator.hpp
Normal file
9
src/include/validator.hpp
Normal file
@@ -0,0 +1,9 @@
|
||||
#ifndef VALIDATOR_HPP
|
||||
#define VALIDATOR_HPP
|
||||
|
||||
#include "config.hpp"
|
||||
#include <string>
|
||||
|
||||
bool validate_config(const Config& config, std::string& error);
|
||||
|
||||
#endif // VALIDATOR_HPP
|
||||
Reference in New Issue
Block a user