diff --git a/include/FluidCLIWrapper.hpp b/include/FluidCLIWrapper.hpp index dc5e121..2becd8f 100644 --- a/include/FluidCLIWrapper.hpp +++ b/include/FluidCLIWrapper.hpp @@ -18,10 +18,12 @@ under the European Union’s Horizon 2020 research and innovation programme #include #include #include +#include #include #include #include #include +#include #include #include @@ -388,20 +390,45 @@ class CLIWrapper params.constrainParameterValues(); // Create client after all parameters are set - FluidContext context; + // Create client after all parameters are set ClientType client(params); - auto result = client.process(context); + Result result; + + client.enqueue(params); + result = client.process(); + + double progress = 0.0; // Variable to store progress + + while(result.ok()) + { + ProcessState state = client.checkProgress(result); + + if (state == ProcessState::kDone || state == ProcessState::kDoneStillProcessing) { + std::cout << '\n'; + break; + } + if (state != ProcessState::kDone) { + double newProgress = client.progress(); + if (newProgress - progress >=0.01) + { + std::cout << newProgress << '\r' << std::flush; + + progress = newProgress; + } + using namespace std::chrono_literals; + std::this_thread::sleep_for(20ms); + continue; + } + } if (!result.ok()) { // Output error - std::cerr << result.message() << "\n"; } else { // Write files - bool allowCSV = true; params.template forEachParamType(allowCSV); } @@ -412,3 +439,5 @@ class CLIWrapper } // namespace client } // namespace fluid + + diff --git a/src/fluid-ampgate/fluid-ampgate.cpp b/src/fluid-ampgate/fluid-ampgate.cpp index 2f352fd..7038a51 100644 --- a/src/fluid-ampgate/fluid-ampgate.cpp +++ b/src/fluid-ampgate/fluid-ampgate.cpp @@ -15,5 +15,5 @@ under the European Union’s Horizon 2020 research and innovation programme int main(int argc, const char* argv[]) { using namespace fluid::client; - return CLIWrapper::run(argc, argv); + return CLIWrapper::run(argc, argv); } diff --git a/src/fluid-ampslice/fluid-ampslice.cpp b/src/fluid-ampslice/fluid-ampslice.cpp index 1ea36a6..4cb80e5 100644 --- a/src/fluid-ampslice/fluid-ampslice.cpp +++ b/src/fluid-ampslice/fluid-ampslice.cpp @@ -15,5 +15,5 @@ under the European Union’s Horizon 2020 research and innovation programme int main(int argc, const char* argv[]) { using namespace fluid::client; - return CLIWrapper::run(argc, argv); + return CLIWrapper::run(argc, argv); } diff --git a/src/fluid-hpss/fluid-hpss.cpp b/src/fluid-hpss/fluid-hpss.cpp index bcb222a..7948ac6 100644 --- a/src/fluid-hpss/fluid-hpss.cpp +++ b/src/fluid-hpss/fluid-hpss.cpp @@ -15,5 +15,5 @@ under the European Union’s Horizon 2020 research and innovation programme int main(int argc, const char* argv[]) { using namespace fluid::client; - return CLIWrapper::run(argc, argv); + return CLIWrapper::run(argc, argv); } diff --git a/src/fluid-loudness/fluid-loudness.cpp b/src/fluid-loudness/fluid-loudness.cpp index fb4e377..3613740 100644 --- a/src/fluid-loudness/fluid-loudness.cpp +++ b/src/fluid-loudness/fluid-loudness.cpp @@ -15,5 +15,5 @@ under the European Union’s Horizon 2020 research and innovation programme int main(int argc, const char* argv[]) { using namespace fluid::client; - return CLIWrapper::run(argc, argv); + return CLIWrapper::run(argc, argv); } diff --git a/src/fluid-melbands/fluid-melbands.cpp b/src/fluid-melbands/fluid-melbands.cpp index efee1ca..924cafc 100644 --- a/src/fluid-melbands/fluid-melbands.cpp +++ b/src/fluid-melbands/fluid-melbands.cpp @@ -15,5 +15,5 @@ under the European Union’s Horizon 2020 research and innovation programme int main(int argc, const char* argv[]) { using namespace fluid::client; - return CLIWrapper::run(argc, argv); + return CLIWrapper::run(argc, argv); } diff --git a/src/fluid-mfcc/fluid-mfcc.cpp b/src/fluid-mfcc/fluid-mfcc.cpp index 626a192..a3db83c 100644 --- a/src/fluid-mfcc/fluid-mfcc.cpp +++ b/src/fluid-mfcc/fluid-mfcc.cpp @@ -15,5 +15,5 @@ under the European Union’s Horizon 2020 research and innovation programme int main(int argc, const char* argv[]) { using namespace fluid::client; - return CLIWrapper::run(argc, argv); + return CLIWrapper::run(argc, argv); } diff --git a/src/fluid-nmf/fluid-nmf.cpp b/src/fluid-nmf/fluid-nmf.cpp index e4df212..46bdee4 100644 --- a/src/fluid-nmf/fluid-nmf.cpp +++ b/src/fluid-nmf/fluid-nmf.cpp @@ -15,5 +15,5 @@ under the European Union’s Horizon 2020 research and innovation programme int main(int argc, const char* argv[]) { using namespace fluid::client; - return CLIWrapper::run(argc, argv); + return CLIWrapper::run(argc, argv); } diff --git a/src/fluid-noveltyslice/fluid-noveltyslice.cpp b/src/fluid-noveltyslice/fluid-noveltyslice.cpp index f1fbe9c..ac230d6 100644 --- a/src/fluid-noveltyslice/fluid-noveltyslice.cpp +++ b/src/fluid-noveltyslice/fluid-noveltyslice.cpp @@ -15,5 +15,5 @@ under the European Union’s Horizon 2020 research and innovation programme int main(int argc, const char* argv[]) { using namespace fluid::client; - return CLIWrapper::run(argc, argv); + return CLIWrapper::run(argc, argv); } diff --git a/src/fluid-onsetslice/fluid-onsetslice.cpp b/src/fluid-onsetslice/fluid-onsetslice.cpp index ad48680..e86efe8 100644 --- a/src/fluid-onsetslice/fluid-onsetslice.cpp +++ b/src/fluid-onsetslice/fluid-onsetslice.cpp @@ -15,5 +15,5 @@ under the European Union’s Horizon 2020 research and innovation programme int main(int argc, const char* argv[]) { using namespace fluid::client; - return CLIWrapper::run(argc, argv); + return CLIWrapper::run(argc, argv); } diff --git a/src/fluid-pitch/fluid-pitch.cpp b/src/fluid-pitch/fluid-pitch.cpp index 48c3805..95e6238 100644 --- a/src/fluid-pitch/fluid-pitch.cpp +++ b/src/fluid-pitch/fluid-pitch.cpp @@ -15,5 +15,5 @@ under the European Union’s Horizon 2020 research and innovation programme int main(int argc, const char* argv[]) { using namespace fluid::client; - return CLIWrapper::run(argc, argv); + return CLIWrapper::run(argc, argv); } diff --git a/src/fluid-sines/fluid-sines.cpp b/src/fluid-sines/fluid-sines.cpp index 8b30ddb..9103db2 100644 --- a/src/fluid-sines/fluid-sines.cpp +++ b/src/fluid-sines/fluid-sines.cpp @@ -15,5 +15,5 @@ under the European Union’s Horizon 2020 research and innovation programme int main(int argc, const char* argv[]) { using namespace fluid::client; - return CLIWrapper::run(argc, argv); + return CLIWrapper::run(argc, argv); } diff --git a/src/fluid-spectralshape/fluid-spectralshape.cpp b/src/fluid-spectralshape/fluid-spectralshape.cpp index 29ef9e0..72ec0b5 100644 --- a/src/fluid-spectralshape/fluid-spectralshape.cpp +++ b/src/fluid-spectralshape/fluid-spectralshape.cpp @@ -15,5 +15,5 @@ under the European Union’s Horizon 2020 research and innovation programme int main(int argc, const char* argv[]) { using namespace fluid::client; - return CLIWrapper::run(argc, argv); + return CLIWrapper::run(argc, argv); } diff --git a/src/fluid-stats/fluid-stats.cpp b/src/fluid-stats/fluid-stats.cpp index 1ef2e61..a3df25a 100644 --- a/src/fluid-stats/fluid-stats.cpp +++ b/src/fluid-stats/fluid-stats.cpp @@ -15,5 +15,5 @@ under the European Union’s Horizon 2020 research and innovation programme int main(int argc, const char* argv[]) { using namespace fluid::client; - return CLIWrapper::run(argc, argv); + return CLIWrapper::run(argc, argv); } diff --git a/src/fluid-transients/fluid-transients.cpp b/src/fluid-transients/fluid-transients.cpp index 05f9529..b61d682 100644 --- a/src/fluid-transients/fluid-transients.cpp +++ b/src/fluid-transients/fluid-transients.cpp @@ -15,5 +15,5 @@ under the European Union’s Horizon 2020 research and innovation programme int main(int argc, const char* argv[]) { using namespace fluid::client; - return CLIWrapper::run(argc, argv); + return CLIWrapper::run(argc, argv); } diff --git a/src/fluid-transientslice/fluid-transientslice.cpp b/src/fluid-transientslice/fluid-transientslice.cpp index 3d8f97a..b76019a 100644 --- a/src/fluid-transientslice/fluid-transientslice.cpp +++ b/src/fluid-transientslice/fluid-transientslice.cpp @@ -15,5 +15,7 @@ under the European Union’s Horizon 2020 research and innovation programme int main(int argc, const char* argv[]) { using namespace fluid::client; - return CLIWrapper::run(argc, argv); + // return CLIWrapper::run(argc, argv); + return CLIWrapper::run(argc, argv); + }