diff options
author | lonkaars <loek@pipeframe.xyz> | 2023-05-30 15:13:18 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2023-05-30 15:13:18 +0200 |
commit | e346087f316e112a8af9494be13bfff188f3cc0b (patch) | |
tree | 67342a97434bfe8481c305fea6495c7ff1474454 /os2eindopdracht/main.cpp | |
parent | afa02662b185f62644b1e44a55820ded1e703fd2 (diff) |
file copy working
Diffstat (limited to 'os2eindopdracht/main.cpp')
-rw-r--r-- | os2eindopdracht/main.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/os2eindopdracht/main.cpp b/os2eindopdracht/main.cpp index 2e96abe..291361e 100644 --- a/os2eindopdracht/main.cpp +++ b/os2eindopdracht/main.cpp @@ -1,4 +1,7 @@ #include <cstdio> +#include <iostream> +#include <sstream> +#include <fstream> #include "Arguments.h" #include "SampleStream.h" @@ -7,11 +10,23 @@ int main(int argc, char** argv) { Arguments args(argc, argv); + std::fstream file_input(args.file_input, std::ios::in | std::ios::binary); + std::stringstream file_input_content; + file_input_content << file_input.rdbuf(); + file_input.close(); + + SampleStream stream(file_input_content.str()); + printf("max_threads: %i\n", args.max_threads); printf("gain_bass: %+i\n", args.gain_bass); printf("gain_treble: %+i\n", args.gain_treble); printf("input filename: \"%s\"\n", args.file_input.c_str()); printf("output filename: \"%s\"\n", args.file_output.c_str()); + std::fstream file_output(args.file_output, std::ios::out | std::ios::binary); + std::string edited_stream = stream.save(); + file_output.write(edited_stream.c_str(), edited_stream.size()); + file_output.close(); + return 0; } |