TOOLS: Respect the output directory given in compress_tinsel

That tool was ignoring the output directory given in command line
and always creating the result files in the current directory. Now it
uses the output directory if given and otherwise creates the result in
the directory that contains the input SMP file.
This commit is contained in:
Thierry Crozat
2013-03-02 12:54:32 +00:00
parent 2366007cf5
commit 362eb1fae0
2 changed files with 13 additions and 4 deletions
+1
View File
@@ -18,6 +18,7 @@ For a more comprehensive changelog of the latest experimental code, see:
- Fix too long help string for compression tools in the extra input file
selection which made the file selection impossible because the widgets
were outside the window.
- Respect given output directory in compress_tinsel.
1.4.0 (2011-11-11)
- Updated the compress_sci tool to add support for compressing the AUDIO001.002
+12 -4
View File
@@ -263,14 +263,22 @@ void CompressTinsel::execute() {
Common::Filename inpath_smp = _inputPaths[0].path;
Common::Filename inpath_idx = _inputPaths[1].path;
Common::Filename &outpath = _outputPath;
if (outpath.empty())
outpath = inpath_smp.getPath();
_input_idx.open(inpath_idx, "rb");
_input_smp.open(inpath_smp, "rb");
Common::removeFile(TEMP_IDX);
_output_idx.open(TEMP_IDX, "wb");
Common::Filename outpath_idx = outpath;
outpath_idx.setFullName(TEMP_IDX);
Common::removeFile(outpath_idx.getFullPath().c_str());
_output_idx.open(outpath_idx, "wb");
Common::removeFile(TEMP_SMP);
_output_smp.open(TEMP_SMP, "wb");
Common::Filename outpath_smp = outpath;
outpath_smp.setFullName(TEMP_SMP);
Common::removeFile(outpath_smp.getFullPath().c_str());
_output_smp.open(outpath_smp, "wb");
switch (_format) {
case AUDIO_MP3: