mirror of
https://github.com/italicsjenga/ableton-rack-converter.git
synced 2024-11-22 15:11:30 +11:00
it works?
This commit is contained in:
parent
272e531f7d
commit
ed06bcee8b
|
@ -10,7 +10,6 @@ fn main() {
|
|||
path_str.push_str(loadpath.file_stem().unwrap().to_str().unwrap());
|
||||
path_str.push_str("-compressed.adg");
|
||||
let savepath = PathBuf::from(path_str);
|
||||
println!("{:?}", savepath);
|
||||
ableton_rack_converter::compress_file(loadpath, savepath);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,20 @@
|
|||
use std::path::PathBuf;
|
||||
use std::{env, path::PathBuf};
|
||||
|
||||
use ableton_rack_converter::{self, fixers};
|
||||
|
||||
fn main() {
|
||||
let file_load = PathBuf::from(".\\validation\\Utility11.adg");
|
||||
let file_save = PathBuf::from(".\\exported_files\\Utility11_save.adg");
|
||||
let args: Vec<String> = env::args().collect();
|
||||
if args.len() == 1 {
|
||||
return;
|
||||
}
|
||||
let file_load = PathBuf::from(args[1].as_str());
|
||||
if file_load.extension().expect("no extension") != "adg" {
|
||||
return;
|
||||
}
|
||||
let mut path_str = String::from(".\\");
|
||||
path_str.push_str(file_load.file_stem().unwrap().to_str().unwrap());
|
||||
path_str.push_str("-live10.adg");
|
||||
let file_save = PathBuf::from(path_str);
|
||||
let mut device = ableton_rack_converter::load_adg(file_load);
|
||||
fixers::traverse_children(&mut device);
|
||||
ableton_rack_converter::save_adg(&device, file_save);
|
||||
|
|
|
@ -3,7 +3,6 @@ use xml_dom::level2::{Attribute, Node, RefNode};
|
|||
pub fn traverse_children(node: &mut RefNode) {
|
||||
if node.node_name().to_string() == "Ableton" {
|
||||
for (name, mut attribute) in node.attributes() {
|
||||
println!("{}: {}", name, attribute);
|
||||
match name.to_string().as_str() {
|
||||
"MajorVersion" => attribute.set_value("5").unwrap(),
|
||||
"MinorVersion" => attribute.set_value("10.0_370").unwrap(),
|
||||
|
|
Loading…
Reference in a new issue