Skip to content

Commit 27ee73b

Browse files
committed
generated file name indicates relative rotation
1 parent 50a55ff commit 27ee73b

4 files changed

Lines changed: 20 additions & 2 deletions

File tree

include/Kaixo/SpectralRotator/Processing/FileHandler.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ namespace Kaixo::Processing {
6262

6363
int nextRotation(Rotation direction);
6464
std::pair<int, Rotation> getMostEfficientRotationTo(Rotation direction);
65+
std::string generateSaveFileName();
6566

6667
// ------------------------------------------------
6768

source/Kaixo/SpectralRotator/Processing/FileHandler.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,23 @@ namespace Kaixo::Processing {
231231

232232
// ------------------------------------------------
233233

234+
std::string FileHandler::generateSaveFileName() {
235+
std::string originalFilename = rotations[d000f].path.stem().string();
236+
switch (currentRotation) {
237+
case d000f: return originalFilename;
238+
case d000r: return originalFilename + "-reversed";
239+
case d090f: return originalFilename + "-90";
240+
case d180f: return originalFilename + "-180";
241+
case d270f: return originalFilename + "-270";
242+
case d090r: return originalFilename + "-90-reversed";
243+
case d180r: return originalFilename + "-flipped";
244+
case d270r: return originalFilename + "-270-reversed";
245+
}
246+
return originalFilename + "-rotated";
247+
}
248+
249+
// ------------------------------------------------
250+
234251
}
235252

236253
// ------------------------------------------------

source/Kaixo/SpectralRotator/Processing/Interfaces.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace Kaixo::Processing {
1919
switch (settings.index) {
2020
case 1:
2121
if (processor.rotatedFile.file() == nullptr) return;
22-
processor.rotatedFile.file()->save(processor.inputFile.file()->path.stem().string());
22+
processor.rotatedFile.file()->save(processor.rotatedFile.generateSaveFileName());
2323
break;
2424
}
2525
}

source/Kaixo/Utils/AudioFile.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ namespace Kaixo {
3636
std::stringstream datetime{};
3737
datetime << std::put_time(std::localtime(&in_time_t), "%Y%m%d-%H%M%S");
3838

39-
auto name = filename + "-rotated-" + datetime.str() + ".wav";
39+
auto name = filename + "-" + datetime.str() + ".wav";
4040

4141
path = generationLocation() / name;
4242
write(path);

0 commit comments

Comments
 (0)