Skip to content

Commit

Permalink
Implement exports
Browse files Browse the repository at this point in the history
  • Loading branch information
Tremeschin committed Mar 14, 2023
1 parent ba0fa86 commit daee9dc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
14 changes: 8 additions & 6 deletions Ardmin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,8 @@ use Protostar::*;

// -----------------------------------------------------------------------------------------------|

const ABOUT: &str = "
Ardmin, an Ardour Session Minimizer.
(c) 2023 Tremeschin, AGPLv3-only License.";

#[derive(Parser, Debug)]
#[command(author=Protostar::Const::AUTHOR, about=Protostar::Const::About::ARDMIN, version)]
#[command(author=Protostar::Constants::AUTHOR, about=Protostar::Constants::About::ARDMIN, version)]
struct Args {
#[arg(short, long, help="(Global ) Path to a Folder of Ardour Sessions")]
path: String,
Expand Down Expand Up @@ -113,5 +108,12 @@ fn main() {
}
}
}

// Optimization: Move exports to other folder
if args.exports != str!("") {
for export in Protostar::betterGlob(session.join("export").join("*")) {
Protostar::moveFile(&export, &PathBuf::from(args.exports.clone()).join(export.file_name().unwrap()));
}
}
}
}
6 changes: 5 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Usage: Ardmin [OPTIONS] --path <PATH>
Options:
-p, --path <PATH> (Global ) Path to a Folder of Ardour Sessions
--exports <EXPORTS> (Global ) Move existing exports files to other path [default: ]
-a, --all (Global ) Apply all optimizations
-u, --unused (Optimization) Remove unused Source files (MIDI, WAV)
-s, --states (Optimization) Remove old plugin states (5% chance of breaking per-plugin??)
Expand All @@ -40,12 +41,15 @@ Options:
-V, --version Print version
```

Apply all optimizations possible:
Apply all optimizations possible (except exports):
- `./ardmin -p ~/Path/To/Ardour/Sessions -a`

Apply only states and unused optimizations:
- `./ardmin -p ~/Path/To/Ardour/Sessions -s -u`

Move every export/* file from all sessions to some other directory
- `./ardmin -p ~/Path/To/Ardour/Sessions --exports ~/Path/To/Exports/Only`

# ● Warnings

<i><b>Note:</b> Plugin states optimization behaviour seems a bit random, at times it might change a setting or two on the current presets or break entirely. Only happened with Vital and TAL Filter 2 for me, rarely.</i>
Expand Down

0 comments on commit daee9dc

Please sign in to comment.