From e346087f316e112a8af9494be13bfff188f3cc0b Mon Sep 17 00:00:00 2001 From: lonkaars Date: Tue, 30 May 2023 15:13:18 +0200 Subject: file copy working --- os2eindopdracht/main.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'os2eindopdracht/main.cpp') 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 +#include +#include +#include #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; } -- cgit v1.2.3