Prepare my_vag conversion

This commit is contained in:
Jaby 2024-10-09 21:56:02 +02:00
parent 2aca10953d
commit c4edb01e68
4 changed files with 17 additions and 2 deletions

View File

@ -15,6 +15,7 @@ INPUT += $(OUTPUT_DIR)/fox.xa
INPUT += $(OUTPUT_DIR)/apple.vag
INPUT += $(OUTPUT_DIR)/blubb.vag
INPUT += $(OUTPUT_DIR)/Friendship_samp.vag
INPUT += $(OUTPUT_DIR)/Friendship_samp.vag2
## Images
INPUT += $(OUTPUT_DIR)/TexturePage.img
@ -46,6 +47,10 @@ $(OUTPUT_DIR)/%.vag: audio/temp/%.wav
@mkdir -p $(OUTPUT_DIR)
fileconv --lz4 $< -o $@ vag
$(OUTPUT_DIR)/%.vag2: audio/temp/%.wav
@mkdir -p $(OUTPUT_DIR)
fileconv --lz4 $< -o $@ my-vag
$(OUTPUT_DIR)/%.xa: audio/%.wav
@mkdir -p $(OUTPUT_DIR)
fileconv $< -o $@ xa

View File

@ -1,5 +1,6 @@
pub mod xa;
pub mod my_vag;
pub mod vag;
pub mod xa;
use std::{env, path::PathBuf, process::Command};
use tool_helper::Error;

View File

@ -0,0 +1,6 @@
use std::io::Write;
use tool_helper::{Error, Input};
pub fn convert(_input: Input, _output: &mut dyn Write) -> Result<(), Error> {
Err(Error::not_implemented("my vag convert"))
}

View File

@ -1,5 +1,5 @@
use clap::{Parser, Subcommand};
use fileconv::{audio::*, images::*, nothing};
use fileconv::{audio::{self, *}, images::*, nothing};
use std::path::PathBuf;
use tool_helper::{exit_with_error, print_warning, Error};
@ -24,6 +24,7 @@ enum SubCommands {
// === Internal Commands ===
Nothing,
SimpleTIM(reduced_tim::Arguments),
MyVAG,
// === External Commands ===
VAG(vag::Arguments),
@ -35,6 +36,7 @@ impl SubCommands {
match self {
SubCommands::Nothing => false,
SubCommands::SimpleTIM(_) => false,
SubCommands::MyVAG => false,
SubCommands::VAG(_) => true,
SubCommands::XA(_) => true
@ -60,6 +62,7 @@ fn run_internal_conversion(cmd: CommandLine) -> Result<(), Error> {
match cmd.sub_command {
SubCommands::Nothing => nothing::copy(&mut input, dst_buffer),
SubCommands::SimpleTIM(args) => reduced_tim::convert(args, input, dst_buffer),
SubCommands::MyVAG => audio::my_vag::convert(input, dst_buffer),
_ => Err(Error::from_str("External functions can not be called for internal conversion"))
}
};