From 16c74ab829d8ebc664eacee974b8eed5cb9888e2 Mon Sep 17 00:00:00 2001 From: Marek Blok <marek.blok@pg.edu.pl> Date: Tue, 6 Apr 2021 11:39:45 +0200 Subject: [PATCH] DSP::E_LS_Mode => DSP::e::LogState --- CHANGELOG | 6 +- examples/asynchronous.cpp | 6 +- examples/callbacks.cpp | 4 +- examples/echo.cpp | 6 +- examples/hello.cpp | 6 +- examples/macro_example.cpp | 4 +- examples/multirate.cpp | 2 +- examples/socket_client.cpp | 4 +- examples/socket_client_2.cpp | 2 +- examples/socket_server.cpp | 4 +- examples/socket_server_2.cpp | 4 +- src/Main.cpp | 76 ++++----- src/cpp/DSP_AudioMixer.cpp | 100 ++++++------ src/cpp/DSP_DOT.cpp | 14 +- src/cpp/DSP_Fourier.cpp | 6 +- src/cpp/DSP_IO.cpp | 178 ++++++++++----------- src/cpp/DSP_clocks.cpp | 60 +++---- src/cpp/DSP_logstream.cpp | 135 ++++++++-------- src/cpp/DSP_misc.cpp | 16 +- src/cpp/DSP_modules.cpp | 302 +++++++++++++++++------------------ src/cpp/DSP_modules2.cpp | 22 +-- src/cpp/DSP_sockets.cpp | 100 ++++++------ src/include/DSP_lib.h | 12 +- src/include/DSP_logstream.h | 85 +++++----- src/include/DSP_modules.h | 10 +- 25 files changed, 589 insertions(+), 575 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 7174533..fb5277e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -5,9 +5,13 @@ TODO:: unsigned long SamplingRate // -1 => 0 LAST DONE: - - corrections in linux compilation CHANGES: +- ver. 0.20.003 - <b>2021.04.06</b> Changed: + - DSP::E_LS_Mode => DSP::e::LogState + - DSP::LogMode => DSP::e::LogMode + - corrections in linux compilation + - ver. 0.20.001 - <b>2021.04.03</b> Changed: - DSP_libver, DSP_lib_version and DSP_lib_version_string moved int o DSP:: namespace: DSP::libver, DSP::lib_version and DSP::lib_version_string - moved enums into DSP::e:: namespace: DSPe_* => DSP::e::* diff --git a/examples/asynchronous.cpp b/examples/asynchronous.cpp index 0cdd897..d1f8f05 100644 --- a/examples/asynchronous.cpp +++ b/examples/asynchronous.cpp @@ -13,7 +13,7 @@ int main(void) int temp; long int Fp; - DSP::log.SetLogState(DSP::E_LS_Mode::LS_console | DSP::E_LS_Mode::LS_file); + DSP::log.SetLogState(DSP::e::LogState::console | DSP::e::LogState::file); DSP::log.SetLogFileName("log_file.log"); DSP::log << DSP::lib_version_string() << endl << endl; @@ -69,7 +69,7 @@ int main(void) { DSP::Clock::Execute(MasterClock, Fp/8); - DSP::log << "MAIN" << DSP::LogMode::second << temp << endl; + DSP::log << "MAIN" << DSP::e::LogMode::second << temp << endl; temp++; } while (AudioIn.GetBytesRead() != 0); @@ -77,7 +77,7 @@ int main(void) DSP::Clock::Execute(MasterClock, Fp/8); DSP::Clock::FreeClocks(); - DSP::log << "MAIN" << DSP::LogMode::second << "end" << endl; + DSP::log << "MAIN" << DSP::e::LogMode::second << "end" << endl; return 0; } diff --git a/examples/callbacks.cpp b/examples/callbacks.cpp index 74bef52..2365f2a 100644 --- a/examples/callbacks.cpp +++ b/examples/callbacks.cpp @@ -119,7 +119,7 @@ int main(void) { DSP::Clock::Execute(MasterClock, Fp/8); - DSP::log << "MAIN" << DSP::LogMode::second << temp << endl; + DSP::log << "MAIN" << DSP::e::LogMode::second << temp << endl; temp++; } while (AudioIn->GetBytesRead() != 0); @@ -136,7 +136,7 @@ int main(void) DSP::Clock::ListOfAllComponents(); DSP::Clock::FreeClocks(); - DSP::log << "MAIN" << DSP::LogMode::second << "end" << endl; + DSP::log << "MAIN" << DSP::e::LogMode::second << "end" << endl; return 0; } diff --git a/examples/echo.cpp b/examples/echo.cpp index 5aa47c9..ffb1d29 100644 --- a/examples/echo.cpp +++ b/examples/echo.cpp @@ -16,7 +16,7 @@ int main(void) DSP::log << DSP::lib_version_string() << endl; DSP::log << endl; - DSP::log << "Hello" << DSP::LogMode::second << "This is echo !!!" << endl; + DSP::log << "Hello" << DSP::e::LogMode::second << "This is echo !!!" << endl; MasterClock=DSP::Clock::CreateMasterClock(); @@ -47,7 +47,7 @@ int main(void) { DSP::Clock::Execute(MasterClock, Fp/8); - DSP::log << "MAIN" << DSP::LogMode::second << temp << endl; + DSP::log << "MAIN" << DSP::e::LogMode::second << temp << endl; if (AudioIn.GetBytesRead() == 0) temp++; @@ -55,7 +55,7 @@ int main(void) while (temp < 30); DSP::Clock::FreeClocks(); - DSP::log << "MAIN" << DSP::LogMode::second << "end" << endl << DSP::LogMode::Error << endl; + DSP::log << "MAIN" << DSP::e::LogMode::second << "end" << endl << DSP::e::LogMode::Error << endl; return 0; } diff --git a/examples/hello.cpp b/examples/hello.cpp index f837a11..824ced6 100644 --- a/examples/hello.cpp +++ b/examples/hello.cpp @@ -21,7 +21,7 @@ int test_hello(void) DSP::log.SetLogFileName("log_file.log"); DSP::log << DSP::lib_version_string() << endl << endl; - DSP::log << "Hello" << DSP::LogMode::second << "World !!!" << endl; + DSP::log << "Hello" << DSP::e::LogMode::second << "World !!!" << endl; MasterClock=DSP::Clock::CreateMasterClock(); @@ -40,13 +40,13 @@ int test_hello(void) { DSP::Clock::Execute(MasterClock, Fp/8); - DSP::log << "MAIN" << DSP::LogMode::second << temp << endl; + DSP::log << "MAIN" << DSP::e::LogMode::second << temp << endl; temp++; } while (AudioIn.GetBytesRead() != 0); DSP::Clock::FreeClocks(); - DSP::log << DSP::LogMode::Error << "MAIN" << DSP::LogMode::second << "end" << endl; + DSP::log << DSP::e::LogMode::Error << "MAIN" << DSP::e::LogMode::second << "end" << endl; return 0; } diff --git a/examples/macro_example.cpp b/examples/macro_example.cpp index f5f1780..ea66e7a 100644 --- a/examples/macro_example.cpp +++ b/examples/macro_example.cpp @@ -91,13 +91,13 @@ int main(void) { DSP::Clock::Execute(MasterClock, Fp/8); - DSP::log << "MAIN" << DSP::LogMode::second << temp << endl; + DSP::log << "MAIN" << DSP::e::LogMode::second << temp << endl; temp++; } while (AudioIn.GetBytesRead() != 0); DSP::Clock::FreeClocks(); - DSP::log << "MAIN" << DSP::LogMode::second << "end" << endl; + DSP::log << "MAIN" << DSP::e::LogMode::second << "end" << endl; return 0; } diff --git a/examples/multirate.cpp b/examples/multirate.cpp index b9bc9d9..feebfb0 100644 --- a/examples/multirate.cpp +++ b/examples/multirate.cpp @@ -86,7 +86,7 @@ int main(int argn, char *args[]) if (Fp1 != 22050) { - DSP::log << DSP::LogMode::Error << "Input wave file's sampling rate must be 22050 Sa/s" << endl; + DSP::log << DSP::e::LogMode::Error << "Input wave file's sampling rate must be 22050 Sa/s" << endl; blocks["SoundIn"].reset(); return 1; diff --git a/examples/socket_client.cpp b/examples/socket_client.cpp index ef3fed0..b14b822 100644 --- a/examples/socket_client.cpp +++ b/examples/socket_client.cpp @@ -41,13 +41,13 @@ int main(void) { DSP::Clock::Execute(MasterClock, Fp/8); - DSP::log << "MAIN" << DSP::LogMode::second << temp << endl; + DSP::log << "MAIN" << DSP::e::LogMode::second << temp << endl; temp++; } while (in_socket.GetBytesRead() != 0); DSP::Clock::FreeClocks(); - DSP::log << DSP::LogMode::Error << "MAIN" << DSP::LogMode::second << "end" << endl; + DSP::log << DSP::e::LogMode::Error << "MAIN" << DSP::e::LogMode::second << "end" << endl; return 0; } diff --git a/examples/socket_client_2.cpp b/examples/socket_client_2.cpp index 9b1402b..5df1874 100644 --- a/examples/socket_client_2.cpp +++ b/examples/socket_client_2.cpp @@ -59,7 +59,7 @@ int main(void) { DSP::Clock::Execute(MasterClock, Fp1/4); - DSP::log << "MAIN" << DSP::LogMode::second << temp + DSP::log << "MAIN" << DSP::e::LogMode::second << temp << " (" << in_socket.GetBytesRead() << ")" << endl; temp++; } diff --git a/examples/socket_server.cpp b/examples/socket_server.cpp index 8ce0769..d816e75 100644 --- a/examples/socket_server.cpp +++ b/examples/socket_server.cpp @@ -53,13 +53,13 @@ int main(void) { DSP::Clock::Execute(MasterClock, Fp/8); - DSP::log << "MAIN" << DSP::LogMode::second << temp << endl; + DSP::log << "MAIN" << DSP::e::LogMode::second << temp << endl; temp++; } while (temp < 100); //(AudioIn.GetBytesRead() != 0); DSP::Clock::FreeClocks(); - DSP::log << DSP::LogMode::Error << "MAIN" << DSP::LogMode::second << "end" << endl; + DSP::log << DSP::e::LogMode::Error << "MAIN" << DSP::e::LogMode::second << "end" << endl; //! \bug socket will be closed at application finish not at processing end return 0; diff --git a/examples/socket_server_2.cpp b/examples/socket_server_2.cpp index 3ba2d74..767e36f 100644 --- a/examples/socket_server_2.cpp +++ b/examples/socket_server_2.cpp @@ -62,14 +62,14 @@ int main(void) { DSP::Clock::Execute(MasterClock, Fp/8); - DSP::log << "MAIN" << DSP::LogMode::second << temp << endl; + DSP::log << "MAIN" << DSP::e::LogMode::second << temp << endl; temp++; } while (temp < 200); //(AudioIn.GetBytesRead() != 0); DSP::Clock::FreeClocks(); - DSP::log << DSP::LogMode::Error << "MAIN" << DSP::LogMode::second << "end" << endl; + DSP::log << DSP::e::LogMode::Error << "MAIN" << DSP::e::LogMode::second << "end" << endl; //! \bug socket will be closed at application finish not at processing end return 0; diff --git a/src/Main.cpp b/src/Main.cpp index bb92e51..213ccee 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -837,7 +837,7 @@ void Process(long int Fs, const string &WaveName, const string &Dir) DSP::Clock::FreeClocks(); - DSP::log << "MAIN" << DSP::LogMode::second << "(" << czas1-czas0 << " ms" + DSP::log << "MAIN" << DSP::e::LogMode::second << "(" << czas1-czas0 << " ms" << " + " << czas2-czas1 << " ms)" << endl; // todo: DSP::u::CCPC instead of DSP::u::ABS + DSP::u::Angle } @@ -1034,7 +1034,7 @@ int test_3() DSP::Clock::FreeClocks(); -// DSP::log << DSP::LogMode::Error << "Koniec"); +// DSP::log << DSP::e::LogMode::Error << "Koniec"); return 0; } @@ -1213,7 +1213,7 @@ int test_4() /*************************************************************/ L1=(int)(Fp1/Fb); - DSP::log << "MAIN" << DSP::LogMode::second << "L1=" << L1 << " (Fp1=" << std::setprecision(1) << Fp1 << "Hz)" << endl; + DSP::log << "MAIN" << DSP::e::LogMode::second << "L1=" << L1 << " (Fp1=" << std::setprecision(1) << Fp1 << "Hz)" << endl; int M2=5; @@ -1257,7 +1257,7 @@ int test_4() /*************************************************************/ L2=(int)(Fp2/Fb); sprintf(tekst, "L2=%i (Fp2=%.1fHz)", L2, Fp2); - DSP::log << "MAIN" << DSP::LogMode::second << tekst << endl; + DSP::log << "MAIN" << DSP::e::LogMode::second << tekst << endl; /*************************************************************/ // automatic gain control @@ -1462,7 +1462,7 @@ int test_4() elapsed_time, float(500.0*(ind+1)/elapsed_time/1000), Fp1/1000, GardnerSampling.GetSamplingPeriod()); // PilotAGC.GetPower(), (Fo-Band/2)-pilot_DCO.GetFrequency(Fp1)); - DSP::log << "MAIN" << DSP::LogMode::second << tekst << endl; + DSP::log << "MAIN" << DSP::e::LogMode::second << tekst << endl; #ifdef WIN32 MSG temp_msg; @@ -1491,7 +1491,7 @@ int test_4() } DSP::Clock::FreeClocks(); - DSP::log << DSP::LogMode::Error << "MAIN" << DSP::LogMode::second << "Finished" << endl; + DSP::log << DSP::e::LogMode::Error << "MAIN" << DSP::e::LogMode::second << "Finished" << endl; return 0; } @@ -1545,10 +1545,10 @@ DSP::u::Addition Sum; for (int temp=0; temp<40; temp++) { DSP::Clock::Execute(MasterClock, Fp/8); - DSP::log << "MAIN" << DSP::LogMode::second << temp << endl; + DSP::log << "MAIN" << DSP::e::LogMode::second << temp << endl; } - DSP::log << DSP::LogMode::Error << "MAIN" << DSP::LogMode::second << "end" << endl; + DSP::log << DSP::e::LogMode::Error << "MAIN" << DSP::e::LogMode::second << "end" << endl; DSP::Clock::FreeClocks(); return 0; @@ -1593,7 +1593,7 @@ int test_6() delete tester; delete const_; - DSP::log << DSP::LogMode::Error << "MAIN" << DSP::LogMode::second << "end" << endl; + DSP::log << DSP::e::LogMode::Error << "MAIN" << DSP::e::LogMode::second << "end" << endl; DSP::Clock::FreeClocks(); return 0; @@ -1701,7 +1701,7 @@ int test_7() { DSP::Clock::Execute(MasterClock, Fp/8); - DSP::log << "MAIN" << DSP::LogMode::second << temp << endl; + DSP::log << "MAIN" << DSP::e::LogMode::second << temp << endl; temp++; } while (AudioIn->GetBytesRead() != 0); @@ -1715,7 +1715,7 @@ int test_7() DSP::Clock::ListOfAllComponents(); DSP::Clock::FreeClocks(); - DSP::log << "MAIN" << DSP::LogMode::second << "end" << endl; + DSP::log << "MAIN" << DSP::e::LogMode::second << "end" << endl; return 0; } @@ -1884,7 +1884,7 @@ int test_9() int Fp1 = InputSignal.GetSamplingRate(); /*if (Fp1_tmp != Fp1) { - DSP::log << DSP::LogMode::Error << "Problem z sygna�em wej�ciowym"); + DSP::log << DSP::e::LogMode::Error << "Problem z sygna�em wej�ciowym"); } */ DSP::u::FIR H_sh(h_sh, 0, 1, L_IFIR); @@ -1960,7 +1960,7 @@ int test_10() N_C = coef_info.GetSize(0); if (N_C < 1) { - DSP::log << DSP::LogMode::Error << "No test.coef: aborting" << endl; + DSP::log << DSP::e::LogMode::Error << "No test.coef: aborting" << endl; return -1; } else @@ -2030,7 +2030,7 @@ int test_11() N_rc = coef_info.GetSize(0); if (N_rc < 1) { - DSP::log << DSP::LogMode::Error << "No cw5_zad1_h_rc.coef: aborting" << endl; + DSP::log << DSP::e::LogMode::Error << "No cw5_zad1_h_rc.coef: aborting" << endl; return -1; } else @@ -2321,7 +2321,7 @@ int test_12(void) { DSP::Clock::Execute(MasterClock, Fp/8); - DSP::log << "MAIN"<< DSP::LogMode::second << temp << endl; + DSP::log << "MAIN"<< DSP::e::LogMode::second << temp << endl; temp++; } while (AudioIn->GetBytesRead() != 0); @@ -2336,7 +2336,7 @@ int test_12(void) DSP::Clock::ListOfAllComponents(); DSP::Clock::FreeClocks(); - DSP::log << "MAIN" << DSP::LogMode::second << "end" << endl; + DSP::log << "MAIN" << DSP::e::LogMode::second << "end" << endl; return 0; } @@ -2393,7 +2393,7 @@ int test_SolveMatrix(int mode) { break; default: - DSP::log << "test_SolveMatrix" << DSP::LogMode::second << "unsupported mode" << endl; + DSP::log << "test_SolveMatrix" << DSP::e::LogMode::second << "unsupported mode" << endl; break; } { @@ -2480,7 +2480,7 @@ int test_SolveMatrix_prec(int mode) { break; default: - DSP::log << "test_SolveMatrix_prec" << DSP::LogMode::second << "unsupported mode" << endl; + DSP::log << "test_SolveMatrix_prec" << DSP::e::LogMode::second << "unsupported mode" << endl; break; } { @@ -2582,7 +2582,7 @@ int test_ZPSTC_cw_3() N_rc = coef_info.GetSize(0); if (N_rc < 1) { - DSP::log << DSP::LogMode::Error << "No cw3_zad3_h_rc.coef: aborting" << endl; + DSP::log << DSP::e::LogMode::Error << "No cw3_zad3_h_rc.coef: aborting" << endl; return -1; } else @@ -2596,7 +2596,7 @@ int test_ZPSTC_cw_3() N2 = coef_info.GetSize(0); if (N2 < 1) { - DSP::log << DSP::LogMode::Error << "No cw3_zad3_h2.coef: aborting" << endl; + DSP::log << DSP::e::LogMode::Error << "No cw3_zad3_h2.coef: aborting" << endl; return -1; } else @@ -2717,8 +2717,8 @@ int main(int argc, char*argv[]) DSP::log.SetLogFileName("DSPElib_test_log.txt"); DSP::log << "test DSP::log" << endl; - DSP::log << "test DSP::log(2)" << DSP::LogMode::second << "2" << endl; - DSP::log << DSP::LogMode::Error << "test DSP::log error" << endl; + DSP::log << "test DSP::log(2)" << DSP::e::LogMode::second << "2" << endl; + DSP::log << DSP::e::LogMode::Error << "test DSP::log error" << endl; DSP::log << "Starting SolveMatrix test" << endl; for (auto i=0; i<3; i++) { @@ -2728,67 +2728,67 @@ int main(int argc, char*argv[]) test_SolveMatrix_prec(i); } //! \TODO test also DSP::f::LPF_LS - DSP::log << DSP::LogMode::pause << "Finished SolveMatrix test" << endl; + DSP::log << DSP::e::LogMode::pause << "Finished SolveMatrix test" << endl; DSP::log << "Starting SymbolMapper test" << endl; test_SymbolMapper(); - DSP::log << DSP::LogMode::pause << "Finished SymbolMapper test" << endl; + DSP::log << DSP::e::LogMode::pause << "Finished SymbolMapper test" << endl; DSP::log << "Starting test_ZPSTC_cw_3" << endl; test_ZPSTC_cw_3(); - DSP::log << "Finished test_ZPSTC_cw_3" << DSP::LogMode::pause << endl; + DSP::log << "Finished test_ZPSTC_cw_3" << DSP::e::LogMode::pause << endl; #ifdef INCLUDE_DSPE_EXAMPLES DSP::log << "Starting test_hello" << endl; test_hello(); - DSP::log << DSP::LogMode::Error << "Finished test_hello" << endl; + DSP::log << DSP::e::LogMode::Error << "Finished test_hello" << endl; #endif // INCLUDE_DSPE_EXAMPLES DSP::log << "Starting test_1" << endl; test_1(argc, argv); - DSP::log << DSP::LogMode::pause << "Finished test_1" << endl; + DSP::log << DSP::e::LogMode::pause << "Finished test_1" << endl; DSP::log << "Starting test_2" << endl; test_2(); - DSP::log << DSP::LogMode::pause << "Finished test_2" << endl; + DSP::log << DSP::e::LogMode::pause << "Finished test_2" << endl; DSP::log << "Starting test_3" << endl; test_3(); - DSP::log << DSP::LogMode::pause << "Finished test_3" << endl; + DSP::log << DSP::e::LogMode::pause << "Finished test_3" << endl; DSP::log << "Starting test_4" << endl; test_4(); - DSP::log << DSP::LogMode::pause << "Finished test_4" << endl; + DSP::log << DSP::e::LogMode::pause << "Finished test_4" << endl; DSP::log << "Starting test_5" << endl; test_5(); - DSP::log << DSP::LogMode::pause << "Finished test_5" << endl; + DSP::log << DSP::e::LogMode::pause << "Finished test_5" << endl; DSP::log << "Starting test_6" << endl; test_6(); - DSP::log << DSP::LogMode::pause << "Finished test_6" << endl; + DSP::log << DSP::e::LogMode::pause << "Finished test_6" << endl; DSP::log << "Starting test_7" << endl; test_7(); - DSP::log << DSP::LogMode::pause << "Finished test_7" << endl; + DSP::log << DSP::e::LogMode::pause << "Finished test_7" << endl; DSP::log << "Starting test_8" << endl; test_8(); - DSP::log << DSP::LogMode::pause << "Finished test_8" << endl; + DSP::log << DSP::e::LogMode::pause << "Finished test_8" << endl; DSP::log << "Starting test_9" << endl; test_9(); - DSP::log << DSP::LogMode::pause << "Finished test_9" << endl; + DSP::log << DSP::e::LogMode::pause << "Finished test_9" << endl; DSP::log << "Starting test_10" << endl; test_10(); - DSP::log << DSP::LogMode::pause << "Finished test_10" << endl; + DSP::log << DSP::e::LogMode::pause << "Finished test_10" << endl; DSP::log << "Starting test_11" << endl; test_11(); - DSP::log << DSP::LogMode::pause << "Finished test_11" << endl; + DSP::log << DSP::e::LogMode::pause << "Finished test_11" << endl; DSP::log << "Starting test_12" << endl; test_12(); - DSP::log << DSP::LogMode::pause << "Finished test_12" << endl; + DSP::log << DSP::e::LogMode::pause << "Finished test_12" << endl; } diff --git a/src/cpp/DSP_AudioMixer.cpp b/src/cpp/DSP_AudioMixer.cpp index 10817ea..67acef7 100644 --- a/src/cpp/DSP_AudioMixer.cpp +++ b/src/cpp/DSP_AudioMixer.cpp @@ -99,7 +99,7 @@ TAudioMixer::TAudioMixer(UINT WaveInDevNo, UINT WaveOutDevNo) { #ifdef __DEBUG__ string tekst; - DSP::log << "TAudioMixer::TAudioMixer" << DSP::LogMode::second << "Mixer initialization start" << endl; + DSP::log << "TAudioMixer::TAudioMixer" << DSP::e::LogMode::second << "Mixer initialization start" << endl; #endif #ifdef WIN32 @@ -142,7 +142,7 @@ TAudioMixer::TAudioMixer(UINT WaveInDevNo, UINT WaveOutDevNo) #ifdef __DEBUG__ { - DSP::log << "TAudioMixer::TAudioMixer" << DSP::LogMode::second + DSP::log << "TAudioMixer::TAudioMixer" << DSP::e::LogMode::second << "No of mixer devices:" << to_string(MixersNumber) << ", No of WaveIn devices:" << to_string(WaveInNumber) << ", No of WaveOut devices:" << to_string(WaveOutNumber) << endl; @@ -168,7 +168,7 @@ TAudioMixer::TAudioMixer(UINT WaveInDevNo, UINT WaveOutDevNo) ss << setfill ('0') << setw(8) << hex << rs; tekst = "Opened mixer (MIXER_OBJECTF_WAVEIN (dev:" + to_string(WaveInDevNo) + "/" + to_string(WaveInNumber) + ")) / result:" + ss.str(); - DSP::log << "TAudioMixer::TAudioMixer" << DSP::LogMode::second << tekst << endl; + DSP::log << "TAudioMixer::TAudioMixer" << DSP::e::LogMode::second << tekst << endl; } #endif rs=mixerOpen(&hMixer_out, WaveOutDevNo, @@ -181,7 +181,7 @@ TAudioMixer::TAudioMixer(UINT WaveInDevNo, UINT WaveOutDevNo) ss << setfill ('0') << setw(8) << hex << rs; tekst = "Opened mixer (MIXER_OBJECTF_WAVEOUT (dev:" + to_string(WaveOutDevNo) + "/" + to_string(WaveOutNumber) + ")) / result:" + ss.str(); - DSP::log << "TAudioMixer::TAudioMixer" << DSP::LogMode::second << tekst << endl; + DSP::log << "TAudioMixer::TAudioMixer" << DSP::e::LogMode::second << tekst << endl; } #endif @@ -198,7 +198,7 @@ TAudioMixer::TAudioMixer(UINT WaveInDevNo, UINT WaveOutDevNo) stringstream ss; ss << setfill ('0') << setw(8) << hex << rs; tekst = "Input mixer name: \"" + Input_MixerName + "\" / result:" + ss.str(); - DSP::log << "TAudioMixer::TAudioMixer" << DSP::LogMode::second << tekst << endl; + DSP::log << "TAudioMixer::TAudioMixer" << DSP::e::LogMode::second << tekst << endl; } #endif //Get output Mixer name @@ -210,7 +210,7 @@ TAudioMixer::TAudioMixer(UINT WaveInDevNo, UINT WaveOutDevNo) stringstream ss; ss << setfill ('0') << setw(8) << hex << rs; tekst = "Output mixer name: \"" + Output_MixerName + "\" / result:" + ss.str(); - DSP::log << "TAudioMixer::TAudioMixer" << DSP::LogMode::second << tekst << endl; + DSP::log << "TAudioMixer::TAudioMixer" << DSP::e::LogMode::second << tekst << endl; } #endif @@ -226,7 +226,7 @@ TAudioMixer::TAudioMixer(UINT WaveInDevNo, UINT WaveOutDevNo) { //! \bug Problems might occur when there is no WAVEIN input device (MixerLineWAVEIN will be corrupt) #ifdef __DEBUG__ - DSP::log << "TAudioMixer::TAudioMixer" << DSP::LogMode::second << "No WAVEIN device found !!!" << endl; + DSP::log << "TAudioMixer::TAudioMixer" << DSP::e::LogMode::second << "No WAVEIN device found !!!" << endl; #endif MixerLineWAVEIN.cControls = 0; MixerLineWAVEIN.cConnections = 0; @@ -237,7 +237,7 @@ TAudioMixer::TAudioMixer(UINT WaveInDevNo, UINT WaveOutDevNo) stringstream ss; ss << setfill ('0') << setw(8) << hex << rs; tekst = "Got info about first WAVEIN destination line / result:" + ss.str(); - DSP::log << "TAudioMixer::TAudioMixer" << DSP::LogMode::second << tekst << endl; + DSP::log << "TAudioMixer::TAudioMixer" << DSP::e::LogMode::second << tekst << endl; } #endif @@ -265,7 +265,7 @@ TAudioMixer::TAudioMixer(UINT WaveInDevNo, UINT WaveOutDevNo) stringstream ss; ss << setfill ('0') << setw(8) << hex << rs; tekst = "Got master controls of first WAVEIN destination line / result:" + ss.str(); - DSP::log << "TAudioMixer::TAudioMixer" << DSP::LogMode::second << tekst << endl; + DSP::log << "TAudioMixer::TAudioMixer" << DSP::e::LogMode::second << tekst << endl; } #endif @@ -285,7 +285,7 @@ TAudioMixer::TAudioMixer(UINT WaveInDevNo, UINT WaveOutDevNo) ss << setfill ('0') << setw(8) << hex << rs; tekst = "Found master input mixer or multiplexer control (no " + to_string(ind) + ") / result: " + ss.str(); - DSP::log << "TAudioMixer::TAudioMixer" << DSP::LogMode::second << tekst << endl; + DSP::log << "TAudioMixer::TAudioMixer" << DSP::e::LogMode::second << tekst << endl; } #endif } @@ -299,7 +299,7 @@ TAudioMixer::TAudioMixer(UINT WaveInDevNo, UINT WaveOutDevNo) ss << setfill ('0') << setw(8) << hex << rs; tekst = "Found master input volume control (no " + to_string(ind) + ") / result: " + ss.str(); - DSP::log << "TAudioMixer::TAudioMixer" << DSP::LogMode::second << tekst << endl; + DSP::log << "TAudioMixer::TAudioMixer" << DSP::e::LogMode::second << tekst << endl; } #endif //break; @@ -314,7 +314,7 @@ TAudioMixer::TAudioMixer(UINT WaveInDevNo, UINT WaveOutDevNo) ss << setfill ('0') << setw(8) << hex << rs; tekst = "Found master input mute control (no " + to_string(ind) + ") / result: " + ss.str(); - DSP::log << "TAudioMixer::TAudioMixer" << DSP::LogMode::second << tekst << endl; + DSP::log << "TAudioMixer::TAudioMixer" << DSP::e::LogMode::second << tekst << endl; } #endif //break; @@ -327,7 +327,7 @@ TAudioMixer::TAudioMixer(UINT WaveInDevNo, UINT WaveOutDevNo) if (InputMixer_support==true) { // Card supports global MIXER or MULTIPLEXER for input lines #ifdef __DEBUG__ - DSP::log << "TAudioMixer::TAudioMixer" << DSP::LogMode::second << "InputMixer_support==true" << endl; + DSP::log << "TAudioMixer::TAudioMixer" << DSP::e::LogMode::second << "InputMixer_support==true" << endl; #endif Mixer_InputLinesNumber = MixerControlWAVEIN.cMultipleItems; @@ -345,7 +345,7 @@ TAudioMixer::TAudioMixer(UINT WaveInDevNo, UINT WaveOutDevNo) stringstream ss; ss << setfill ('0') << setw(8) << hex << rs; tekst = "Input mixer /multiplexer control info read (cChannels = 1) / result: " + ss.str(); - DSP::log << "TAudioMixer::TAudioMixer" << DSP::LogMode::second << tekst << endl; + DSP::log << "TAudioMixer::TAudioMixer" << DSP::e::LogMode::second << tekst << endl; } #endif if (rs != 0) @@ -357,7 +357,7 @@ TAudioMixer::TAudioMixer(UINT WaveInDevNo, UINT WaveOutDevNo) stringstream ss; ss << setfill ('0') << setw(8) << hex << rs; tekst = "Input mixer /multiplexer control info read (cChannels = 0) / result: " + ss.str(); - DSP::log << "TAudioMixer::TAudioMixer" << DSP::LogMode::second << tekst << endl; + DSP::log << "TAudioMixer::TAudioMixer" << DSP::e::LogMode::second << tekst << endl; } #endif } @@ -387,7 +387,7 @@ TAudioMixer::TAudioMixer(UINT WaveInDevNo, UINT WaveOutDevNo) ss << setfill ('0') << setw(8) << hex << rs; tekst = "Input mixer/multiplexer source line " + to_string(ind) + " info read / result: " + ss.str(); - DSP::log << "TAudioMixer::TAudioMixer" << DSP::LogMode::second << tekst << endl; + DSP::log << "TAudioMixer::TAudioMixer" << DSP::e::LogMode::second << tekst << endl; } #endif if (MixerLinesWAVEIN_MAXcChannels<MixerLinesWAVEIN[ind].cChannels) @@ -408,7 +408,7 @@ TAudioMixer::TAudioMixer(UINT WaveInDevNo, UINT WaveOutDevNo) ss << setfill ('0') << setw(8) << hex << rs; tekst = "Input mixer source line " + to_string(ind) + " controls info read / result: " + ss.str(); - DSP::log << "TAudioMixer::TAudioMixer" << DSP::LogMode::second << tekst << endl; + DSP::log << "TAudioMixer::TAudioMixer" << DSP::e::LogMode::second << tekst << endl; } #endif //Find control MIXERCONTROL_CONTROLTYPE_VOLUME and copy it @@ -427,7 +427,7 @@ TAudioMixer::TAudioMixer(UINT WaveInDevNo, UINT WaveOutDevNo) tekst = "Input mixer source line " + to_string(ind) + " volume control found (no " + to_string(ind_2) + ") / result: " + ss.str(); - DSP::log << "TAudioMixer::TAudioMixer" << DSP::LogMode::second << tekst << endl; + DSP::log << "TAudioMixer::TAudioMixer" << DSP::e::LogMode::second << tekst << endl; } #endif break; @@ -439,7 +439,7 @@ TAudioMixer::TAudioMixer(UINT WaveInDevNo, UINT WaveOutDevNo) { // Card does not support global MIXER or MULTIPLEXER for input lines // Each of input lines is controlled separately #ifdef __DEBUG__ - DSP::log << "TAudioMixer::TAudioMixer" << DSP::LogMode::second << "No input mixer/multiplexer device : processing source lines separately" << endl; + DSP::log << "TAudioMixer::TAudioMixer" << DSP::e::LogMode::second << "No input mixer/multiplexer device : processing source lines separately" << endl; #endif //Free memory @@ -465,7 +465,7 @@ TAudioMixer::TAudioMixer(UINT WaveInDevNo, UINT WaveOutDevNo) stringstream ss; ss << setfill ('0') << setw(8) << hex << rs; tekst = "Input source line " + to_string(ind) + " info read / result: " + ss.str(); - DSP::log << "TAudioMixer::TAudioMixer" << DSP::LogMode::second << tekst << endl; + DSP::log << "TAudioMixer::TAudioMixer" << DSP::e::LogMode::second << tekst << endl; } #endif @@ -508,7 +508,7 @@ TAudioMixer::TAudioMixer(UINT WaveInDevNo, UINT WaveOutDevNo) stringstream ss; ss << setfill ('0') << setw(8) << hex << rs; tekst = "Input mixer source line " + to_string(ind) + " controls info read / result: " + ss.str(); - DSP::log << "TAudioMixer::TAudioMixer" << DSP::LogMode::second << tekst << endl; + DSP::log << "TAudioMixer::TAudioMixer" << DSP::e::LogMode::second << tekst << endl; } #endif //Find control MIXERCONTROL_CONTROLTYPE_VOLUME and copy it @@ -528,7 +528,7 @@ TAudioMixer::TAudioMixer(UINT WaveInDevNo, UINT WaveOutDevNo) ss << setfill ('0') << setw(8) << hex << rs; tekst = "Found input mixer source line " + to_string(ind) + " volume control (no " + to_string(ind_2) + ") / result: " + ss.str(); - DSP::log << "TAudioMixer::TAudioMixer" << DSP::LogMode::second << tekst << endl; + DSP::log << "TAudioMixer::TAudioMixer" << DSP::e::LogMode::second << tekst << endl; } #endif //break; @@ -557,7 +557,7 @@ TAudioMixer::TAudioMixer(UINT WaveInDevNo, UINT WaveOutDevNo) ss << setfill ('0') << setw(8) << hex << rs; tekst = "Found input mixer source line " + to_string(ind) + " mute control (no " + to_string(ind_2) + ") / result: " + ss.str(); - DSP::log << "TAudioMixer::TAudioMixer" << DSP::LogMode::second << tekst << endl; + DSP::log << "TAudioMixer::TAudioMixer" << DSP::e::LogMode::second << tekst << endl; } #endif //break; @@ -591,7 +591,7 @@ TAudioMixer::TAudioMixer(UINT WaveInDevNo, UINT WaveOutDevNo) stringstream ss; ss << setfill ('0') << setw(8) << hex << rs; tekst = "Got output mixer device destination line " + to_string(ind) + " info / result: " + ss.str(); - DSP::log << "TAudioMixer::TAudioMixer" << DSP::LogMode::second << tekst << endl; + DSP::log << "TAudioMixer::TAudioMixer" << DSP::e::LogMode::second << tekst << endl; } #endif @@ -600,7 +600,7 @@ TAudioMixer::TAudioMixer(UINT WaveInDevNo, UINT WaveOutDevNo) MixerSupportedOUT=true; #ifdef __DEBUG__ tekst = "Found output mixer device SPEAKER destination line " + to_string(ind); - DSP::log << "TAudioMixer::TAudioMixer" << DSP::LogMode::second << tekst << endl; + DSP::log << "TAudioMixer::TAudioMixer" << DSP::e::LogMode::second << tekst << endl; #endif break; } @@ -609,7 +609,7 @@ TAudioMixer::TAudioMixer(UINT WaveInDevNo, UINT WaveOutDevNo) MixerSupportedOUT=true; #ifdef __DEBUG__ tekst = "Found output mixer device HEADPHONES destination line " + to_string(ind) + " (looking still for SPEAKER)"; - DSP::log << "TAudioMixer::TAudioMixer" << DSP::LogMode::second << tekst << endl; + DSP::log << "TAudioMixer::TAudioMixer" << DSP::e::LogMode::second << tekst << endl; #endif //break; } @@ -634,7 +634,7 @@ TAudioMixer::TAudioMixer(UINT WaveInDevNo, UINT WaveOutDevNo) stringstream ss; ss << setfill ('0') << setw(8) << hex << rs; tekst = "Got controls of main output mixer device destination line / result: " + ss.str(); - DSP::log << "TAudioMixer::TAudioMixer" << DSP::LogMode::second << tekst << endl; + DSP::log << "TAudioMixer::TAudioMixer" << DSP::e::LogMode::second << tekst << endl; } #endif @@ -648,7 +648,7 @@ TAudioMixer::TAudioMixer(UINT WaveInDevNo, UINT WaveOutDevNo) MixerSupportedOUT = true; #ifdef __DEBUG__ { - DSP::log << "TAudioMixer::TAudioMixer" << DSP::LogMode::second + DSP::log << "TAudioMixer::TAudioMixer" << DSP::e::LogMode::second << "Found main volume control (no " << ind << ") of output mixer device destination line / result: " << setfill ('0') << setw(8) << hex << rs << endl; @@ -668,7 +668,7 @@ TAudioMixer::TAudioMixer(UINT WaveInDevNo, UINT WaveOutDevNo) MixerSupportedOUT = true; #ifdef __DEBUG__ { - DSP::log << "TAudioMixer::TAudioMixer" << DSP::LogMode::second + DSP::log << "TAudioMixer::TAudioMixer" << DSP::e::LogMode::second << "Found main mute control (no " << ind << ") of output mixer device destination line / result: " << setfill ('0') << setw(8) << hex << rs << endl; } @@ -707,7 +707,7 @@ TAudioMixer::TAudioMixer(UINT WaveInDevNo, UINT WaveOutDevNo) ss << setfill ('0') << setw(8) << hex << rs; tekst = "Got info of output source line (no " + to_string(ind) + ") / result: " + ss.str(); - DSP::log << "TAudioMixer::TAudioMixer" << DSP::LogMode::second << tekst << endl; + DSP::log << "TAudioMixer::TAudioMixer" << DSP::e::LogMode::second << tekst << endl; } #endif @@ -726,7 +726,7 @@ TAudioMixer::TAudioMixer(UINT WaveInDevNo, UINT WaveOutDevNo) ss << setfill ('0') << setw(8) << hex << rs; tekst = "Got controls of output source line (no " + to_string(ind) + ") / result: " + ss.str(); - DSP::log << "TAudioMixer::TAudioMixer" << DSP::LogMode::second << tekst << endl; + DSP::log << "TAudioMixer::TAudioMixer" << DSP::e::LogMode::second << tekst << endl; } #endif //Find control MIXERCONTROL_CONTROLTYPE_VOLUME and copy it @@ -747,7 +747,7 @@ TAudioMixer::TAudioMixer(UINT WaveInDevNo, UINT WaveOutDevNo) tekst = "Found volume control (" + to_string(ind_2) + ") of output source line (no " + to_string(ind) + ") / result: " + ss.str(); - DSP::log << "TAudioMixer::TAudioMixer" << DSP::LogMode::second << tekst << endl; + DSP::log << "TAudioMixer::TAudioMixer" << DSP::e::LogMode::second << tekst << endl; } #endif //break; @@ -766,7 +766,7 @@ TAudioMixer::TAudioMixer(UINT WaveInDevNo, UINT WaveOutDevNo) tekst = "Found mute control (" + to_string(ind_2) + ") of output source line (no " + to_string(ind) + ") / result: " + ss.str(); - DSP::log << "TAudioMixer::TAudioMixer" << DSP::LogMode::second << tekst << endl; + DSP::log << "TAudioMixer::TAudioMixer" << DSP::e::LogMode::second << tekst << endl; } #endif //break; @@ -811,13 +811,13 @@ TAudioMixer::TAudioMixer(UINT WaveInDevNo, UINT WaveOutDevNo) Memorized_OUT_LinesVolumes.clear(); #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "TAudioMixer::TAudioMixer" << DSP::LogMode::second << "Not supported on this platform" << endl; + DSP::log << DSP::e::LogMode::Error << "TAudioMixer::TAudioMixer" << DSP::e::LogMode::second << "Not supported on this platform" << endl; #endif #endif #ifdef __DEBUG__ - DSP::log << "TAudioMixer::TAudioMixer" << DSP::LogMode::second << "Finished mixer configuration detection" << endl; + DSP::log << "TAudioMixer::TAudioMixer" << DSP::e::LogMode::second << "Finished mixer configuration detection" << endl; #endif // ************************************************ // @@ -827,15 +827,15 @@ TAudioMixer::TAudioMixer(UINT WaveInDevNo, UINT WaveOutDevNo) //TEST #ifdef __DEBUG__ - DSP::log << "TAudioMixer::TAudioMixer" << DSP::LogMode::second << "MemorizeMixerSettings_WAVEIN" << endl; + DSP::log << "TAudioMixer::TAudioMixer" << DSP::e::LogMode::second << "MemorizeMixerSettings_WAVEIN" << endl; #endif MemorizeMixerSettings_WAVEIN(); #ifdef __DEBUG__ - DSP::log << "TAudioMixer::TAudioMixer" << DSP::LogMode::second << "MemorizeMixerSettings_OUT" << endl; + DSP::log << "TAudioMixer::TAudioMixer" << DSP::e::LogMode::second << "MemorizeMixerSettings_OUT" << endl; #endif MemorizeMixerSettings_OUT(); #ifdef __DEBUG__ - DSP::log << "TAudioMixer::TAudioMixer" << DSP::LogMode::second << "Constructor finaly reached the end" << endl; + DSP::log << "TAudioMixer::TAudioMixer" << DSP::e::LogMode::second << "Constructor finaly reached the end" << endl; #endif } @@ -975,7 +975,7 @@ void TAudioMixer::MemorizeMixerSettings_WAVEIN(void) MixerSettingsMemorized_WAVEIN=false; #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "TAudioMixer::MemorizeMixerSettings_WAVEIN" << DSP::LogMode::second << "Not yet implemented on this platform" << endl; + DSP::log << DSP::e::LogMode::Error << "TAudioMixer::MemorizeMixerSettings_WAVEIN" << DSP::e::LogMode::second << "Not yet implemented on this platform" << endl; #endif #endif @@ -991,7 +991,7 @@ void TAudioMixer::ForgetMixerSettings_WAVEIN(void) #else #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "TAudioMixer::ForgetMixerSettings_WAVEIN" << DSP::LogMode::second << "Not yet implemented on this platform" << endl; + DSP::log << DSP::e::LogMode::Error << "TAudioMixer::ForgetMixerSettings_WAVEIN" << DSP::e::LogMode::second << "Not yet implemented on this platform" << endl; #endif #endif @@ -1070,7 +1070,7 @@ void TAudioMixer::RestoreMixerSettings_WAVEIN(void) #else #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "TAudioMixer::RestoreMixerSettings_WAVEIN" << DSP::LogMode::second << "Not yet implemented on this platform" << endl; + DSP::log << DSP::e::LogMode::Error << "TAudioMixer::RestoreMixerSettings_WAVEIN" << DSP::e::LogMode::second << "Not yet implemented on this platform" << endl; #endif #endif @@ -1084,24 +1084,24 @@ void TAudioMixer::MemorizeMixerSettings_OUT(void) //Master Line Controls #ifdef __DEBUG__ - DSP::log << "TAudioMixer::MemorizeMixerSettings_OUT" << DSP::LogMode::second << "Saving Master Line Controls State" << endl; + DSP::log << "TAudioMixer::MemorizeMixerSettings_OUT" << DSP::e::LogMode::second << "Saving Master Line Controls State" << endl; #endif Memorized_OUT_MasterState[0]=GetDestLineState(DSP::AM_MasterControl, 0); Memorized_OUT_MasterState[1]=GetDestLineState(DSP::AM_MasterControl, 1); #ifdef __DEBUG__ - DSP::log << "TAudioMixer::MemorizeMixerSettings_OUT" << DSP::LogMode::second << "Saving Master Line Controls Volume" << endl; + DSP::log << "TAudioMixer::MemorizeMixerSettings_OUT" << DSP::e::LogMode::second << "Saving Master Line Controls Volume" << endl; #endif Memorized_OUT_MasterVolume[0]=GetDestLineVolume(DSP::AM_MasterControl, 0); Memorized_OUT_MasterVolume[1]=GetDestLineVolume(DSP::AM_MasterControl, 1); //Master Line connections Controls #ifdef __DEBUG__ - DSP::log << "TAudioMixer::MemorizeMixerSettings_OUT" << DSP::LogMode::second << "Saving Master Line connections Controls" << endl; + DSP::log << "TAudioMixer::MemorizeMixerSettings_OUT" << DSP::e::LogMode::second << "Saving Master Line connections Controls" << endl; #endif ile = GetNumberOfDestLines(); #ifdef __DEBUG__ { - DSP::log << "TAudioMixer::MemorizeMixerSettings_OUT" << DSP::LogMode::second << "GetNumberOfDestLines() = " << ile << endl; + DSP::log << "TAudioMixer::MemorizeMixerSettings_OUT" << DSP::e::LogMode::second << "GetNumberOfDestLines() = " << ile << endl; } #endif Memorized_OUT_LinesStates.clear(); @@ -1113,21 +1113,21 @@ void TAudioMixer::MemorizeMixerSettings_OUT(void) { #ifdef __DEBUG__ { - DSP::log << "TAudioMixer::MemorizeMixerSettings_OUT" << DSP::LogMode::second << "Saving line #" << ind << " State" << endl; + DSP::log << "TAudioMixer::MemorizeMixerSettings_OUT" << DSP::e::LogMode::second << "Saving line #" << ind << " State" << endl; } #endif Memorized_OUT_LinesStates[ind*2+0]=GetDestLineState(ind, 0); Memorized_OUT_LinesStates[ind*2+1]=GetDestLineState(ind, 1); #ifdef __DEBUG__ { - DSP::log << "TAudioMixer::MemorizeMixerSettings_OUT" << DSP::LogMode::second << "Saving line #" << ind << " Volume" << endl; + DSP::log << "TAudioMixer::MemorizeMixerSettings_OUT" << DSP::e::LogMode::second << "Saving line #" << ind << " Volume" << endl; } #endif Memorized_OUT_LinesVolumes[ind*2+0]=GetDestLineVolume(ind, 0); Memorized_OUT_LinesVolumes[ind*2+1]=GetDestLineVolume(ind, 1); } #ifdef __DEBUG__ - DSP::log << "TAudioMixer::MemorizeMixerSettings_OUT" << DSP::LogMode::second << "Finished Saving Master Line connections Controls" << endl; + DSP::log << "TAudioMixer::MemorizeMixerSettings_OUT" << DSP::e::LogMode::second << "Finished Saving Master Line connections Controls" << endl; #endif } @@ -2435,7 +2435,7 @@ double TAudioMixer::GetDestLineVolume(int LineNo, int Channel) (void)Channel; // unused #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "TAudioMixer::GetDestLineVolume" << DSP::LogMode::second << "Not yet implemented on this platform" << endl; + DSP::log << DSP::e::LogMode::Error << "TAudioMixer::GetDestLineVolume" << DSP::e::LogMode::second << "Not yet implemented on this platform" << endl; #endif return -2.0; // NO CONTROLS @@ -2617,7 +2617,7 @@ const string TAudioMixer::GetMixerControlType(DWORD dwControlType) (void)dwControlType; // unused #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "TAudioMixer::GetMixerControlType" << DSP::LogMode::second << "Not yet implemented on this platform" << endl; + DSP::log << DSP::e::LogMode::Error << "TAudioMixer::GetMixerControlType" << DSP::e::LogMode::second << "Not yet implemented on this platform" << endl; #endif return NULL; diff --git a/src/cpp/DSP_DOT.cpp b/src/cpp/DSP_DOT.cpp index e5d4553..81f1646 100644 --- a/src/cpp/DSP_DOT.cpp +++ b/src/cpp/DSP_DOT.cpp @@ -495,7 +495,7 @@ void DSP::Component::ComponentToDOTfile(std::ofstream &dot_plik, if (component_index >= max_components_number) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::Component::ComponentToDOTfile" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::Component::ComponentToDOTfile" << DSP::e::LogMode::second << "max_components_number (" << (int)max_components_number << ") <= component_index (" << (int)component_index << ")" << endl; #endif @@ -906,7 +906,7 @@ void DSP::Component::ComponentToDOTfile(std::ofstream &dot_plik, else { // this should not happen - DSP::log << "DSP::Macro::MacroEdgesToDOTfile" << DSP::LogMode::second << "Nothing connected to the output block's input" << endl; + DSP::log << "DSP::Macro::MacroEdgesToDOTfile" << DSP::e::LogMode::second << "Nothing connected to the output block's input" << endl; } @@ -1050,7 +1050,7 @@ void DSP::Component::ComponentToDOTfile(std::ofstream &dot_plik, } if (current_output->Convert2Copy() != NULL) { // 2. Copy - DSP::log << "DSP::Macro::MacroInputEdgesToDOTfile" << DSP::LogMode::second << "Edge to Copy !!!" << endl; + DSP::log << "DSP::Macro::MacroInputEdgesToDOTfile" << DSP::e::LogMode::second << "Edge to Copy !!!" << endl; } // ++++++++++++++++++++++++++++++++++++++++++++++++++ // @@ -1058,7 +1058,7 @@ void DSP::Component::ComponentToDOTfile(std::ofstream &dot_plik, if (current_macro != NULL) { //! \todo edge to other macro - DSP::log << "DSP::Macro::MacroInputEdgesToDOTfile" << DSP::LogMode::second << "edge to other macro not implemented yet" << endl; + DSP::log << "DSP::Macro::MacroInputEdgesToDOTfile" << DSP::e::LogMode::second << "edge to other macro not implemented yet" << endl; } else { @@ -1326,7 +1326,7 @@ void DSP::Clock::SchemeToDOTfile(DSP::Clock_ptr ReferenceClock, const string &do // ********************************** // if (ReferenceClock==NULL) { - DSP::log << DSP::LogMode::Error << "DSP::Clock::SchemeToDOTfile" << DSP::LogMode::second << "NULL ReferenceClock" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::Clock::SchemeToDOTfile" << DSP::e::LogMode::second << "NULL ReferenceClock" << endl; return; } @@ -1369,7 +1369,7 @@ void DSP::Clock::SchemeToDOTfile(DSP::Clock_ptr ReferenceClock, const string &do DSP::Clock::GetAlgorithmClocks(ReferenceClock, ClocksList, true); #ifdef __DEBUG__ if (ClocksList.size() != DSP::Clock::GetNoOfClocks()) - DSP::log << DSP::LogMode::Error << "DSP::Clock::SchemeToDOTfile" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::Clock::SchemeToDOTfile" << DSP::e::LogMode::second << "wrong number of clocks in ClocksList" << endl; #endif // __DEBUG__ @@ -1643,7 +1643,7 @@ void DSP::Clock::SchemeToDOTfile(DSP::Clock_ptr ReferenceClock, const string &do if (component_index >= max_components_number) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::Clock::ClockNotificationsToDOTfile" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::Clock::ClockNotificationsToDOTfile" << DSP::e::LogMode::second << "max_components_number (" << max_components_number << ") <= component_index (" << component_index << ")" << endl; #endif diff --git a/src/cpp/DSP_Fourier.cpp b/src/cpp/DSP_Fourier.cpp index 25cfeb6..26299ea 100644 --- a/src/cpp/DSP_Fourier.cpp +++ b/src/cpp/DSP_Fourier.cpp @@ -271,7 +271,7 @@ void DSP::Fourier::absFFT(const unsigned long &N, DSP::Float_vector &abs_fft, co #ifdef __DEBUG__ if (fft.size() != probki.size()) { - DSP::log << DSP::LogMode::Error << "DSP::Fourier::absFFT" << DSP::LogMode::second << "fft.size() != probki.size()" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::Fourier::absFFT" << DSP::e::LogMode::second << "fft.size() != probki.size()" << endl; return; } #endif @@ -419,7 +419,7 @@ void DSP::Fourier::abs2FFT(const unsigned long &N, DSP::Float_vector &abs_fft, c #ifdef __DEBUG__ if (fft.size() != probki.size()) { - DSP::log << DSP::LogMode::Error << "DSP::Fourier::abs2FFT" << DSP::LogMode::second << "fft.size() != probki.size()" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::Fourier::abs2FFT" << DSP::e::LogMode::second << "fft.size() != probki.size()" << endl; return; } #endif @@ -983,7 +983,7 @@ void DSP::Fourier::DFT(const unsigned long &N, const DSP::Complex_vector &probki #ifdef __DEBUG__ if (probki_in.size() != probki_out.size()) { - DSP::log << DSP::LogMode::Error << "DSP::Fourier::DFT" << DSP::LogMode::second << "probki_in.size() != probki_out.size()" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::Fourier::DFT" << DSP::e::LogMode::second << "probki_in.size() != probki_out.size()" << endl; return; } #endif diff --git a/src/cpp/DSP_IO.cpp b/src/cpp/DSP_IO.cpp index 30ef1b1..88724c9 100644 --- a/src/cpp/DSP_IO.cpp +++ b/src/cpp/DSP_IO.cpp @@ -90,7 +90,7 @@ unsigned long DSP::f::ReadCoefficientsFromFile(DSP::Float_vector &Buffer, unsign #ifdef __DEBUG__ else { - DSP::log << DSP::LogMode::Error << "DSP::f::ReadCoefficientsFromFile" << DSP::LogMode::second << "ReadCoefficientsFromFile wrong offset" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::f::ReadCoefficientsFromFile" << DSP::e::LogMode::second << "ReadCoefficientsFromFile wrong offset" << endl; } #endif fclose(plik); @@ -174,7 +174,7 @@ unsigned long DSP::f::ReadCoefficientsFromFile(DSP::Complex_vector &Buffer, unsi #ifdef __DEBUG__ else { - DSP::log << DSP::LogMode::Error << "DSP::f::ReadCoefficientsFromFile" << DSP::LogMode::second << "ReadCoefficientsFromFile wrong offset" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::f::ReadCoefficientsFromFile" << DSP::e::LogMode::second << "ReadCoefficientsFromFile wrong offset" << endl; } #endif fclose(plik); @@ -374,7 +374,7 @@ DSP::u::FileInput::FileInput(DSP::Clock_ptr ParentClock, if (FILEtype == DSP::e::FileType::FT_raw) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::u::FileInput::FileInput" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::u::FileInput::FileInput" << DSP::e::LogMode::second << "Detection of no of channels is not supported for DSP::e::FileType::FT_raw (defaulting to 1 channels)" << endl; NoOfChannels = 1; #endif @@ -402,7 +402,7 @@ DSP::u::FileInput::FileInput(DSP::Clock_ptr ParentClock, //NoOfChannels = 2; //! \bug support for reading files with different number of channels then number of block's outputs #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::u::FileInput::FileInput" << DSP::LogMode::second << "Wrong number of channels for *.tape file !!!" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::FileInput::FileInput" << DSP::e::LogMode::second << "Wrong number of channels for *.tape file !!!" << endl; #endif ready = false; } @@ -410,7 +410,7 @@ DSP::u::FileInput::FileInput(DSP::Clock_ptr ParentClock, if (NoOfOutputs != NoOfFileChannels) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::u::FileInput::FileInput" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::u::FileInput::FileInput" << DSP::e::LogMode::second << "Incorrect number of input channels: expected " << NoOfOutputs << " but found " << NoOfFileChannels << "!!!" << endl; #endif @@ -456,7 +456,7 @@ DSP::u::FileInput::FileInput(DSP::Clock_ptr ParentClock, // +++++++++++++++++++++++++++++++++++++++++++++ // if (ready == false) { - DSP::log << DSP::LogMode::Error << "DSP::u::FileInput" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::u::FileInput" << DSP::e::LogMode::second << "Block <" << GetName() << "> failed to open file \"" << FileName << "\"" << endl; OutputExecute_ptr = &OutputExecute_Dummy; } @@ -469,7 +469,7 @@ bool DSP::u::FileInput::SetSkip(long long Offset) UNUSED_ARGUMENT(Offset); #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::u::FileInput::SetSkip" << DSP::LogMode::second << "not implemented yet" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::FileInput::SetSkip" << DSP::e::LogMode::second << "not implemented yet" << endl; #endif return false; } @@ -502,7 +502,7 @@ bool DSP::u::FileInput::OpenFile(const string &FileName, ready = false; #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::u::FileInput::FileInput" << DSP::LogMode::second << "Unsupported *.flt file version !!!" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::FileInput::FileInput" << DSP::e::LogMode::second << "Unsupported *.flt file version !!!" << endl; //! \todo verify if file header data match constructor parameters #endif } @@ -526,15 +526,15 @@ bool DSP::u::FileInput::OpenFile(const string &FileName, ready = false; #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::u::FileInput::FileInput" << DSP::LogMode::second << "Unsupported *.tape file sample type!!!" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::FileInput::FileInput" << DSP::e::LogMode::second << "Unsupported *.tape file sample type!!!" << endl; #endif } #ifdef __DEBUG__ if (sizeof(DSP::T_TAPE_header) != DSP::TAPE_header_LEN) - DSP::log << DSP::LogMode::Error << "DSP::u::FileInput::FileInput" << DSP::LogMode::second << "TAPE_header_LEN does not much sizeof T_TAPE_header structure !!!" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::FileInput::FileInput" << DSP::e::LogMode::second << "TAPE_header_LEN does not much sizeof T_TAPE_header structure !!!" << endl; if (tape_header[0].header_size() != DSP::TAPE_header_LEN) - DSP::log << DSP::LogMode::Error << "DSP::u::FileInput::FileInput" << DSP::LogMode::second << "Unsupported *.tape file version !!!" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::FileInput::FileInput" << DSP::e::LogMode::second << "Unsupported *.tape file version !!!" << endl; #endif SamplingRate = tape_header[0].sampling_rate(); @@ -552,7 +552,7 @@ bool DSP::u::FileInput::OpenFile(const string &FileName, #ifdef __DEBUG__ { - DSP::log << DSP::LogMode::Error << "DSP::u::FileInput::FileInput" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::u::FileInput::FileInput" << DSP::e::LogMode::second << "This (" << FileName << ") is not PCM WAVE file or file is corrupted !!!" << endl; } #endif @@ -576,7 +576,7 @@ bool DSP::u::FileInput::OpenFile(const string &FileName, ready = false; #ifdef __DEBUG__ { - DSP::log << DSP::LogMode::Error << "DSP::u::FileInput::FileInput" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::u::FileInput::FileInput" << DSP::e::LogMode::second << "Unsupported PCM sample size ==> " << wav_header[0].wBitsPerSample << " bits!!!" << endl; } #endif @@ -590,7 +590,7 @@ bool DSP::u::FileInput::OpenFile(const string &FileName, ready = false; #ifdef __DEBUG__ { - DSP::log << DSP::LogMode::Error << "DSP::u::FileInput::FileInput" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::u::FileInput::FileInput" << DSP::e::LogMode::second << "No data have been found in PCM file " << FileName << "!!!" << endl; } #endif @@ -711,7 +711,7 @@ unsigned long DSP::u::FileInput::GetSampleSize(DSP::e::SampleType SampleType_in) sample_size=1; if ((DSP::File_buffer_size % 8) != 0) { - DSP::log << DSP::LogMode::Error << "DSP::u::FileInput" << DSP::LogMode::second << "Can't read bit stream corectly:" + DSP::log << DSP::e::LogMode::Error << "DSP::u::FileInput" << DSP::e::LogMode::second << "Can't read bit stream corectly:" " DSP::File_buffer_size is not a multiply of byte size (8 bits)" << endl; } break; @@ -723,7 +723,7 @@ unsigned long DSP::u::FileInput::GetSampleSize(DSP::e::SampleType SampleType_in) break; default: sample_size=8*sizeof(short); - DSP::log << DSP::LogMode::Error << "DSP::u::FileInput" << DSP::LogMode::second << "Unsupported data type" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::FileInput" << DSP::e::LogMode::second << "Unsupported data type" << endl; break; } sample_size*=NoOfFileChannels; @@ -1140,7 +1140,7 @@ bool DSP::u::FileOutput::Open(const string &FileName, DSP::e::SampleType sample_ if (NoOfChannels > UCHAR_MAX) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::u::FileOutput::Open" << DSP::LogMode::second << "NoOfChannels to large (> UCHAR_MAX)" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::FileOutput::Open" << DSP::e::LogMode::second << "NoOfChannels to large (> UCHAR_MAX)" << endl; #endif NoOfChannels = UCHAR_MAX; } @@ -1185,7 +1185,7 @@ bool DSP::u::FileOutput::Open(const string &FileName, DSP::e::SampleType sample_ case DSP::e::SampleType::ST_bit_reversed: if ((DSP::File_buffer_size % 8) != 0) { - DSP::log << DSP::LogMode::Error << "DSP::u::FileOutput" << DSP::LogMode::second << "Can't write bit stream correctly:" + DSP::log << DSP::e::LogMode::Error << "DSP::u::FileOutput" << DSP::e::LogMode::second << "Can't write bit stream correctly:" " DSP::File_buffer_size is not a multiply of byte size (8 bits)" << endl; } // "0 / 1" byte by byte @@ -1196,7 +1196,7 @@ bool DSP::u::FileOutput::Open(const string &FileName, DSP::e::SampleType sample_ break; default: #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::u::FileOutput" << DSP::LogMode::second << "Unsupported data type changing to DSP::e::SampleType::ST_short" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::FileOutput" << DSP::e::LogMode::second << "Unsupported data type changing to DSP::e::SampleType::ST_short" << endl; #endif SampleType = DSP::e::SampleType::ST_short; Execute_ptr = &InputExecute_short; @@ -1223,7 +1223,7 @@ bool DSP::u::FileOutput::Open(const string &FileName, DSP::e::SampleType sample_ break; default: #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::u::FileOutput" << DSP::LogMode::second << "*.wav: unsupported sample type" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::FileOutput" << DSP::e::LogMode::second << "*.wav: unsupported sample type" << endl; #endif break; } @@ -1242,7 +1242,7 @@ bool DSP::u::FileOutput::Open(const string &FileName, DSP::e::SampleType sample_ case DSP::e::SampleType::ST_short: // 16bit break; default: - DSP::log << DSP::LogMode::Error << "DSP::u::FileOutput", "*.tape: unsupported sample type"); + DSP::log << DSP::e::LogMode::Error << "DSP::u::FileOutput", "*.tape: unsupported sample type"); break; } #endif @@ -1283,7 +1283,7 @@ bool DSP::u::FileOutput::Open(const string &FileName, DSP::e::SampleType sample_ break; default: #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::u::FileOutput" << DSP::LogMode::second << "*.flt: unsupported sample type" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::FileOutput" << DSP::e::LogMode::second << "*.flt: unsupported sample type" << endl; #endif break; } @@ -1327,7 +1327,7 @@ bool DSP::File::SetOffset(long long Offset, DSP::e::OffsetMode mode) case DSP::e::OffsetMode::standard: default: #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::u::FileOutput:: SetOffset" << DSP::LogMode::second << "The mode is unsuported" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::FileOutput:: SetOffset" << DSP::e::LogMode::second << "The mode is unsuported" << endl; #endif break; } @@ -1372,7 +1372,7 @@ unsigned long DSP::u::FileOutput::GetSampleSize(DSP::e::SampleType SampleType_in sample_size=1; if ((DSP::File_buffer_size % 8) != 0) { - DSP::log << DSP::LogMode::Error << "DSP::u::FileOutput::GetSampleSize" << DSP::LogMode::second << "Can't write bit stream corectly:" + DSP::log << DSP::e::LogMode::Error << "DSP::u::FileOutput::GetSampleSize" << DSP::e::LogMode::second << "Can't write bit stream corectly:" " DSP::File_buffer_size is not a multiply of byte size (8 bits)" << endl; } break; @@ -1381,7 +1381,7 @@ unsigned long DSP::u::FileOutput::GetSampleSize(DSP::e::SampleType SampleType_in break; default: #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::u::FileOutput::GetSampleSize" << DSP::LogMode::second << "Unsupported data type changing to DSP::e::SampleType::ST_short" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::FileOutput::GetSampleSize" << DSP::e::LogMode::second << "Unsupported data type changing to DSP::e::SampleType::ST_short" << endl; #endif sample_size=8*sizeof(short); break; @@ -1468,7 +1468,7 @@ bool DSP::u::FileOutput::BlockOutput(bool block) if (FileHandle == NULL) { #ifdef __DEBUG__ - DSP::log << "DSP::u::FileOutput::BlockOutput" << DSP::LogMode::second << "Warning: FileHandle == NULL !!!" << endl; + DSP::log << "DSP::u::FileOutput::BlockOutput" << DSP::e::LogMode::second << "Warning: FileHandle == NULL !!!" << endl; #endif return false; } @@ -1649,7 +1649,7 @@ unsigned long DSP::u::FileOutput::WriteSegmentFromBuffer( break; default: - DSP::log << DSP::LogMode::Error << "DSP::u::FileOutput::WriteSegmentToBuffer" << DSP::LogMode::second << "Unsupported file sample type - write aborted" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::FileOutput::WriteSegmentToBuffer" << DSP::e::LogMode::second << "Unsupported file sample type - write aborted" << endl; return 0; } @@ -2378,7 +2378,7 @@ void DSP::u::FileOutput::FlushBuffer(void) { #ifdef __DEBUG__ case DSP::e::SampleType::ST_short: - DSP::log << "DSP::u::FileOutput::FlushBuffer" << DSP::LogMode::second << "DSP::e::SampleType::ST_short no longer supported" << endl; + DSP::log << "DSP::u::FileOutput::FlushBuffer" << DSP::e::LogMode::second << "DSP::e::SampleType::ST_short no longer supported" << endl; /* tempBuffer_float=Buffer; @@ -2392,7 +2392,7 @@ void DSP::u::FileOutput::FlushBuffer(void) */ break; case DSP::e::SampleType::ST_float: - DSP::log << "DSP::u::FileOutput::FlushBuffer" << DSP::LogMode::second << "DSP::e::SampleType::ST_float no longer supported" << endl; + DSP::log << "DSP::u::FileOutput::FlushBuffer" << DSP::e::LogMode::second << "DSP::e::SampleType::ST_float no longer supported" << endl; /* tempBuffer_float=Buffer; @@ -2406,10 +2406,10 @@ void DSP::u::FileOutput::FlushBuffer(void) */ break; case DSP::e::SampleType::ST_tchar: - DSP::log << "DSP::u::FileOutput::FlushBuffer" << DSP::LogMode::second << "DSP::e::SampleType::ST_tchar no longer supported" << endl; + DSP::log << "DSP::u::FileOutput::FlushBuffer" << DSP::e::LogMode::second << "DSP::e::SampleType::ST_tchar no longer supported" << endl; break; case DSP::e::SampleType::ST_uchar: - DSP::log << "DSP::u::FileOutput::FlushBuffer" << DSP::LogMode::second << "DSP::e::SampleType::ST_uchar no longer supported" << endl; + DSP::log << "DSP::u::FileOutput::FlushBuffer" << DSP::e::LogMode::second << "DSP::e::SampleType::ST_uchar no longer supported" << endl; /* tempBuffer_float=Buffer; @@ -2423,7 +2423,7 @@ void DSP::u::FileOutput::FlushBuffer(void) */ break; case DSP::e::SampleType::ST_bit_text: - DSP::log << "DSP::u::FileOutput::FlushBuffer" << DSP::LogMode::second << "DSP::e::SampleType::ST_bit_text no longer supported" << endl; + DSP::log << "DSP::u::FileOutput::FlushBuffer" << DSP::e::LogMode::second << "DSP::e::SampleType::ST_bit_text no longer supported" << endl; /* tempBuffer_float=Buffer; @@ -2486,7 +2486,7 @@ void DSP::u::FileOutput::FlushBuffer(void) break; default: #ifdef __DEBUG__ - DSP::log << "DSP::u::FileOutput::FlushBuffer" << DSP::LogMode::second << "Unsupported format detected" << endl; + DSP::log << "DSP::u::FileOutput::FlushBuffer" << DSP::e::LogMode::second << "Unsupported format detected" << endl; #endif break; } @@ -2539,7 +2539,7 @@ bool DSP::f::GetWAVEfileParams(const string &FileName, const string &FileDir, { #ifdef __DEBUG__ { - DSP::log << DSP::LogMode::Error << "DSP::f::GetWAVEfileParams" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::f::GetWAVEfileParams" << DSP::e::LogMode::second << "This (" << FileName << ") is not PCM WAVE file or file is corrupted !!!" << endl; } #endif @@ -2620,7 +2620,7 @@ bool DSP::u::WaveInput::SetSkip(long long Offset) UNUSED_ARGUMENT(Offset); #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::u::FileInput::SetSkip" << DSP::LogMode::second << "not implemented yet" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::FileInput::SetSkip" << DSP::e::LogMode::second << "not implemented yet" << endl; #endif return false; } @@ -2654,7 +2654,7 @@ bool DSP::u::WaveInput::Init(void) if (FileHandle == NULL) { #ifdef __DEBUG__ - DSP::log << "DSP::u::WaveInput::Init" << DSP::LogMode::second + DSP::log << "DSP::u::WaveInput::Init" << DSP::e::LogMode::second << "(Input file \"" << tekst << "\" in block <" << GetName() << "> could not be opened" << endl; #endif @@ -2671,7 +2671,7 @@ bool DSP::u::WaveInput::Init(void) if (WAVEchunk.WAVEinfo(FileHandle)==false) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::u::WaveInput::Init" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::u::WaveInput::Init" << DSP::e::LogMode::second << "This (" << FileName << ") is not PCM WAVE file or file is corrupted !!!" << endl; #endif fclose(FileHandle); @@ -2700,7 +2700,7 @@ bool DSP::u::WaveInput::Init(void) << WAVEchunk.wBitsPerSample << "bits"; break; } - DSP::log << "DSP::u::WaveInput::Init" << DSP::LogMode::second << temp.str() << endl; + DSP::log << "DSP::u::WaveInput::Init" << DSP::e::LogMode::second << temp.str() << endl; } #endif //SampleSize = WAVEchunk.wBitsPerSample * WAVEchunk.nChannels; @@ -2709,7 +2709,7 @@ bool DSP::u::WaveInput::Init(void) if (WAVEchunk.FindDATA(FileHandle)==false) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::u::WaveInput::Init" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::u::WaveInput::Init" << DSP::e::LogMode::second << "No data have been found in PCM file " << FileName << "!!!" << endl; #endif fclose(FileHandle); @@ -2822,7 +2822,7 @@ uint32_t DSP::u::WaveInput::ReadAudioSegment(void) #ifdef __DEBUG__ else { - DSP::log << DSP::LogMode::Error << "DSP::u::WaveInput::ReadAudioSegment" << DSP::LogMode::second << "unsupported PCM sample size" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::WaveInput::ReadAudioSegment" << DSP::e::LogMode::second << "unsupported PCM sample size" << endl; } #endif @@ -3041,7 +3041,7 @@ void DSP::T_WAVEchunk::PrepareHeader( wBitsPerSample = wBitsPerSample_in; #ifdef __DEBUG__ if ((wBitsPerSample % 8) != 0) - DSP::log << DSP::LogMode::Error << "T_WAVEchunk::PrepareHeader" << DSP::LogMode::second << "wBitsPerSample_in in not a multiple of 8" << endl; + DSP::log << DSP::e::LogMode::Error << "T_WAVEchunk::PrepareHeader" << DSP::e::LogMode::second << "wBitsPerSample_in in not a multiple of 8" << endl; #endif nBlockAlign = (uint16_t)(wBitsPerSample / 8 * nChannels); nAvgBytesPerSec = nSamplesPerSec * nBlockAlign; @@ -3513,31 +3513,31 @@ inline void CDirectXInput::SourceDescription(TStringList *Text) switch (result) { case MMSYSERR_ALLOCATED: - DSP::log << DSP::LogMode::Error << "DSP_AudioCheckError" << DSP::LogMode::second << + DSP::log << DSP::e::LogMode::Error << "DSP_AudioCheckError" << DSP::e::LogMode::second << "Specified resource is already allocated." << endl; break; case MMSYSERR_BADDEVICEID: - DSP::log << DSP::LogMode::Error << "DSP_AudioCheckError" << DSP::LogMode::second << + DSP::log << DSP::e::LogMode::Error << "DSP_AudioCheckError" << DSP::e::LogMode::second << "Specified device identifier is out of range." << endl; break; case MMSYSERR_NODRIVER: - DSP::log << DSP::LogMode::Error << "DSP_AudioCheckError" << DSP::LogMode::second << + DSP::log << DSP::e::LogMode::Error << "DSP_AudioCheckError" << DSP::e::LogMode::second << "No device driver is present." << endl; break; case MMSYSERR_NOMEM: - DSP::log << DSP::LogMode::Error << "DSP_AudioCheckError" << DSP::LogMode::second << + DSP::log << DSP::e::LogMode::Error << "DSP_AudioCheckError" << DSP::e::LogMode::second << "Unable to allocate or lock memory." << endl; break; case WAVERR_BADFORMAT: - DSP::log << DSP::LogMode::Error << "DSP_AudioCheckError" << DSP::LogMode::second << + DSP::log << DSP::e::LogMode::Error << "DSP_AudioCheckError" << DSP::e::LogMode::second << "Attempted to open with an unsupported waveform-audio format." << endl; break; case WAVERR_SYNC: - DSP::log << DSP::LogMode::Error << "DSP_AudioCheckError" << DSP::LogMode::second << + DSP::log << DSP::e::LogMode::Error << "DSP_AudioCheckError" << DSP::e::LogMode::second << "The device is synchronous but waveOutOpen was called without using the WAVE_ALLOWSYNC flag." << endl; break; case MMSYSERR_INVALFLAG: - DSP::log << DSP::LogMode::Error << "DSP_AudioCheckError" << DSP::LogMode::second << + DSP::log << DSP::e::LogMode::Error << "DSP_AudioCheckError" << DSP::e::LogMode::second << "Invalid flag" << endl; break; case MMSYSERR_NOERROR: @@ -3547,24 +3547,24 @@ inline void CDirectXInput::SourceDescription(TStringList *Text) //printf("\n"); getchar(); break; case MMSYSERR_INVALHANDLE: - DSP::log << DSP::LogMode::Error << "DSP_AudioCheckError" << DSP::LogMode::second << + DSP::log << DSP::e::LogMode::Error << "DSP_AudioCheckError" << DSP::e::LogMode::second << "Specified device handle is invalid." << endl; break; case WAVERR_UNPREPARED: - DSP::log << DSP::LogMode::Error << "DSP_AudioCheckError" << DSP::LogMode::second << + DSP::log << DSP::e::LogMode::Error << "DSP_AudioCheckError" << DSP::e::LogMode::second << "The data block pointed to by the pwh parameter hasn't been prepared." << endl; break; case MMSYSERR_HANDLEBUSY: - DSP::log << DSP::LogMode::Error << "DSP_AudioCheckError" << DSP::LogMode::second << + DSP::log << DSP::e::LogMode::Error << "DSP_AudioCheckError" << DSP::e::LogMode::second << "Handle busy." << endl; break; case WAVERR_STILLPLAYING: - DSP::log << DSP::LogMode::Error << "DSP_AudioCheckError" << DSP::LogMode::second << + DSP::log << DSP::e::LogMode::Error << "DSP_AudioCheckError" << DSP::e::LogMode::second << "There are still buffers in the queue." << endl; break; default: { - DSP::log << DSP::LogMode::Error << "DSP_AudioCheckError" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP_AudioCheckError" << DSP::e::LogMode::second << "Unknown error " << WAVERR_BASE << " " << result << endl; } break; @@ -3598,7 +3598,7 @@ uint32_t DSP::f::GetAudioBufferSize(const unsigned long &SamplingFreq, const DSP // size / DSP::ReferenceFs == new_size / SamplingFreq #ifdef __DEBUG__ if ((SamplingFreq * size) / DSP::ReferenceFs > UINT32_MAX){ - DSP::log << DSP::LogMode::Error << "DSP::f::GetAudioBufferSize" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::f::GetAudioBufferSize" << DSP::e::LogMode::second << "Buffer size (" << (SamplingFreq * size) / DSP::ReferenceFs << ") > UINT32_MAX" << endl; } #endif @@ -3628,20 +3628,20 @@ uint32_t DSP::f::GetAudioBufferSize(const unsigned long &SamplingFreq, const DSP switch (uMsg) { case WOM_OPEN: - DSP::log << "DSP::u::AudioOutput::waveOutProc" << DSP::LogMode::second + DSP::log << "DSP::u::AudioOutput::waveOutProc" << DSP::e::LogMode::second << "WOM_OPEN(" << (int)dwInstance << ")" << endl; break; case WOM_CLOSE: - DSP::log << "DSP::u::AudioOutput::waveOutProc" << DSP::LogMode::second + DSP::log << "DSP::u::AudioOutput::waveOutProc" << DSP::e::LogMode::second << "WOM_CLOSE(" << (int)dwInstance << ")" << endl; break; case WOM_DONE: - DSP::log << "DSP::u::AudioOutput::waveOutProc" << DSP::LogMode::second + DSP::log << "DSP::u::AudioOutput::waveOutProc" << DSP::e::LogMode::second << "WOM_DONE(" << (int)dwInstance << ")" << endl; if (Current->StopPlaying) { - DSP::log << "DSP::u::AudioOutput::waveOutProc" << DSP::LogMode::second << "StopPlaying is set" << endl; + DSP::log << "DSP::u::AudioOutput::waveOutProc" << DSP::e::LogMode::second << "StopPlaying is set" << endl; return; } else @@ -3650,7 +3650,7 @@ uint32_t DSP::f::GetAudioBufferSize(const unsigned long &SamplingFreq, const DSP for (ind=0; ind < DSP_NoOfAudioOutputBuffers; ind++) AllDone &= (Current->waveHeaderOut[ind].dwFlags & WHDR_DONE); if (AllDone) - DSP::log << "DSP::u::AudioOutput::waveOutProc" << DSP::LogMode::second << "All buffers had been used - nothing to play" << endl; + DSP::log << "DSP::u::AudioOutput::waveOutProc" << DSP::e::LogMode::second << "All buffers had been used - nothing to play" << endl; } break; } @@ -3684,11 +3684,11 @@ uint32_t DSP::f::GetAudioBufferSize(const unsigned long &SamplingFreq, const DSP #ifdef __DEBUG__ #ifdef AUDIO_DEBUG_MESSAGES_ON case WIM_OPEN: - DSP::log << "DSP::u::AudioInput::waveInProc" << DSP::LogMode::second + DSP::log << "DSP::u::AudioInput::waveInProc" << DSP::e::LogMode::second << "WIM_OPEN(" << (int)dwInstance << ")" << endl; break; case WIM_CLOSE: - DSP::log << "DSP::u::AudioInput::waveInProc" << DSP::LogMode::second + DSP::log << "DSP::u::AudioInput::waveInProc" << DSP::e::LogMode::second << "WIM_CLOSE(" << (int)dwInstance << ")" << endl; break; #endif @@ -3697,7 +3697,7 @@ uint32_t DSP::f::GetAudioBufferSize(const unsigned long &SamplingFreq, const DSP case WIM_DATA: #ifdef __DEBUG__ #ifdef AUDIO_DEBUG_MESSAGES_ON - DSP::log << "DSP::u::AudioInput::waveInProc" << DSP::LogMode::second + DSP::log << "DSP::u::AudioInput::waveInProc" << DSP::e::LogMode::second << "WIM_DATA(" << (int)dwInstance << ")" << endl; #endif #endif @@ -3710,7 +3710,7 @@ uint32_t DSP::f::GetAudioBufferSize(const unsigned long &SamplingFreq, const DSP { #ifdef __DEBUG__ #ifdef AUDIO_DEBUG_MESSAGES_ON - DSP::log << "DSP::u::AudioInput::waveInProc" << DSP::LogMode::second << "All buffers had been used - skipping input audio frame" << endl; + DSP::log << "DSP::u::AudioInput::waveInProc" << DSP::e::LogMode::second << "All buffers had been used - skipping input audio frame" << endl; #endif #endif result=waveInUnprepareHeader(Current->hWaveIn, @@ -3743,7 +3743,7 @@ uint32_t DSP::f::GetAudioBufferSize(const unsigned long &SamplingFreq, const DSP #ifdef __DEBUG__ if (Current->InSampleType != DSP::e::SampleType::ST_short) { - DSP::log << "DSP::u::AudioInput::waveInProc_short" << DSP::LogMode::second << "Current->InSampleType != DSP::e::SampleType::ST_short" << endl; + DSP::log << "DSP::u::AudioInput::waveInProc_short" << DSP::e::LogMode::second << "Current->InSampleType != DSP::e::SampleType::ST_short" << endl; } #endif @@ -3770,7 +3770,7 @@ uint32_t DSP::f::GetAudioBufferSize(const unsigned long &SamplingFreq, const DSP { #ifdef __DEBUG__ #ifdef AUDIO_DEBUG_MESSAGES_ON - DSP::log << "DSP::u::AudioInput::waveInProc" << DSP::LogMode::second << "Wrong audio frame ready or other unexpected error" << endl; + DSP::log << "DSP::u::AudioInput::waveInProc" << DSP::e::LogMode::second << "Wrong audio frame ready or other unexpected error" << endl; #endif #endif } @@ -3808,11 +3808,11 @@ uint32_t DSP::f::GetAudioBufferSize(const unsigned long &SamplingFreq, const DSP #ifdef __DEBUG__ #ifdef AUDIO_DEBUG_MESSAGES_ON case WIM_OPEN: - DSP::log << "DSP::u::AudioInput::waveInProc" << DSP::LogMode::second + DSP::log << "DSP::u::AudioInput::waveInProc" << DSP::e::LogMode::second << "WIM_OPEN(" << (int)dwInstance << ")" << end; break; case WIM_CLOSE: - DSP::log << "DSP::u::AudioInput::waveInProc" << DSP::LogMode::second + DSP::log << "DSP::u::AudioInput::waveInProc" << DSP::e::LogMode::second << "WIM_CLOSE(" << (int)dwInstance << ")" << endl; break; #endif @@ -3821,7 +3821,7 @@ uint32_t DSP::f::GetAudioBufferSize(const unsigned long &SamplingFreq, const DSP case WIM_DATA: #ifdef __DEBUG__ #ifdef AUDIO_DEBUG_MESSAGES_ON - DSP::log << "DSP::u::AudioInput::waveInProc" << DSP::LogMode::second + DSP::log << "DSP::u::AudioInput::waveInProc" << DSP::e::LogMode::second << "WIM_DATA(" << (int)dwInstance << ")" << endl; #endif #endif @@ -3834,7 +3834,7 @@ uint32_t DSP::f::GetAudioBufferSize(const unsigned long &SamplingFreq, const DSP { #ifdef __DEBUG__ #ifdef AUDIO_DEBUG_MESSAGES_ON - DSP::log << "DSP::u::AudioInput::waveInProc" << DSP::LogMode::second << "All buffers had been used - skipping input audio frame" << endl; + DSP::log << "DSP::u::AudioInput::waveInProc" << DSP::e::LogMode::second << "All buffers had been used - skipping input audio frame" << endl; #endif #endif result=waveInUnprepareHeader(Current->hWaveIn, @@ -3867,7 +3867,7 @@ uint32_t DSP::f::GetAudioBufferSize(const unsigned long &SamplingFreq, const DSP #ifdef __DEBUG__ if (Current->InSampleType != DSP::e::SampleType::ST_uchar) { - DSP::log << "DSP::u::AudioInput::waveInProc_uchar" << DSP::LogMode::second << "Current->InSampleType != DSP::e::SampleType::ST_uchar" << endl; + DSP::log << "DSP::u::AudioInput::waveInProc_uchar" << DSP::e::LogMode::second << "Current->InSampleType != DSP::e::SampleType::ST_uchar" << endl; } #endif @@ -3894,7 +3894,7 @@ uint32_t DSP::f::GetAudioBufferSize(const unsigned long &SamplingFreq, const DSP { #ifdef __DEBUG__ #ifdef AUDIO_DEBUG_MESSAGES_ON - DSP::log << "DSP::u::AudioInput::waveInProc" << DSP::LogMode::second << "Wrong audio frame ready or other unexpected error" << endl; + DSP::log << "DSP::u::AudioInput::waveInProc" << DSP::e::LogMode::second << "Wrong audio frame ready or other unexpected error" << endl; #endif #endif } @@ -4317,7 +4317,7 @@ DSP::u::AudioOutput::~AudioOutput() } #ifdef AUDIO_DEBUG_MESSAGES_ON - DSP::log << "DSP::u::AudioOutput" << DSP::LogMode::second << "Closing DSP::u::AudioOutput" << endl; + DSP::log << "DSP::u::AudioOutput" << DSP::e::LogMode::second << "Closing DSP::u::AudioOutput" << endl; #endif result=waveOutClose(hWaveOut); while (result==WAVERR_STILLPLAYING) @@ -4328,7 +4328,7 @@ DSP::u::AudioOutput::~AudioOutput() // sleep(100); // #endif #ifdef AUDIO_DEBUG_MESSAGES_ON - DSP::log << "DSP::u::AudioOutput" << DSP::LogMode::second << "Closing DSP::u::AudioOutput" << endl; + DSP::log << "DSP::u::AudioOutput" << DSP::e::LogMode::second << "Closing DSP::u::AudioOutput" << endl; #endif result=waveOutClose(hWaveOut); } @@ -4377,7 +4377,7 @@ DSP::u::AudioInput::~AudioInput() DSP::f::AudioCheckError(result); #ifdef AUDIO_DEBUG_MESSAGES_ON - DSP::log << "DSP::u::AudioInput" << DSP::LogMode::second << "Closing DSP::u::AudioInput" << endl; + DSP::log << "DSP::u::AudioInput" << DSP::e::LogMode::second << "Closing DSP::u::AudioInput" << endl; #endif result=waveInClose(hWaveIn); while (result==WAVERR_STILLPLAYING) @@ -4388,7 +4388,7 @@ DSP::u::AudioInput::~AudioInput() // sleep(100); // #endif #ifdef AUDIO_DEBUG_MESSAGES_ON - DSP::log << "DSP::u::AudioInput" << DSP::LogMode::second << "Closing DSP::u::AudioInput" << endl; + DSP::log << "DSP::u::AudioInput" << DSP::e::LogMode::second << "Closing DSP::u::AudioInput" << endl; #endif result=waveInClose(hWaveIn); } @@ -4431,7 +4431,7 @@ void DSP::u::AudioOutput::FlushBuffer(void) // Send buffer to the audio device #ifdef AUDIO_DEBUG_MESSAGES_ON - DSP::log << "DSP::u::AudioOutput" << DSP::LogMode::second << "Flushing output buffer" << endl; + DSP::log << "DSP::u::AudioOutput" << DSP::e::LogMode::second << "Flushing output buffer" << endl; #endif while (1) @@ -4521,7 +4521,7 @@ void DSP::u::AudioOutput::FlushBuffer(void) { // Sleep(10); #ifdef AUDIO_DEBUG_MESSAGES_ON - DSP::log << "DSP::u::AudioOutput" << DSP::LogMode::second << "Waiting for free output buffer" << endl; + DSP::log << "DSP::u::AudioOutput" << DSP::e::LogMode::second << "Waiting for free output buffer" << endl; #endif DSP::f::Sleep(0); } @@ -4567,7 +4567,7 @@ void DSP::u::AudioOutput::InputExecute(INPUT_EXECUTE_ARGS) #ifdef __DEBUG__ #ifdef VerboseCompilation - DSP::log << "DSP::u::AudioOutput" << DSP::LogMode::second + DSP::log << "DSP::u::AudioOutput" << DSP::e::LogMode::second << InputNo << ": " << setw(5) << setprecision(3) << fixed << value << endl; #endif #endif @@ -4598,7 +4598,7 @@ bool DSP::u::AudioInput::OutputExecute(OUTPUT_EXECUTE_ARGS) if (DSP_THIS->InBufferLen == 0) { // no audio device opened #ifdef AUDIO_DEBUG_MESSAGES_ON - DSP::log << "DSP::u::AudioInput::Execute" << DSP::LogMode::second << "No audio device opened" << endl; + DSP::log << "DSP::u::AudioInput::Execute" << DSP::e::LogMode::second << "No audio device opened" << endl; #endif for (ind=0; ind < DSP_THIS->NoOfOutputs; ind++) @@ -4623,7 +4623,7 @@ bool DSP::u::AudioInput::OutputExecute(OUTPUT_EXECUTE_ARGS) // so we must wait for some #ifdef AUDIO_DEBUG_MESSAGES_ON - DSP::log << "DSP::u::AudioInput::Execute" << DSP::LogMode::second << "no data ready we must wait" << endl; + DSP::log << "DSP::u::AudioInput::Execute" << DSP::e::LogMode::second << "no data ready we must wait" << endl; #endif DSP::Clock::InputNeedsMoreTime[DSP_THIS->my_clock->MasterClockIndex] = true; return false; @@ -4640,7 +4640,7 @@ bool DSP::u::AudioInput::OutputExecute(OUTPUT_EXECUTE_ARGS) DSP_THIS->CurrentBufferIndex %= DSP::NoOfAudioInputBuffers; #ifdef AUDIO_DEBUG_MESSAGES_ON - DSP::log << "DSP::u::AudioInput::Execute" << DSP::LogMode::second << "fresh data has finally arrived" << endl; + DSP::log << "DSP::u::AudioInput::Execute" << DSP::e::LogMode::second << "fresh data has finally arrived" << endl; #endif } else @@ -4672,7 +4672,7 @@ bool DSP::u::AudioInput::OutputExecute(OUTPUT_EXECUTE_ARGS) // using both buffers #ifdef WINMMAPI #ifdef AUDIO_DEBUG_MESSAGES_ON - DSP::log << "DSP::u::AudioInput::Execute" << DSP::LogMode::second << "Starting recording using two wave buffers" << endl; + DSP::log << "DSP::u::AudioInput::Execute" << DSP::e::LogMode::second << "Starting recording using two wave buffers" << endl; #endif result=waveInAddBuffer(DSP_THIS->hWaveIn, @@ -4877,14 +4877,14 @@ void DSP::u::InputBuffer::WriteBuffer(void *source, #ifdef __DEBUG__ if (NoOfSourceSamples*InputSampleSize != source_size) { - DSP::log << DSP::LogMode::Error << "DSP::u::InputBuffer::WriteBuffer" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::u::InputBuffer::WriteBuffer" << DSP::e::LogMode::second << "(" << this->GetName() << ") source_size (" << source_size << ") doesn't match source_DataType" << endl; } if (BufferSize < NoOfSourceSamples) { stringstream tekst; - DSP::log << DSP::LogMode::Error << "DSP::u::InputBuffer::WriteBuffer" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::u::InputBuffer::WriteBuffer" << DSP::e::LogMode::second << "(" << this->GetName() << ") source_size (" << source_size << ") larger then Buffer size\n" << endl; } @@ -5270,7 +5270,7 @@ unsigned long DSP::u::OutputBuffer::ReadBuffer(void *dest, long int dest_size, #ifdef __DEBUG__ if (dest == NULL) { - DSP::log << DSP::LogMode::Error << "DSP::u::OutputBuffer::ReadBuffer" << DSP::LogMode::second << "dest == NULL !!!" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::OutputBuffer::ReadBuffer" << DSP::e::LogMode::second << "dest == NULL !!!" << endl; return 0; } #endif @@ -5294,7 +5294,7 @@ unsigned long DSP::u::OutputBuffer::ReadBuffer(void *dest, long int dest_size, #ifdef __DEBUG__ if (NoOfDestSamples*OutputSampleSize != dest_size) { - DSP::log << DSP::LogMode::Error << "DSP::u::OutputBuffer::ReadBuffer" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::u::OutputBuffer::ReadBuffer" << DSP::e::LogMode::second << "(" << this->GetName() << ") dest_size (" << dest_size << ") doesn't match dest_DataType" << endl; } #endif @@ -5369,7 +5369,7 @@ unsigned long DSP::u::OutputBuffer::ReadBuffer(void *dest, long int dest_size, //128 128 256 256 #ifdef __DEBUG__ if (reset - (BufferSize - BufferIndex) > INT_MAX) { - DSP::log << DSP::LogMode::Error << "DSP::u::OutputBuffer::ReadBuffer" << DSP::LogMode::second << "step > INT_MAX" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::OutputBuffer::ReadBuffer" << DSP::e::LogMode::second << "step > INT_MAX" << endl; } #endif // __DEBUG__ step = (int)(reset - (BufferSize - BufferIndex)); @@ -5565,7 +5565,7 @@ bool DSP::u::OutputBuffer::OutputExecute(OUTPUT_EXECUTE_ARGS) #ifdef __DEBUG__ else { - DSP::log << DSP::LogMode::Error << "DSP::u::OutputBuffer::OutputExecute" << DSP::LogMode::second << "DSP_THIS->OutputSamples_ready == false" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::OutputBuffer::OutputExecute" << DSP::e::LogMode::second << "DSP_THIS->OutputSamples_ready == false" << endl; } #endif @@ -5736,7 +5736,7 @@ bool DSP::LoadCoef::Open(const string &Filename, const string &Dir) if (this->NoOfVectors == -1) { - DSP::log << DSP::LogMode::Error << "DSP_LoadCoef::Open" << DSP::LogMode::second << "File doesn't exist or unsupported file format." << endl; + DSP::log << DSP::e::LogMode::Error << "DSP_LoadCoef::Open" << DSP::e::LogMode::second << "File doesn't exist or unsupported file format." << endl; return false; } diff --git a/src/cpp/DSP_clocks.cpp b/src/cpp/DSP_clocks.cpp index 03831c3..b440851 100644 --- a/src/cpp/DSP_clocks.cpp +++ b/src/cpp/DSP_clocks.cpp @@ -198,14 +198,14 @@ void DSP::Clock::SetAsNewMasterClock(DSP::Clock_ptr new_master) if (MasterClocks[new_master->MasterClockIndex] != NULL) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::Clock::SetAsNewMasterClock" << DSP::LogMode::second << "Cannot set new master clock if the old has not been released" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::Clock::SetAsNewMasterClock" << DSP::e::LogMode::second << "Cannot set new master clock if the old has not been released" << endl; #endif return; } if (First[new_master->MasterClockIndex] == NULL) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::Clock::SetAsNewMasterClock" << DSP::LogMode::second << "There are no clocks on the list for given master clock !!!" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::Clock::SetAsNewMasterClock" << DSP::e::LogMode::second << "There are no clocks on the list for given master clock !!!" << endl; #endif return; } @@ -415,7 +415,7 @@ unsigned long DSP::Clock::Execute(DSP::Clock_ptr ReferenceClock, { // ReferenceClock=GetClock(); #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::Clock::Execute" << DSP::LogMode::second << "NULL ReferenceClock" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::Clock::Execute" << DSP::e::LogMode::second << "NULL ReferenceClock" << endl; #endif return 0; } @@ -536,22 +536,22 @@ unsigned long DSP::Clock::Execute(DSP::Clock_ptr ReferenceClock, if (ReferenceClock_is_signal_activated == false) { #ifdef __DEBUG__ - DSP::log << "DSP::Clock::Execute" << DSP::LogMode::second << "Not all sources processed but no source is ready" << endl; - DSP::log << "DSP::Clock::Execute" << DSP::LogMode::second << ">> Check if there is the feedback loop without DSP::u::LoopDelay." << endl; - DSP::log << "DSP::Clock::Execute >>" << DSP::LogMode::second + DSP::log << "DSP::Clock::Execute" << DSP::e::LogMode::second << "Not all sources processed but no source is ready" << endl; + DSP::log << "DSP::Clock::Execute" << DSP::e::LogMode::second << ">> Check if there is the feedback loop without DSP::u::LoopDelay." << endl; + DSP::log << "DSP::Clock::Execute >>" << DSP::e::LogMode::second << "Number of signal activated clocks still on the list:" << *SignalActivatedClocksListLength_ptr << endl; for (clock_ind=0; clock_ind<(*ListLength); clock_ind++) { for (unsigned int component_ind=0; component_ind<ClocksList[clock_ind]->NoOfComponents; component_ind++) { - DSP::log << "DSP::Clock::Execute >>" << DSP::LogMode::second + DSP::log << "DSP::Clock::Execute >>" << DSP::e::LogMode::second << clock_ind << ":" << component_ind << ") NOTIFY: " << ClocksList[clock_ind]->ComponentsNotifications_Table[component_ind]->GetName() << endl; } for (unsigned int sources_ind=0; sources_ind<ClocksList[clock_ind]->NoOfSources; sources_ind++) { - DSP::log << "DSP::Clock::Execute >>" << DSP::LogMode::second + DSP::log << "DSP::Clock::Execute >>" << DSP::e::LogMode::second << clock_ind << ":" << sources_ind << ") PROCESS: " << ClocksList[clock_ind]->SourcesTable[sources_ind]->GetName() << endl; } @@ -750,7 +750,7 @@ void DSP::Clock::ClockInit(DSP::Clock_ptr ReferenceClock, long int L_in, long in if (ActiveClocksList == NULL) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::Clock::ClockInit" << DSP::LogMode::second << "ActiveClockList not yet defined" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::Clock::ClockInit" << DSP::e::LogMode::second << "ActiveClockList not yet defined" << endl; #endif return; } @@ -784,7 +784,7 @@ void DSP::Clock::UpdateGlobalSamplingRate(void) } else { if (clocks_GlobalSamplingRate != current->GlobalSamplingRate) { - DSP::log << DSP::LogMode::Error + DSP::log << DSP::e::LogMode::Error << "DSP::Clock::UpdateGlobalSamplingRate: clocks_GlobalSamplingRate = " << clocks_GlobalSamplingRate << " but current->GlobalSamplingRate = " << current->GlobalSamplingRate << endl; } @@ -953,7 +953,7 @@ void DSP::Clock::FreeClocks(DSP::Clock_ptr ReferenceClock) if (ReferenceClock == NULL) { #ifdef __DEBUG__ - DSP::log << "DSP::Clock::FreeClocks" << DSP::LogMode::second << "Reference clock is NULL" << endl; + DSP::log << "DSP::Clock::FreeClocks" << DSP::e::LogMode::second << "Reference clock is NULL" << endl; #endif return; } @@ -962,7 +962,7 @@ void DSP::Clock::FreeClocks(DSP::Clock_ptr ReferenceClock) if (temp_master == NULL) { #ifdef __DEBUG__ - DSP::log << "DSP::Clock::FreeClocks" << DSP::LogMode::second << "Reference clock refers to NULL Master Clock" << endl; + DSP::log << "DSP::Clock::FreeClocks" << DSP::e::LogMode::second << "Reference clock refers to NULL Master Clock" << endl; #endif // ??? Master Clock was not reelected //return; @@ -985,7 +985,7 @@ void DSP::Clock::FreeClocks(DSP::Clock_ptr ReferenceClock) if (OK == false) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::Clock::FreeClocks" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::Clock::FreeClocks" << DSP::e::LogMode::second << "Reference clock refers to Master Clock which it is not related to (it's possible that Reference clock is invalid or was deleted before)" << endl; #endif return; @@ -1292,7 +1292,7 @@ void DSP::Clock::UpdateCycleLengths(DSP::Clock_ptr RootParentClock) if (RootParentClock==NULL) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::Clock::UpdateCycleLengths" << DSP::LogMode::second << "RootParentClock undefined" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::Clock::UpdateCycleLengths" << DSP::e::LogMode::second << "RootParentClock undefined" << endl; #endif return; //there's nothing to do } @@ -1442,7 +1442,7 @@ DSP::Clock_ptr DSP::Clock::GetClock(DSP::Clock_ptr ParentClock, long L, long M) if (ParentClock==NULL) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "GetClock" << DSP::LogMode::second << "ParrentClock undefined" << endl; + DSP::log << DSP::e::LogMode::Error << "GetClock" << DSP::e::LogMode::second << "ParrentClock undefined" << endl; #endif return NULL; } @@ -1563,7 +1563,7 @@ DSP::Clock_ptr* DSP::Clock::FindNextActiveClocks(DSP::Clock_ptr CurrentMasterClo if (ActiveClocksList==NULL) { //b��d lub brak zegar�w #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::Clock::FindNextActiveClocks" << DSP::LogMode::second << "Error or there are no Clocks at all" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::Clock::FindNextActiveClocks" << DSP::e::LogMode::second << "Error or there are no Clocks at all" << endl; #endif return NULL; } @@ -1571,7 +1571,7 @@ DSP::Clock_ptr* DSP::Clock::FindNextActiveClocks(DSP::Clock_ptr CurrentMasterClo if (ActiveClocksList[CurrentMasterClock->MasterClockIndex]==NULL) { //b?d lub brak zegarw #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::Clock::FindNextActiveClocks" << DSP::LogMode::second << "Error or there are no Clocks at all (2)" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::Clock::FindNextActiveClocks" << DSP::e::LogMode::second << "Error or there are no Clocks at all (2)" << endl; #endif return NULL; } @@ -1639,9 +1639,9 @@ void DSP::Clock::ListOfAllComponents(bool list_outputs) UNUSED_RELEASE_ARGUMENT(list_outputs); #ifdef __DEBUG__ - DSP::log << "DSP::Clock::ListOfAllComponents" << DSP::LogMode::second << "Starting ..." << endl; + DSP::log << "DSP::Clock::ListOfAllComponents" << DSP::e::LogMode::second << "Starting ..." << endl; DSP::Component::ListOfAllComponents(list_outputs); - DSP::log << "DSP::Clock::ListOfAllComponents" << DSP::LogMode::second << "End" << endl << endl; + DSP::log << "DSP::Clock::ListOfAllComponents" << DSP::e::LogMode::second << "End" << endl << endl; #endif } @@ -1651,10 +1651,10 @@ void DSP::Clock::ListComponents(void) DSP::Clock *current; string text; - DSP::log << "DSP::Clock::ListComponents" << DSP::LogMode::second << "Starting ..." << endl; + DSP::log << "DSP::Clock::ListComponents" << DSP::e::LogMode::second << "Starting ..." << endl; for (unsigned int ind_clocks = 0; ind_clocks < NoOfMasterClocks; ind_clocks++) { - DSP::log << "DSP::Clock::ListComponents" << DSP::LogMode::second + DSP::log << "DSP::Clock::ListComponents" << DSP::e::LogMode::second << "Master clock (index = " << ind_clocks << ") / Number of Master clocks " << ((int)NoOfMasterClocks) << endl; @@ -1669,7 +1669,7 @@ void DSP::Clock::ListComponents(void) { for (unsigned int ind = 0; ind < current->NoOfSources; ind++) { - DSP::log << " >>source" << DSP::LogMode::second << current->SourcesTable[ind]->GetName() << endl; + DSP::log << " >>source" << DSP::e::LogMode::second << current->SourcesTable[ind]->GetName() << endl; } } @@ -1680,10 +1680,10 @@ void DSP::Clock::ListComponents(void) } // List Unconnected components - DSP::log << "DSP::Clock::ListComponents" << DSP::LogMode::second << "Master clock >>NULL<<" << endl; + DSP::log << "DSP::Clock::ListComponents" << DSP::e::LogMode::second << "Master clock >>NULL<<" << endl; DSP::Component::ListComponents(NULL); } - DSP::log << "DSP::Clock::ListComponents" << DSP::LogMode::second << "End" << endl << endl; + DSP::log << "DSP::Clock::ListComponents" << DSP::e::LogMode::second << "End" << endl << endl; #endif } @@ -1696,7 +1696,7 @@ void DSP::Clock::ListComponents(DSP::Clock_ptr MasterClock) string text; bool OK; - DSP::log << "DSP::Clock::ListComponents" << DSP::LogMode::second << "Starting ..." << endl; + DSP::log << "DSP::Clock::ListComponents" << DSP::e::LogMode::second << "Starting ..." << endl; // checking whether MasterClock still exists OK = false; @@ -1710,7 +1710,7 @@ void DSP::Clock::ListComponents(DSP::Clock_ptr MasterClock) } if (OK == true) { - DSP::log << "DSP::Clock::ListComponents" << DSP::LogMode::second + DSP::log << "DSP::Clock::ListComponents" << DSP::e::LogMode::second << "List for master clock with index: " << (int)MasterClock->MasterClockIndex << endl; //Find clock which points to this one @@ -1721,7 +1721,7 @@ void DSP::Clock::ListComponents(DSP::Clock_ptr MasterClock) { for (unsigned int ind = 0; ind < current->NoOfSources; ind++) { - DSP::log << " >>source" << DSP::LogMode::second << current->SourcesTable[ind]->GetName() << endl; + DSP::log << " >>source" << DSP::e::LogMode::second << current->SourcesTable[ind]->GetName() << endl; } } @@ -1732,9 +1732,9 @@ void DSP::Clock::ListComponents(DSP::Clock_ptr MasterClock) } else { - DSP::log << ">> WARNING" << DSP::LogMode::second << "Given Clock does not exists" << endl; + DSP::log << ">> WARNING" << DSP::e::LogMode::second << "Given Clock does not exists" << endl; } - DSP::log << "DSP::Clock::ListComponents" << DSP::LogMode::second << "End" << endl << endl; + DSP::log << "DSP::Clock::ListComponents" << DSP::e::LogMode::second << "End" << endl << endl; #endif } @@ -1753,7 +1753,7 @@ void DSP::Clock::AddSignalActivatedClock(unsigned int MasterClockIndex, #ifdef __DEBUG__ else { - DSP::log << DSP::LogMode::Error << "DSP::Clock::AddSignalActivatedClock" << DSP::LogMode::second << "Trying too add more than MAX_NO_OF_SIGNAL_ACTIVATED_CLOCKS clocks." << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::Clock::AddSignalActivatedClock" << DSP::e::LogMode::second << "Trying too add more than MAX_NO_OF_SIGNAL_ACTIVATED_CLOCKS clocks." << endl; } #endif // __DEBUG__ } diff --git a/src/cpp/DSP_logstream.cpp b/src/cpp/DSP_logstream.cpp index 83bc0eb..a0b3269 100644 --- a/src/cpp/DSP_logstream.cpp +++ b/src/cpp/DSP_logstream.cpp @@ -38,16 +38,16 @@ namespace DSP */ class LogStatus { - friend void logstream::SetLogState(E_LS_Mode); - friend void logstream::SetLogFileName(const string &); - friend void logstream::SetLogFunctionPtr(Message_callback_ptr); - friend long int logstream::NoOfErrors(bool Reset); - friend logstream& operator<< (logstream& os, const LogMode& log_mode); - friend class logbuf; + friend void DSP::logstream::SetLogState(const DSP::e::LogState &); + friend void DSP::logstream::SetLogFileName(const string &); + friend void DSP::logstream::SetLogFunctionPtr(DSP::Message_callback_ptr); + friend long int DSP::logstream::NoOfErrors(bool Reset); + friend DSP::logstream& ::operator<< (DSP::logstream& os, const DSP::e::LogMode& log_mode); + friend class DSP::logbuf; private: // LOG actions mode - E_LS_Mode Mode; + DSP::e::LogState Mode; long int ErrorsCounter; //! LOG file name (possibly together with path) @@ -90,8 +90,8 @@ namespace DSP */ class logbuf: public std::streambuf { - friend class logstream; - friend logstream& operator<< (logstream& os, const LogMode& log_mode); + friend class DSP::logstream; + friend DSP::logstream& ::operator<< (DSP::logstream& os, const DSP::e::LogMode& log_mode); public: logbuf(void); @@ -104,8 +104,8 @@ namespace DSP string First_string; //! Main part of the collected message string Second_string; //! Second_string part of the collected message - LogMode mode; //! stream mode (Error/Info) - LogMode msg_part; //! message part (first/second) + DSP::e::LogMode mode; //! stream mode (Error/Info) + DSP::e::LogMode msg_part; //! message part (first/second) bool pause_after_message; //! if true wiat for key press in console mode LogStatus LogStatus_object; //DSPo_LibraryLogStatus; @@ -208,10 +208,10 @@ namespace DSP { // send First_string and Second_string using ErrorMessage or InfoMessage switch (mode) { - case LogMode::Error: + case DSP::e::LogMode::Error: ErrorMessage(First_string, Second_string); break; - case LogMode::Info: + case DSP::e::LogMode::Info: InfoMessage(First_string, Second_string); break; default: @@ -222,24 +222,24 @@ namespace DSP start_new_line = true; First_string = ""; Second_string = ""; - msg_part = LogMode::first; - mode = LogMode::Info; // default + msg_part = DSP::e::LogMode::first; + mode = DSP::e::LogMode::Info; // default pause_after_message = false; - msg_part = LogMode::first; // start from first part + msg_part = DSP::e::LogMode::first; // start from first part mtx.get()->unlock(); // drugi lock // } else { switch (msg_part) { - case LogMode::first: + case DSP::e::LogMode::first: First_string += (char)c; break; - case LogMode::second: + case DSP::e::LogMode::second: Second_string += (char)c; break; default: mtx.get()->unlock(); - assert(!"Undefined DSP::LogMode value"); + assert(!"Undefined DSP::e::LogMode value"); break; } } @@ -263,9 +263,9 @@ namespace DSP First_string = ""; Second_string = ""; - mode = LogMode::Info; + mode = DSP::e::LogMode::Info; pause_after_message = false; - msg_part = LogMode::first; + msg_part = DSP::e::LogMode::first; } logbuf::~logbuf(void) @@ -305,42 +305,13 @@ namespace DSP */ - logstream& operator<< (logstream& os, const LogMode& log_mode) - { - // static_cast<Log *>(os.rdbuf())->priority_ = (int)log_priority; - switch (log_mode) { - case LogMode::first: - case LogMode::second: - os.log_buf.get()->msg_part = log_mode; - break; - case LogMode::pause: - os.log_buf.get()->pause_after_message = true; - break; - case LogMode::pause_off: - os.log_buf.get()->pause_after_message = false; - break; - case LogMode::Error: - os.log_buf.get()->pause_after_message = true; - os.log_buf.get()->mode = log_mode; - break; - case LogMode::Info: - os.log_buf.get()->pause_after_message = false; - os.log_buf.get()->mode = log_mode; - break; - default: - assert(!"Unsupported log_mode"); - break; - } - return os; - } - // ************************************************ // // ************************************************ // // ************************************************ // LogStatus::LogStatus(void) { - Mode = LS_console; + Mode = DSP::e::LogState::console; ErrorsCounter=0; plik = NULL; file_name = ""; @@ -362,12 +333,12 @@ namespace DSP file_name = ""; } - void logstream::SetLogState(E_LS_Mode Mode) + void logstream::SetLogState(const DSP::e::LogState &Mode) { //Problem with file option if it is swithed off //LOG file should ne closed - if (((log_buf->LogStatus_object.Mode & LS_file) != 0) && - ((Mode & LS_file) == 0)) + if (((log_buf->LogStatus_object.Mode & DSP::e::LogState::file) == DSP::e::LogState::file) && + ((Mode & DSP::e::LogState::file) != DSP::e::LogState::file)) { log_buf->LogStatus_object.CloseLOGfile(); } @@ -412,9 +383,9 @@ namespace DSP { CloseLOGfile(); - if ((Mode & LS_file) != 0) + if ((Mode & DSP::e::LogState::file) == DSP::e::LogState::file) { - if ((Mode & LS_append) != 0) + if ((Mode & DSP::e::LogState::append) == DSP::e::LogState::append) { plik = new std::ofstream(file_name, std::ofstream::app | std::ofstream::out); } @@ -463,12 +434,12 @@ namespace DSP // ******************************************* // LogStatus_object.ErrorsCounter++; // ******************************************* // - if (LogStatus_object.Mode == LS_off) + if (LogStatus_object.Mode == DSP::e::LogState::off) return; // if (source.length() == 0) // pause in console even if the message is empty // return; - if ((LogStatus_object.Mode & LS_user_function) != 0) + if ((LogStatus_object.Mode & DSP::e::LogState::user_function) == DSP::e::LogState::user_function) { // console if (LogStatus_object.function_ptr != NULL) if ((*LogStatus_object.function_ptr)(source, message, true) == true) @@ -480,18 +451,18 @@ namespace DSP // ******************************************* // - if ((LogStatus_object.Mode & LS_console) != 0) + if ((LogStatus_object.Mode & DSP::e::LogState::console) == DSP::e::LogState::console) { // console //printf(MessageText.c_str()); cout << MessageText << flush; } - if ((LogStatus_object.Mode & LS_file) != 0) + if ((LogStatus_object.Mode & DSP::e::LogState::file) == DSP::e::LogState::file) { // file & file_append LogStatus_object.WriteMessage2LOGfile(MessageText); } // ******************************************* // - if (((LogStatus_object.Mode & LS_console) != 0) && (pause_after_message == true)) + if (((LogStatus_object.Mode & DSP::e::LogState::console) == DSP::e::LogState::console) && (pause_after_message == true)) { //Wait for ENTER only if console mode is ON pause_after_message = false; printf("Press ENTER"); @@ -519,14 +490,14 @@ namespace DSP { string MessageText; - if (LogStatus_object.Mode == LS_off) + if (LogStatus_object.Mode == DSP::e::LogState::off) return; //if (source == NULL) // return; - if ((LogStatus_object.Mode & LS_errors_only) != 0) + if ((LogStatus_object.Mode & DSP::e::LogState::errors_only) == DSP::e::LogState::errors_only) return; - if ((LogStatus_object.Mode & LS_user_function) != 0) + if ((LogStatus_object.Mode & DSP::e::LogState::user_function) == DSP::e::LogState::user_function) { // console if (LogStatus_object.function_ptr != NULL) if ((*LogStatus_object.function_ptr)(source, message, false) == true) @@ -537,18 +508,18 @@ namespace DSP MessageText = GetInfoMessage(source, message); // ******************************************* // - if ((LogStatus_object.Mode & LS_console) != 0) + if ((LogStatus_object.Mode & DSP::e::LogState::console) == DSP::e::LogState::console) { // console //printf(MessageText.c_str()); cout << MessageText << flush; } - if ((LogStatus_object.Mode & LS_file) != 0) + if ((LogStatus_object.Mode & DSP::e::LogState::file) == DSP::e::LogState::file) { // file & file_append LogStatus_object.WriteMessage2LOGfile(MessageText); } // ******************************************* // - if (((LogStatus_object.Mode & LS_console) != 0) && (pause_after_message == true)) + if (((LogStatus_object.Mode & DSP::e::LogState::console) == DSP::e::LogState::console) && (pause_after_message == true)) { //Wait for ENTER only if console mode is ON pause_after_message = false; printf("Press ENTER"); @@ -584,3 +555,33 @@ namespace DSP } + +DSP::logstream& operator<< (DSP::logstream& os, const DSP::e::LogMode& log_mode) +{ +// static_cast<Log *>(os.rdbuf())->priority_ = (int)log_priority; + switch (log_mode) { + case DSP::e::LogMode::first: + case DSP::e::LogMode::second: + os.log_buf.get()->msg_part = log_mode; + break; + case DSP::e::LogMode::pause: + os.log_buf.get()->pause_after_message = true; + break; + case DSP::e::LogMode::pause_off: + os.log_buf.get()->pause_after_message = false; + break; + case DSP::e::LogMode::Error: + os.log_buf.get()->pause_after_message = true; + os.log_buf.get()->mode = log_mode; + break; + case DSP::e::LogMode::Info: + os.log_buf.get()->pause_after_message = false; + os.log_buf.get()->mode = log_mode; + break; + default: + assert(!"Unsupported log_mode"); + break; + } + return os; +} + diff --git a/src/cpp/DSP_misc.cpp b/src/cpp/DSP_misc.cpp index f1c744a..d363704 100644 --- a/src/cpp/DSP_misc.cpp +++ b/src/cpp/DSP_misc.cpp @@ -86,7 +86,7 @@ void DSP::f::SolveMatrixEqu( DSP::Float_vector B; //vector B unsigned int Size = (unsigned int)(B_in.size()); if (Size != A_in.size()) { - DSP::log << DSP::LogMode::Error << "DSP::f::SolveMatrixEqu" << DSP::LogMode::second << "Size mismatch of matrix A_in and vector B_in" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::f::SolveMatrixEqu" << DSP::e::LogMode::second << "Size mismatch of matrix A_in and vector B_in" << endl; return; } else { @@ -157,7 +157,7 @@ void DSP::f::SolveMatrixEqu_prec( DSP::Prec_Float_vector B; //vector B unsigned int Size = (unsigned int)(B_in.size()); if (Size != A_in.size()) { - DSP::log << DSP::LogMode::Error << "DSP::f::SolveMatrixEqu_prec" << DSP::LogMode::second << "Size mismatch of matrix A_in and vector B_in" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::f::SolveMatrixEqu_prec" << DSP::e::LogMode::second << "Size mismatch of matrix A_in and vector B_in" << endl; return; } else { @@ -241,7 +241,7 @@ void DSP::f::SolveMatrixEqu_prec( DSP::Prec_Float_vector B; //vector B unsigned int Size = (unsigned int)(B_in.size()); if (Size != A_in.size()) { - DSP::log << DSP::LogMode::Error << "DSP::f::SolveMatrixEqu_prec" << DSP::LogMode::second << "Size mismatch of matrix A_in and vector B_in" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::f::SolveMatrixEqu_prec" << DSP::e::LogMode::second << "Size mismatch of matrix A_in and vector B_in" << endl; return; } else { @@ -401,7 +401,7 @@ bool DSP::f::MakeDir(const string &dir_name, const string &parent_dir) if (temp_dir == NULL) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::f::MakeDir" << DSP::LogMode::second << "Parent directory does not exist" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::f::MakeDir" << DSP::e::LogMode::second << "Parent directory does not exist" << endl; #endif return false; } @@ -428,7 +428,7 @@ bool DSP::f::MakeDir(const string &dir_name, const string &parent_dir) if (temp_dir == NULL) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::f::MakeDir" << DSP::LogMode::second << "Could not create directory" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::f::MakeDir" << DSP::e::LogMode::second << "Could not create directory" << endl; #endif return false; } @@ -471,7 +471,7 @@ bool DSP::f::MakeDir(const string& dir_name, const string& parent_dir) if (_dir_exists == false) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::f::MakeDir", "Parent directory does not exist"); + DSP::log << DSP::e::LogMode::Error << "DSP::f::MakeDir", "Parent directory does not exist"); #endif return false; } @@ -482,7 +482,7 @@ bool DSP::f::MakeDir(const string& dir_name, const string& parent_dir) if (_mkdir(full_name.c_str()) != 0) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::f::MakeDir", "Could not create directory"); + DSP::log << DSP::e::LogMode::Error << "DSP::f::MakeDir", "Could not create directory"); #endif return false; } @@ -818,7 +818,7 @@ void DSP::f::Gauss(int size, DSP::Float_ptr buffer, DSP::Float sigma, bool norma if (sigma > 0.5) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::f::Gauss" << DSP::LogMode::second << "Sigma must be less or equal 0.5" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::f::Gauss" << DSP::e::LogMode::second << "Sigma must be less or equal 0.5" << endl; #endif return; } diff --git a/src/cpp/DSP_modules.cpp b/src/cpp/DSP_modules.cpp index c3f6082..036d20c 100644 --- a/src/cpp/DSP_modules.cpp +++ b/src/cpp/DSP_modules.cpp @@ -259,7 +259,7 @@ DSP::Component::~Component(void) if (NotificationClocks.size() > 0) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::Component::~DSP::Component" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::Component::~DSP::Component" << DSP::e::LogMode::second << "Notifications have not been correctly unregistered for component: >>" << GetName() << "<<" << endl; #endif NotificationClocks.clear(); @@ -297,7 +297,7 @@ const string &DSP::output::get_name(void) const { //! set output name void DSP::output::set_name(const string &name) { if (_is_null == true) { - DSP::log << DSP::LogMode::Error << "DSP::output::set_name" << DSP::LogMode::second << "Attempt to set name to null output object" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::output::set_name" << DSP::e::LogMode::second << "Attempt to set name to null output object" << endl; return; } _name = name; @@ -330,7 +330,7 @@ const string &DSP::input::get_name(void) const { //! set input name void DSP::input::set_name(const string &name) { if (_is_null == true) { - DSP::log << DSP::LogMode::Error << "DSP::input::set_name" << DSP::LogMode::second << "Attempt to set name to null input object" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::input::set_name" << DSP::e::LogMode::second << "Attempt to set name to null input object" << endl; return; } _name = name; @@ -397,7 +397,7 @@ bool DSP::Component::UndefineOutput(const string &Name) #ifdef __DEBUG__ if (done == false) { - DSP::log << "UndefineOutput" << DSP::LogMode::second + DSP::log << "UndefineOutput" << DSP::e::LogMode::second << "Name >" << Name << "< was not defined for block: >" << GetName() << "<" << endl; } #endif @@ -412,7 +412,7 @@ bool DSP::Component::DefineOutput(const string &Name, const unsigned int &Output if (OutputNo>=NoOfOutputs) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DefineOutput" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DefineOutput" << DSP::e::LogMode::second << "Output number out too large for block: >" << GetName() << "<" << endl; #endif return false; @@ -424,9 +424,9 @@ bool DSP::Component::DefineOutput(const string &Name, const unsigned int &Output if (Name.compare(DefinedOutputs[ind].get_name())==0) { #ifdef __DEBUG__ - DSP::log << "DefineOutput" << DSP::LogMode::second + DSP::log << "DefineOutput" << DSP::e::LogMode::second << "Name >" << Name << "< already defined for block: >" << GetName() << "<" << endl; - DSP::log << " " << DSP::LogMode::second << "Name will be deleted before redefining" << endl; + DSP::log << " " << DSP::e::LogMode::second << "Name will be deleted before redefining" << endl; #endif UndefineOutput(Name); @@ -460,7 +460,7 @@ bool DSP::Component::DefineOutput(const string &Name, if (OutputNo_re>=NoOfOutputs) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DefineOutput" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DefineOutput" << DSP::e::LogMode::second << "Output number (realis) out too large for block: " << GetName() << endl; #endif return false; @@ -468,7 +468,7 @@ bool DSP::Component::DefineOutput(const string &Name, if (OutputNo_im>=NoOfOutputs) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DefineOutput" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DefineOutput" << DSP::e::LogMode::second << "Output number (imaginaris) out too large for block: " << GetName() << endl; #endif return false; @@ -480,9 +480,9 @@ bool DSP::Component::DefineOutput(const string &Name, if (Name.compare(DefinedOutputs[ind].get_name()) == 0) { #ifdef __DEBUG__ - DSP::log << "DefineOutput" << DSP::LogMode::second + DSP::log << "DefineOutput" << DSP::e::LogMode::second << "Name >" << Name << "< already defined for block: >" << GetName() << "<" << endl; - DSP::log << " " << DSP::LogMode::second << "Name will be deleted before redefining" << endl; + DSP::log << " " << DSP::e::LogMode::second << "Name will be deleted before redefining" << endl; #endif UndefineOutput(Name); @@ -517,7 +517,7 @@ bool DSP::Component::DefineOutput(const string &Name, const vector<unsigned int> if (Outputs[ind]>=NoOfOutputs) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DefineOutput" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DefineOutput" << DSP::e::LogMode::second << "Output number (" << ind << ") out too large for block: " << GetName() << endl; #endif return false; @@ -530,9 +530,9 @@ bool DSP::Component::DefineOutput(const string &Name, const vector<unsigned int> { #ifdef __DEBUG__ stringstream tekst; - DSP::log << "DefineOutput" << DSP::LogMode::second + DSP::log << "DefineOutput" << DSP::e::LogMode::second << "Name >" << Name << "< already defined for block: >" << GetName() << "<" << endl; - DSP::log << " " << DSP::LogMode::second << "Name will be deleted before redefining" << endl; + DSP::log << " " << DSP::e::LogMode::second << "Name will be deleted before redefining" << endl; #endif UndefineOutput(Name); @@ -591,7 +591,7 @@ bool DSP::Block::UndefineInput(const string &Name) #ifdef __DEBUG__ if (done == false) { - DSP::log << "UndefineInput" << DSP::LogMode::second + DSP::log << "UndefineInput" << DSP::e::LogMode::second << "Name >" << Name << "< was not defined for block: >" << GetName() << "<" << endl; } #endif @@ -606,7 +606,7 @@ bool DSP::Block::DefineInput(const string &Name, const unsigned int &InputNo) if (InputNo>=NoOfInputs) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DefineInput(\""+Name+"\")" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DefineInput(\""+Name+"\")" << DSP::e::LogMode::second << "Input number:" << InputNo << ", too large for block: " << GetName() << endl; #endif return false; @@ -618,9 +618,9 @@ bool DSP::Block::DefineInput(const string &Name, const unsigned int &InputNo) if (Name.compare(DefinedInputs[ind].get_name()) == 0) { #ifdef __DEBUG__ - DSP::log << "DefineInput" << DSP::LogMode::second + DSP::log << "DefineInput" << DSP::e::LogMode::second << "Name >" << Name << "< already defined for block: >" << GetName() << "<" << endl; - DSP::log << " " << DSP::LogMode::second << "Name will be deleted before redefining" << endl; + DSP::log << " " << DSP::e::LogMode::second << "Name will be deleted before redefining" << endl; #endif UndefineInput(Name); @@ -654,7 +654,7 @@ bool DSP::Block::DefineInput(const string &Name, if (InputNo_re>=NoOfInputs) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DefineInput(\"" << Name << "\")" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DefineInput(\"" << Name << "\")" << DSP::e::LogMode::second << "Input number:" << InputNo_re << ", (realis) too large for block: " << GetName() << endl; #endif return false; @@ -662,7 +662,7 @@ bool DSP::Block::DefineInput(const string &Name, if (InputNo_im>=NoOfInputs) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DefineInput(\"" << Name << "\")" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DefineInput(\"" << Name << "\")" << DSP::e::LogMode::second << "Input number " << InputNo_re << " (imaginaris) too large for block: " << GetName() << endl; #endif return false; @@ -674,9 +674,9 @@ bool DSP::Block::DefineInput(const string &Name, if (Name.compare(DefinedInputs[ind].get_name()) == 0) { #ifdef __DEBUG__ - DSP::log << "DefineInput" << DSP::LogMode::second + DSP::log << "DefineInput" << DSP::e::LogMode::second << "Name >" << Name << "< already defined for block: >" << GetName() << "<" << endl; - DSP::log << " " << DSP::LogMode::second << "Name will be deleted before redefining" << endl; + DSP::log << " " << DSP::e::LogMode::second << "Name will be deleted before redefining" << endl; #endif UndefineInput(Name); @@ -712,7 +712,7 @@ bool DSP::Block::DefineInput(const string &Name, if (Inputs[ind]>=NoOfInputs) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DefineInput(\"" << Name << "\")" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DefineInput(\"" << Name << "\")" << DSP::e::LogMode::second << "Input number:" << ind << ", too large for block: " << GetName() << endl; #endif return false; @@ -724,9 +724,9 @@ bool DSP::Block::DefineInput(const string &Name, if (Name.compare(DefinedInputs[ind].get_name()) == 0) { #ifdef __DEBUG__ - DSP::log << "DefineInput" << DSP::LogMode::second + DSP::log << "DefineInput" << DSP::e::LogMode::second << "Name >" << Name << "< already defined for block: >" << GetName() << "<" << endl; - DSP::log << " " << DSP::LogMode::second << "Name will be deleted before redefining" << endl; + DSP::log << " " << DSP::e::LogMode::second << "Name will be deleted before redefining" << endl; #endif UndefineInput(Name); @@ -764,15 +764,15 @@ DSP::output &DSP::Component::Output(const string &Name) } #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::Component::Output" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::Component::Output" << DSP::e::LogMode::second << "Block<" << this->GetName() << "> has no output named <" << Name << ">" << endl; - DSP::log << "DSP::Component::Output" << DSP::LogMode::second << "Available output names:" << endl; + DSP::log << "DSP::Component::Output" << DSP::e::LogMode::second << "Available output names:" << endl; for (ind=0; ind<DefinedOutputs.size(); ind++) { - DSP::log << "DSP::Component::Output" << DSP::LogMode::second + DSP::log << "DSP::Component::Output" << DSP::e::LogMode::second << " \"" << DefinedOutputs[ind].get_name() << "\"" << endl; } - DSP::log << DSP::LogMode::Error << "DSP::Component::Output" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::Component::Output" << DSP::e::LogMode::second << "Use one of defined outputs or define new one using DSP::Component::DefineOutput function" << endl; #endif return DSP::output::null(); @@ -783,8 +783,8 @@ DSP::input &DSP::Component::Input(const string &Name) UNUSED_ARGUMENT(Name); #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::Block::Input"; - DSP::log << DSP::LogMode::second << "Block<" << this->GetName() << "> should not have Input() method called." << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::Block::Input"; + DSP::log << DSP::e::LogMode::second << "Block<" << this->GetName() << "> should not have Input() method called." << endl; #endif return DSP::input::null(); } @@ -800,15 +800,15 @@ DSP::input &DSP::Block::Input(const string &Name) } #ifdef __DEBUG__ - DSP::log << "DSP::Block::Input" << DSP::LogMode::second + DSP::log << "DSP::Block::Input" << DSP::e::LogMode::second << "Block<" << this->GetName() << "> has no input named <" << Name << ">" << endl; - DSP::log << "DSP::Block::Input" << DSP::LogMode::second << "Available input names:" << endl; + DSP::log << "DSP::Block::Input" << DSP::e::LogMode::second << "Available input names:" << endl; for (ind=0; ind<DefinedInputs.size(); ind++) { - DSP::log << "DSP::Block::Input" << DSP::LogMode::second + DSP::log << "DSP::Block::Input" << DSP::e::LogMode::second << " \"" << DefinedInputs[ind].get_name() << "\"" << endl; } - DSP::log << DSP::LogMode::Error << "DSP::Block::Input" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::Block::Input" << DSP::e::LogMode::second << "Use one of defined inputs or define new one using DSP::Block::DefineInput function" << endl; #endif return DSP::input::null(); @@ -846,8 +846,8 @@ bool DSP::_connect_class::connect(const DSP::output &output, const DSP::input &i << ", output:" << output.get_name() << "(" << output.Outputs.size() << ") -> NULL input"; } - DSP::log << "DSP::_connect_class::connect" << DSP::LogMode::second << tekst.str() << endl; - DSP::log << DSP::LogMode::Error << "DSP::_connect_class::connect" << DSP::LogMode::second << "At least one of the input parameters is NULL" << endl; + DSP::log << "DSP::_connect_class::connect" << DSP::e::LogMode::second << tekst.str() << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::_connect_class::connect" << DSP::e::LogMode::second << "At least one of the input parameters is NULL" << endl; #endif return false; } @@ -855,7 +855,7 @@ bool DSP::_connect_class::connect(const DSP::output &output, const DSP::input &i if (output.Outputs.size() != input.Inputs.size()) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::_connect_class::connect" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::_connect_class::connect" << DSP::e::LogMode::second << "block <" << output.component->GetName() << "> has output <" << output.get_name() << "> with different number of output lines (=" << output.Outputs.size() @@ -901,7 +901,7 @@ bool DSP::_connect_class::splitconnect(const DSP::output &output, const DSP::inp // if ((output == NULL) || (input == NULL)) // { // #ifdef __DEBUG__ -// DSP::log << DSP::LogMode::Error << "DSP::_connect_class::splitconnect", "DSP::_connect_class::splitconnect error: at least one of inputs doesn't exist"); +// DSP::log << DSP::e::LogMode::Error << "DSP::_connect_class::splitconnect", "DSP::_connect_class::splitconnect error: at least one of inputs doesn't exist"); // #endif // return false; // } @@ -909,7 +909,7 @@ bool DSP::_connect_class::splitconnect(const DSP::output &output, const DSP::inp if (output.Outputs.size() != input.Inputs.size()) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::_connect_class::splitconnect" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::_connect_class::splitconnect" << DSP::e::LogMode::second << "block >" << output.component->GetName() << "< has output >" << output.get_name() << "< with different number of output lines (" << output.Outputs.size() @@ -1011,7 +1011,7 @@ bool DSP::_connect_class::splitconnect(const DSP::output &output, const DSP::inp (destCopy == NULL) ) { // IN -> ANY(block) ==> OUT.with_clear_input #ifdef __DEBUG__SPLIT__ - DSP::log << DSP::LogMode::Error << "DSP::_connect_class::splitconnect", "Reconfiguration: 5c, 11a"); + DSP::log << DSP::e::LogMode::Error << "DSP::_connect_class::splitconnect", "Reconfiguration: 5c, 11a"); #endif @@ -1047,7 +1047,7 @@ bool DSP::_connect_class::splitconnect(const DSP::output &output, const DSP::inp (destCopy == NULL) && (is_dest_auto == true) ) { // INauto ==> OUTauto #ifdef __DEBUG__SPLIT__ - DSP::log << DSP::LogMode::Error << "DSP::_connect_class::splitconnect", "Reconfiguration: 5c2, 11b"); + DSP::log << DSP::e::LogMode::Error << "DSP::_connect_class::splitconnect", "Reconfiguration: 5c2, 11b"); #endif // +++++++++++++++++++++++++++++++++++++++++++++++++ // @@ -1087,7 +1087,7 @@ bool DSP::_connect_class::splitconnect(const DSP::output &output, const DSP::inp if ((sourceCopy == NULL) && (destCopy != NULL)) { #ifdef __DEBUG__SPLIT__ - DSP::log << DSP::LogMode::Error << "DSP::_connect_class::splitconnect", "CopyUpdate: 3, 6, 4"); + DSP::log << DSP::e::LogMode::Error << "DSP::_connect_class::splitconnect", "CopyUpdate: 3, 6, 4"); #endif // update destCOPY input @@ -1098,7 +1098,7 @@ bool DSP::_connect_class::splitconnect(const DSP::output &output, const DSP::inp if ((sourceCopy != NULL) && (destCopy == NULL)) { #ifdef __DEBUG__SPLIT__ - DSP::log << DSP::LogMode::Error << "DSP::_connect_class::splitconnect", "CopyUpdate: 8, 9"); + DSP::log << DSP::e::LogMode::Error << "DSP::_connect_class::splitconnect", "CopyUpdate: 8, 9"); #endif // update sourceCOPY output @@ -1115,7 +1115,7 @@ bool DSP::_connect_class::splitconnect(const DSP::output &output, const DSP::inp if ((sourceCopy != NULL) && (destCopy != NULL)) { #ifdef __DEBUG__SPLIT__ - DSP::log << DSP::LogMode::Error << "DSP::_connect_class::splitconnect", "CopyUpdate: 12, 13"); + DSP::log << DSP::e::LogMode::Error << "DSP::_connect_class::splitconnect", "CopyUpdate: 12, 13"); #endif // update destCOPY input @@ -1142,7 +1142,7 @@ bool DSP::_connect_class::splitconnect(const DSP::output &output, const DSP::inp { // 2. IN.with_clear_output ==> OUT.with_clear_input : just connect #ifdef __DEBUG__SPLIT__ - DSP::log << DSP::LogMode::Error << "DSP::_connect_class::splitconnect", "2"); + DSP::log << DSP::e::LogMode::Error << "DSP::_connect_class::splitconnect", "2"); #endif // Connect(IN, OUT) @@ -1157,7 +1157,7 @@ bool DSP::_connect_class::splitconnect(const DSP::output &output, const DSP::inp (dest_block != NULL) ) { // INauto ==> OUT.with_clear_input #ifdef __DEBUG__SPLIT__ - DSP::log << DSP::LogMode::Error << "DSP::_connect_class::splitconnect", "5a"); + DSP::log << DSP::e::LogMode::Error << "DSP::_connect_class::splitconnect", "5a"); #endif // AddLine(INauto, OUT) @@ -1180,7 +1180,7 @@ bool DSP::_connect_class::splitconnect(const DSP::output &output, const DSP::inp // 5b : (sourceCopy == NULL) // 11c : (sourceCopy != NULL) #ifdef __DEBUG__SPLIT__ - DSP::log << DSP::LogMode::Error << "DSP::_connect_class::splitconnect", "5b, 11c"); + DSP::log << DSP::e::LogMode::Error << "DSP::_connect_class::splitconnect", "5b, 11c"); #endif // AddLine(Auto, OUT) @@ -1201,7 +1201,7 @@ bool DSP::_connect_class::splitconnect(const DSP::output &output, const DSP::inp (dest_block != NULL) ) { // IN -> ANY(block) ==> OUT.with_clear_input #ifdef __DEBUG__SPLIT__ - DSP::log << DSP::LogMode::Error << "DSP::_connect_class::splitconnect", "5c"); + DSP::log << DSP::e::LogMode::Error << "DSP::_connect_class::splitconnect", "5c"); #endif @@ -1236,7 +1236,7 @@ bool DSP::_connect_class::splitconnect(const DSP::output &output, const DSP::inp (dest_block != NULL) && (is_dest_auto == true) ) { // INauto ==> OUTauto #ifdef __DEBUG__SPLIT__ - DSP::log << DSP::LogMode::Error << "DSP::_connect_class::splitconnect", "5a2"); + DSP::log << DSP::e::LogMode::Error << "DSP::_connect_class::splitconnect", "5a2"); #endif // Merge(INauto, OUTauto) @@ -1265,7 +1265,7 @@ bool DSP::_connect_class::splitconnect(const DSP::output &output, const DSP::inp // 5b2: (sourceCopy == NULL) // 11d: (sourceCopy != NULL) #ifdef __DEBUG__SPLIT__ - DSP::log << DSP::LogMode::Error << "DSP::_connect_class::splitconnect", "5b2, 11d"); + DSP::log << DSP::e::LogMode::Error << "DSP::_connect_class::splitconnect", "5b2, 11d"); #endif // Merge(INauto, OUTauto) @@ -1292,7 +1292,7 @@ bool DSP::_connect_class::splitconnect(const DSP::output &output, const DSP::inp (dest_block != NULL) && (is_dest_auto == true) ) { // INauto ==> OUTauto #ifdef __DEBUG__SPLIT__ - DSP::log << DSP::LogMode::Error << "DSP::_connect_class::splitconnect", "5c2"); + DSP::log << DSP::e::LogMode::Error << "DSP::_connect_class::splitconnect", "5c2"); #endif // +++++++++++++++++++++++++++++++++++++++++++++++++ // @@ -1579,7 +1579,7 @@ void DSP::Component::UnregisterComponent(void) #ifdef __DEBUG__ else { - DSP::log << DSP::LogMode::Error << "UnregisterComponent" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "UnregisterComponent" << DSP::e::LogMode::second << "WARNING: trying unregister component (" << this->GetName() << ") which is not in the ComponentsTable." << endl; } #endif @@ -1656,7 +1656,7 @@ bool DSP::Block::SetConstInput(const string &InputName, DSP::Float value) if (BlockAllowsForConstantInputs == false) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::Block::SetConstInput" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::Block::SetConstInput" << DSP::e::LogMode::second << "Block >>" << GetName() << "<< doesn't support constant inputs !!!" << endl; #endif return false; @@ -1711,7 +1711,7 @@ bool DSP::Block::SetConstInput(const string &InputName, DSP::Float real_value, D if (BlockAllowsForConstantInputs == false) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::Block::SetConstInput" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::Block::SetConstInput" << DSP::e::LogMode::second << "Block >>" << GetName() << "<< doesn't support for constant inputs !!!" << endl; #endif return false; @@ -1903,7 +1903,7 @@ void DSP::Source::RegisterOutputClock(DSP::Clock_ptr OutputClock, unsigned int o if (OutputClock == NULL) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::Source::RegisterOutputClock" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::Source::RegisterOutputClock" << DSP::e::LogMode::second << "Attempt to register source <" << GetName() << "> to NULL clock (output_index = " << output_index << ")" << endl; #endif @@ -1912,7 +1912,7 @@ void DSP::Source::RegisterOutputClock(DSP::Clock_ptr OutputClock, unsigned int o if (output_index >= NoOfOutputs) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::Source::RegisterOutputClock" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::Source::RegisterOutputClock" << DSP::e::LogMode::second << "Attempt to register source output with index out of range = " << output_index << endl; #endif return; @@ -1943,7 +1943,7 @@ void DSP::Component::RegisterForNotification(DSP::Clock_ptr NotifyClock) if (NotifyClock == NULL) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::Source::RegisterClockForNotification" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::Source::RegisterClockForNotification" << DSP::e::LogMode::second << "Attempt to register source <" << GetName() << "> to NULL clock" << endl; #endif return; @@ -1973,7 +1973,7 @@ bool DSP::Component::SetOutput(unsigned int OutputNo, DSP::Component_ptr compone if (OutputNo >= NoOfOutputs) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::Component::SetOutput" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::Component::SetOutput" << DSP::e::LogMode::second << "Can't connect output (" << GetName() << ":" << OutputNo << ") to input (" << component->GetName() << ":" << InputNo << "). " "Such an output doesn't exist - too large output number." << endl; @@ -1984,7 +1984,7 @@ bool DSP::Component::SetOutput(unsigned int OutputNo, DSP::Component_ptr compone if (component == NULL) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::Component::SetOutput" << DSP::LogMode::second << "Can't connect to input. Output block not specified (NULL)." << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::Component::SetOutput" << DSP::e::LogMode::second << "Can't connect to input. Output block not specified (NULL)." << endl; #endif return false; } @@ -1993,7 +1993,7 @@ bool DSP::Component::SetOutput(unsigned int OutputNo, DSP::Component_ptr compone if (tempBlock == NULL) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::Component::SetOutput" << DSP::LogMode::second << "Can't connect to input. Output component is the source (no inputs)." << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::Component::SetOutput" << DSP::e::LogMode::second << "Can't connect to input. Output component is the source (no inputs)." << endl; #endif return false; } @@ -2001,7 +2001,7 @@ bool DSP::Component::SetOutput(unsigned int OutputNo, DSP::Component_ptr compone if (InputNo >= tempBlock->NoOfInputs) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::Component::SetOutput" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::Component::SetOutput" << DSP::e::LogMode::second << "Can't connect output (" << component->GetName() << ":" << InputNo << ") to input (" << GetName() << ":"<< OutputNo << "). Input (" << component->GetName() << ":" << InputNo @@ -2018,7 +2018,7 @@ bool DSP::Component::SetOutput(unsigned int OutputNo, DSP::Component_ptr compone if (tempCopy->GetCopyOutput(InputNo, output_block, output_block_input_no) == true) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::Component::SetOutput" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::Component::SetOutput" << DSP::e::LogMode::second << "Can't connect output (" << GetName() << ":" << OutputNo << ") to input(DSP::u::Copy) (" << component->GetName() << ":" << InputNo << "). DSP::u::Copy Output (" << tempCopy->GetName() << ":" << InputNo @@ -2029,7 +2029,7 @@ bool DSP::Component::SetOutput(unsigned int OutputNo, DSP::Component_ptr compone else { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::Component::SetOutput" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::Component::SetOutput" << DSP::e::LogMode::second << "Can't connect output (" << GetName() << ":" << OutputNo << ") to input (" << component->GetName() << ":" << InputNo << "). Output (" << GetName() << ":" << OutputNo @@ -2043,7 +2043,7 @@ bool DSP::Component::SetOutput(unsigned int OutputNo, DSP::Component_ptr compone if (tempBlock->NoOfInputs == 0) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::Component::SetOutput" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::Component::SetOutput" << DSP::e::LogMode::second << "Cant't connect output (" << GetName() << ":" << OutputNo << ") to input (" << component->GetName() << ":" << InputNo << "). " "Destination component has no inputs!" << endl; @@ -2054,7 +2054,7 @@ bool DSP::Component::SetOutput(unsigned int OutputNo, DSP::Component_ptr compone if (!(tempBlock->IsInputAvailable(InputNo))) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::Component::SetOutput" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::Component::SetOutput" << DSP::e::LogMode::second << "Cant't connect output (" << GetName() << ":" << OutputNo << ") to input (" << component->GetName() << ":" << InputNo << "). Something is already connected to input (" @@ -2077,7 +2077,7 @@ bool DSP::Component::SetOutput(unsigned int OutputNo, DSP::Component_ptr compone if (tempCopy->GetCopyInput(OutputNo, input_block, input_block_output_no) == false) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::Component::SetOutput" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::Component::SetOutput" << DSP::e::LogMode::second << "GetCopyInput(" << tempCopy->GetName() << ":" << InputNo << ") failed!" << endl; #endif return false; @@ -2098,7 +2098,7 @@ bool DSP::Component::SetOutput(unsigned int OutputNo, DSP::Component_ptr compone if (tempCopy->GetCopyOutput(InputNo, output_block, output_block_input_no) == false) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::Component::SetOutput" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::Component::SetOutput" << DSP::e::LogMode::second << "GetCopyOutput(" << tempCopy->GetName() << ":" << OutputNo << ") failed!" << endl; #endif return false; @@ -2132,7 +2132,7 @@ bool DSP::Block::ClearInput(unsigned int InputNo) if (NoOfInputsConnected <= 0) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::Block::ClearInput" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::Block::ClearInput" << DSP::e::LogMode::second << "ClearInput: Input (" << GetName() << ":" << InputNo << ") must have already been cleared !!!" << endl; #endif } @@ -2232,7 +2232,7 @@ DSP::Clock_ptr DSP::clock_groups::FindClock4Input(const std::string &group_name, if (L == 0) { - DSP::log << DSP::LogMode::Error << "DSP::clock_groups::FindClock4Input" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::clock_groups::FindClock4Input" << DSP::e::LogMode::second << "there is no clocks' groups relation defined for given reference group and input index" << endl; return NULL; } @@ -2272,7 +2272,7 @@ DSP::Clock_ptr DSP::clock_groups::FindClock4Output(const std::string &group_name if (L == 0) { - DSP::log << DSP::LogMode::Error << "DSP::clock_groups::FindClock4Input" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::clock_groups::FindClock4Input" << DSP::e::LogMode::second << "there is no clocks' groups relation defined for given reference group and input index" << endl; return reference_clock; } @@ -2474,7 +2474,7 @@ void DSP::Block::SetBlockInputClock(unsigned int InputNo, DSP::Clock_ptr InputCl if (ClockGroups.groups.empty() == true) { // create group "all" containing all blocks' inputs and outputs #ifdef __DEBUG__ - DSP::log << "DSP::Block::SetBlockInputClock" << DSP::LogMode::second + DSP::log << "DSP::Block::SetBlockInputClock" << DSP::e::LogMode::second << "creating clock group >>all<< for block " << GetName() << endl; #endif // __DEBUG__ if (NoOfInputs > 0) @@ -2538,7 +2538,7 @@ void DSP::Block::SetBlockInputClock(unsigned int InputNo, DSP::Clock_ptr InputCl #ifdef __DEBUG__ if (InputClocks[InputNo] != NULL) { - DSP::log << DSP::LogMode::Error << "Input clock has been already set" << endl; + DSP::log << DSP::e::LogMode::Error << "Input clock has been already set" << endl; } #endif // __DEBUG__ @@ -2553,7 +2553,7 @@ void DSP::Block::SetBlockInputClock(unsigned int InputNo, DSP::Clock_ptr InputCl #ifdef __DEBUG__ if (ClockGroups.groups[reference_input_group_name].GroupClock != InputClock) { - DSP::log << DSP::LogMode::Error << GetName() << DSP::LogMode::second << "Group clock has been already set to different value." << endl; + DSP::log << DSP::e::LogMode::Error << GetName() << DSP::e::LogMode::second << "Group clock has been already set to different value." << endl; } #endif } @@ -2588,7 +2588,7 @@ void DSP::Block::SetBlockInputClock(unsigned int InputNo, DSP::Clock_ptr InputCl } else { - DSP::log << "DSP::Block::SetBlockInputClock" << DSP::LogMode::second + DSP::log << "DSP::Block::SetBlockInputClock" << DSP::e::LogMode::second << "In block <" << GetName() << "> There is no group defined for input number " << ind << endl; tmp_InputClock = InputClock; } @@ -2602,7 +2602,7 @@ void DSP::Block::SetBlockInputClock(unsigned int InputNo, DSP::Clock_ptr InputCl if (AllOK == false) { - DSP::log << DSP::LogMode::Error << "SetBlockInputClock" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "SetBlockInputClock" << DSP::e::LogMode::second << "Input clocks mismatch in block (" << GetName() << ") possibly at input (" << InputNo << ")" << endl; } @@ -2623,7 +2623,7 @@ void DSP::Block::SetBlockInputClock(unsigned int InputNo, DSP::Clock_ptr InputCl } else { - DSP::log << "DSP::Block::SetBlockInputClock" << DSP::LogMode::second + DSP::log << "DSP::Block::SetBlockInputClock" << DSP::e::LogMode::second << "In block <" << GetName() << "> There is no group defined for output number " << ind << endl; tmp_OutputClock = InputClock; } @@ -2637,7 +2637,7 @@ void DSP::Block::SetBlockInputClock(unsigned int InputNo, DSP::Clock_ptr InputCl if (OutputClocks[ind]!=tmp_OutputClock) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "SetBlockInputClock" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "SetBlockInputClock" << DSP::e::LogMode::second << "Input clock differs from output clock for (" << GetName() << ":" << ind << ") probably at input (" << InputNo << ")!!!" << endl; @@ -2673,7 +2673,7 @@ void DSP::Block::SetBlockInputClock(unsigned int InputNo, DSP::Clock_ptr InputCl if (OutputClocks[0]!=tmp_OutputClock) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "SetBlockInputClock" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "SetBlockInputClock" << DSP::e::LogMode::second << "Input clock differs from output clock for (" << GetName() << ") probably at input (" << InputNo << ") \n" " >> Master clock index: " << tmp_OutputClock->MasterClockIndex @@ -2739,7 +2739,7 @@ bool DSP::Block::IsInputAvailable(unsigned int InputNo) if (IsConstantInput[InputNo] == true) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "IsInputAvailable" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "IsInputAvailable" << DSP::e::LogMode::second << "tried to connect to constant input (" << this->GetName() << ":" << InputNo << ")" << endl; #endif @@ -2752,7 +2752,7 @@ bool DSP::Block::IsInputAvailable(unsigned int InputNo) else { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "IsInputAvailable" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "IsInputAvailable" << DSP::e::LogMode::second << "There is output (" << tempComponent->GetName() << ":" << tempNo << ") already connected to this input (" << this->GetName() << ":" << InputNo << ")" << endl; @@ -2994,7 +2994,7 @@ bool DSP::Block::GetMultirateFactorsFromClocks( #ifdef __DEBUG__ if (ClocksShouldBeSynchronous == true) { - DSP::log << DSP::LogMode::Error << "DSP::Block::GetMultirateFactorsFromClocks" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::Block::GetMultirateFactorsFromClocks" << DSP::e::LogMode::second << "Detected asynchronous clock in component >>" << GetName() << "<< !!!" << endl; } #endif @@ -3005,13 +3005,13 @@ bool DSP::Block::GetMultirateFactorsFromClocks( in_L = InputClock->L; in_M = InputClock->M; #ifdef __DEBUG__ if ((in_L == 0) || (in_M == 0)) - DSP::log << DSP::LogMode::Error << "DSP::Block::GetMultirateFactorsFromClocks", "(in_L == 0) || (in_M == 0)"); + DSP::log << DSP::e::LogMode::Error << "DSP::Block::GetMultirateFactorsFromClocks", "(in_L == 0) || (in_M == 0)"); #endif if (in_L == 0) in_L = 1; if (in_M == 0) in_M = 1; // Input clock might be the master clock out_L = OutputClock->L; out_M = OutputClock->M; #ifdef __DEBUG__ if ((out_L == 0) || (out_M == 0)) - DSP::log << DSP::LogMode::Error << "DSP::Block::GetMultirateFactorsFromClocks", "(out_L == 0) || (out_M == 0)"); + DSP::log << DSP::e::LogMode::Error << "DSP::Block::GetMultirateFactorsFromClocks", "(out_L == 0) || (out_M == 0)"); #endif if (out_L == 0) out_L = 1; if (out_M == 0) out_M = 1; // Output clock might be the master clock @@ -3143,7 +3143,7 @@ bool DSP::u::LoopDelay::SetState(const string &InputName, unsigned int size, DSP else { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::u::LoopDelay::SetState" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::u::LoopDelay::SetState" << DSP::e::LogMode::second << "Block >>" << GetName() << "<< - state buffer == NULL" << endl; #endif return false; @@ -3152,7 +3152,7 @@ bool DSP::u::LoopDelay::SetState(const string &InputName, unsigned int size, DSP else { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::u::LoopDelay::SetState" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::u::LoopDelay::SetState" << DSP::e::LogMode::second << "Block >>" << GetName() << "<< - wrong state buffer size: " << size << " instead of " << Delay[InputNo] << endl; #endif return false; @@ -3163,7 +3163,7 @@ bool DSP::u::LoopDelay::SetState(const string &InputName, unsigned int size, DSP if (BlockAllowsForConstantInputs == false) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::u::LoopDelay::SetState" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::u::LoopDelay::SetState" << DSP::e::LogMode::second << "Block >>" << GetName() << "<< doesn't support input >>" << InputName << "<< !!!" << endl; #endif return false; @@ -4314,7 +4314,7 @@ void DSP::u::Amplifier::SetGain(DSP::Complex gain) else { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::u::Amplifier::SetGain" << DSP::LogMode::second << "Attemt to set complex gain factor for block with real gain factor" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::Amplifier::SetGain" << DSP::e::LogMode::second << "Attemt to set complex gain factor for block with real gain factor" << endl; #endif Coeficient=gain.re; } @@ -4474,7 +4474,7 @@ DSP::u::Power::Power(bool IsComplex, int factor) { factor = 0; #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::u::Power::Power(true,int)" << DSP::LogMode::second << "negative power factor not allowed" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::Power::Power(true,int)" << DSP::e::LogMode::second << "negative power factor not allowed" << endl; #endif } @@ -4548,7 +4548,7 @@ DSP::u::Power::Power(bool IsComplex, DSP::Float factor) ClockGroups.AddOutputs2Group("all", 0, NoOfOutputs-1); #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::u::Power::Power(true,DSP::Float)" << DSP::LogMode::second << "real power factor for complex input is not allowed" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::Power::Power(true,DSP::Float)" << DSP::e::LogMode::second << "real power factor for complex input is not allowed" << endl; #endif IntFactor = (int)factor; @@ -5007,7 +5007,7 @@ DSP::u::RawDecimator::RawDecimator(DSP::Clock_ptr ParentClock, } else { - DSP::log << DSP::LogMode::Error << "DSP::u::RawDecimator" << DSP::LogMode::second << "Undefined ParentClock" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::RawDecimator" << DSP::e::LogMode::second << "Undefined ParentClock" << endl; return; } @@ -5132,7 +5132,7 @@ void DSP::u::Zeroinserter::Init(bool IsInputComplex, DSP::Clock_ptr ParentClock, else { // OutputClocks[0]=DSP::Clock::GetClock(L, 1); - DSP::log << DSP::LogMode::Error << "DSP::u::Zeroinserter" << DSP::LogMode::second << "Undefined ParentClock" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::Zeroinserter" << DSP::e::LogMode::second << "Undefined ParentClock" << endl; return; } @@ -6077,7 +6077,7 @@ void DSP::u::FIR::Init(bool IsInputComplex, bool AreCoeficientsComplex, if (n0 < 0) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::u::FIR::Init" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::u::FIR::Init" << DSP::e::LogMode::second << "n0 (=" << n0 << ") must be in range <0, N_in-1>" << endl; #endif n0 = 0; @@ -6085,7 +6085,7 @@ void DSP::u::FIR::Init(bool IsInputComplex, bool AreCoeficientsComplex, if (M < 1) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::u::FIR::Init" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::u::FIR::Init" << DSP::e::LogMode::second << "M (=" << M << ") must be in range > 0" << endl; #endif M = 1; @@ -6110,7 +6110,7 @@ void DSP::u::FIR::Init(bool IsInputComplex, bool AreCoeficientsComplex, { L_step = 1; #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::u::FIR::Init" << DSP::LogMode::second << "L must be >= 1" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::FIR::Init" << DSP::e::LogMode::second << "L must be >= 1" << endl; #endif } @@ -6209,7 +6209,7 @@ void DSP::u::FIR::Init(bool IsInputComplex, bool AreCoeficientsComplex, else { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::u::FIR:Init" << DSP::LogMode::second << "unsupported shaping filter mode" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::FIR:Init" << DSP::e::LogMode::second << "unsupported shaping filter mode" << endl; #endif } } @@ -6877,7 +6877,7 @@ bool DSP::u::IIR::SetCoefs(DSP::Float_vector &a_in, if (required_FilterOrder > FilterOrder) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::u::IIR::SetCoefs<DSP::Float_vector>" << DSP::LogMode::second << "Too many coefficients for current filter order" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::IIR::SetCoefs<DSP::Float_vector>" << DSP::e::LogMode::second << "Too many coefficients for current filter order" << endl; #endif return false; } @@ -6923,7 +6923,7 @@ bool DSP::u::IIR::SetCoefs(DSP::Complex_vector &a_in, if (required_FilterOrder > FilterOrder) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::u::IIR::SetCoefs<DSP::Complex_vector>" << DSP::LogMode::second << "Too many coefficients for current filter order" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::IIR::SetCoefs<DSP::Complex_vector>" << DSP::e::LogMode::second << "Too many coefficients for current filter order" << endl; #endif return false; } @@ -7674,7 +7674,7 @@ void DSP::u::DDScos::SetAngularFrequency(DSP::Float omega) } #ifdef __DEBUG__ else - DSP::log << "DSP::u::DDScos::SetAngularFrequency" << DSP::LogMode::second << "Cannot change frequency - associated with input" << endl; + DSP::log << "DSP::u::DDScos::SetAngularFrequency" << DSP::e::LogMode::second << "Cannot change frequency - associated with input" << endl; #endif } @@ -7687,7 +7687,7 @@ void DSP::u::DDScos::SetAmplitude(DSP::Float amplitude) } #ifdef __DEBUG__ else - DSP::log << "DSP::u::DDScos::SetAmplitude" << DSP::LogMode::second << "Cannot change amplitude - associated with input" << endl; + DSP::log << "DSP::u::DDScos::SetAmplitude" << DSP::e::LogMode::second << "Cannot change amplitude - associated with input" << endl; #endif } @@ -7819,7 +7819,7 @@ void DSP::u::SamplingRateConversion::Init(bool IsInputComplex, else { // OutputClocks[0]=DSP::Clock::GetClock(L, M); - DSP::log << DSP::LogMode::Error << "DSP::u::SamplingRateConversion" << DSP::LogMode::second << "Undefined ParentClock" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::SamplingRateConversion" << DSP::e::LogMode::second << "Undefined ParentClock" << endl; return; } @@ -7891,7 +7891,7 @@ void DSP::u::SamplingRateConversion::Init(bool IsInputComplex, else { // OutputClocks[0]=DSP::Clock::GetClock(L, M); - DSP::log << DSP::LogMode::Error << "DSP::u::SamplingRateConversion" << DSP::LogMode::second << "Undefined ParentClock" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::SamplingRateConversion" << DSP::e::LogMode::second << "Undefined ParentClock" << endl; return; } @@ -8930,10 +8930,10 @@ void DSP::u::SampleSelector::Init(DSP::Clock_ptr ParentClock, else { if (ActivateOutputClock == false) - DSP::log << "DSP::u::SampleSelector" << DSP::LogMode::second << "Warning: undefined OutputClock" << endl; + DSP::log << "DSP::u::SampleSelector" << DSP::e::LogMode::second << "Warning: undefined OutputClock" << endl; else { - DSP::log << DSP::LogMode::Error << "DSP::u::SampleSelector" << DSP::LogMode::second << "undefined OutputClock" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::SampleSelector" << DSP::e::LogMode::second << "undefined OutputClock" << endl; return; } } @@ -8955,7 +8955,7 @@ void DSP::u::SampleSelector::Init(DSP::Clock_ptr ParentClock, #ifdef __DEBUG__ if (ParentClock == NULL) { - DSP::log << DSP::LogMode::Error << "DSP::u::SampleSelector" << DSP::LogMode::second << "undefined ParentClock" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::SampleSelector" << DSP::e::LogMode::second << "undefined ParentClock" << endl; return; } #endif @@ -8971,13 +8971,13 @@ void DSP::u::SampleSelector::Init(DSP::Clock_ptr ParentClock, if (ParentClock == NULL) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::u::SampleSelector" << DSP::LogMode::second << "undefined ParentClock" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::SampleSelector" << DSP::e::LogMode::second << "undefined ParentClock" << endl; #endif return; } #ifdef __DEBUG__ if (ParentClock->GetMasterClockIndex() == OutputClock->GetMasterClockIndex()) - DSP::log << "DSP::u::SampleSelector" << DSP::LogMode::second << "ParentClock and OutputClock have the same MasterClock" << endl; + DSP::log << "DSP::u::SampleSelector" << DSP::e::LogMode::second << "ParentClock and OutputClock have the same MasterClock" << endl; #endif MasterClockIndex = ParentClock->GetMasterClockIndex(); SignalActivatedClock = OutputClock; @@ -9136,7 +9136,7 @@ DSP::u::Hold::Hold(DSP::Clock_ptr InputClock, DSP::Clock_ptr OutputClock, if (InputClock == NULL) { - DSP::log << DSP::LogMode::Error << "DSP::u::Hold" << DSP::LogMode::second << "Undefined InputClock (AutoUpdate not implemented yet)" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::Hold" << DSP::e::LogMode::second << "Undefined InputClock (AutoUpdate not implemented yet)" << endl; return; } else @@ -9144,7 +9144,7 @@ DSP::u::Hold::Hold(DSP::Clock_ptr InputClock, DSP::Clock_ptr OutputClock, if (InputClock->GetMasterClockIndex() == OutputClock->GetMasterClockIndex()) { #ifdef __DEBUG__ - DSP::log << "DSP::u::Hold::Hold" << DSP::LogMode::second << "WARNING: InputClock and OutputClock have the same MasterClock" << endl; + DSP::log << "DSP::u::Hold::Hold" << DSP::e::LogMode::second << "WARNING: InputClock and OutputClock have the same MasterClock" << endl; #endif RegisterForNotification(InputClock); } @@ -9223,7 +9223,7 @@ bool DSP::u::Hold::OutputExecute(OUTPUT_EXECUTE_ARGS) #ifdef __DEBUG__ if (clock == ((DSP::u::Hold *)source)->InputClocks[0]) { - DSP::log << "DSP::u::Hold::Execute(DSP::Clock_ptr clock)" << DSP::LogMode::second << "WARNING: InputClock expected !!!" << endl; + DSP::log << "DSP::u::Hold::Execute(DSP::Clock_ptr clock)" << DSP::e::LogMode::second << "WARNING: InputClock expected !!!" << endl; } #endif return true; @@ -9462,7 +9462,7 @@ DSP::u::Multiplexer::Multiplexer(DSP::Clock_ptr ParentClock, else { // OutputClocks[0]=DSP::Clock::GetClock(L, 1); - DSP::log << DSP::LogMode::Error << "DSP::u::Multiplexer" << DSP::LogMode::second << "Undefined ParentClock" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::Multiplexer" << DSP::e::LogMode::second << "Undefined ParentClock" << endl; return; } @@ -9967,7 +9967,7 @@ void DSP::u::CrossSwitch::InputExecute(INPUT_EXECUTE_ARGS) #ifdef __DEBUG__ default: - DSP::log << DSP::LogMode::Error << "DSP::u::CrossSwitch::Execute" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::u::CrossSwitch::Execute" << DSP::e::LogMode::second << "Unexpected state for block: >" << ((DSP::u::CrossSwitch *)block)->GetName() << "<" << endl; break; #endif @@ -10088,7 +10088,7 @@ void DSP::u::Differator::SetInitialState(const DSP::Float_vector &State_init) if (State_init.size() > NoOfInputs) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::u::Differator::SetInitialState" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::u::Differator::SetInitialState" << DSP::e::LogMode::second << "ABORDING: length(" << State_init.size() << ") > size of internal state(" << NoOfInputs << ")" << endl; #endif return; @@ -10096,7 +10096,7 @@ void DSP::u::Differator::SetInitialState(const DSP::Float_vector &State_init) if (State_init.size() < NoOfInputs) { #ifdef __DEBUG__ - DSP::log << "DSP::u::Differator::SetInitialState" << DSP::LogMode::second + DSP::log << "DSP::u::Differator::SetInitialState" << DSP::e::LogMode::second << "length(" << State_init.size() << ") < size of internal state(" << NoOfInputs << ")" << endl; #endif } @@ -10260,7 +10260,7 @@ void DSP::u::Accumulator::SetInitialState(const DSP::Float_vector &State_init) if (State_init.size() > NoOfInputs) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::u::Accumulator::SetInitialState"<< DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::u::Accumulator::SetInitialState"<< DSP::e::LogMode::second << "ABORTING: length(" << State_init.size() << ") > size of internal state(" << NoOfInputs << ")" << endl; #endif return; @@ -10268,7 +10268,7 @@ void DSP::u::Accumulator::SetInitialState(const DSP::Float_vector &State_init) if (State_init.size() < NoOfInputs) { #ifdef __DEBUG__ - DSP::log << "DSP::u::Accumulator::SetInitialState" << DSP::LogMode::second + DSP::log << "DSP::u::Accumulator::SetInitialState" << DSP::e::LogMode::second << "length(" << State_init.size() << ") < size of internal state(" << NoOfInputs << ")" << endl; #endif } @@ -10337,17 +10337,17 @@ DSP::u::ClockTrigger::ClockTrigger(DSP::Clock_ptr ParentClock, DSP::Clock_ptr Si #ifdef __DEBUG__ if (ParentClock == NULL) { - DSP::log << DSP::LogMode::Error << "DSP::u::ClockTrigger::ClockTrigger" << DSP::LogMode::second << "ParentClock is NULL" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::ClockTrigger::ClockTrigger" << DSP::e::LogMode::second << "ParentClock is NULL" << endl; return; } if (SignalActivatedClock_in == NULL) { - DSP::log << DSP::LogMode::Error << "DSP::u::ClockTrigger::ClockTrigger" << DSP::LogMode::second << "SignalActivatedClock is NULL" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::ClockTrigger::ClockTrigger" << DSP::e::LogMode::second << "SignalActivatedClock is NULL" << endl; return; } if (NoOfCycles_in <= 0) { - DSP::log << "DSP::u::ClockTrigger::ClockTrigger" << DSP::LogMode::second << "NoOfCycles <= 0 - \"act\" signal determines number of cycles of activated clock" << endl; + DSP::log << "DSP::u::ClockTrigger::ClockTrigger" << DSP::e::LogMode::second << "NoOfCycles <= 0 - \"act\" signal determines number of cycles of activated clock" << endl; } #endif MasterClockIndex = ParentClock->GetMasterClockIndex(); @@ -10376,7 +10376,7 @@ void DSP::u::ClockTrigger::InputExecute(INPUT_EXECUTE_ARGS) #ifdef __DEBUG__ if (THIS->InputClocks[0]->GetMasterClockIndex() != THIS->MasterClockIndex) { - DSP::log << DSP::LogMode::Error << "DSP::u::ClockTrigger::Execute" << DSP::LogMode::second << "Declared MasterClock and actual MasterClock are different" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::ClockTrigger::Execute" << DSP::e::LogMode::second << "Declared MasterClock and actual MasterClock are different" << endl; } #endif DSP::Clock::AddSignalActivatedClock( @@ -10397,7 +10397,7 @@ void DSP::u::ClockTrigger::InputExecute_multivalue(INPUT_EXECUTE_ARGS) #ifdef __DEBUG__ if (THIS->InputClocks[0]->GetMasterClockIndex() != THIS->MasterClockIndex) { - DSP::log << DSP::LogMode::Error << "DSP::u::ClockTrigger::Execute" << DSP::LogMode::second << "Declared MasterClock and actual MasterClock are different" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::ClockTrigger::Execute" << DSP::e::LogMode::second << "Declared MasterClock and actual MasterClock are different" << endl; } #endif DSP::Clock::AddSignalActivatedClock( @@ -10476,7 +10476,7 @@ void DSP::Component::ListComponents(DSP::Clock_ptr InputClock) if (ComponentsTable[ind]->Convert2Block()->IsConstantInput[ind2] == false) { if (ComponentsTable[ind]->Convert2Block()->InputClocks[ind2] == InputClock) - DSP::log << " >>block" << DSP::LogMode::second << ComponentsTable[ind]->GetName() << endl; + DSP::log << " >>block" << DSP::e::LogMode::second << ComponentsTable[ind]->GetName() << endl; break; } } @@ -10485,7 +10485,7 @@ void DSP::Component::ListComponents(DSP::Clock_ptr InputClock) { //! \bug problem if inputs work with different clocks if (ComponentsTable[ind]->Convert2Block()->InputClocks[0] == InputClock) - DSP::log << " >>block" << DSP::LogMode::second << ComponentsTable[ind]->GetName() << endl; + DSP::log << " >>block" << DSP::e::LogMode::second << ComponentsTable[ind]->GetName() << endl; } } } @@ -10501,7 +10501,7 @@ void DSP::Component::ListOfAllComponents(bool list_outputs) DSP::Block_ptr temp; string tekst; - DSP::log << " Number of components" << DSP::LogMode::second << (NoOfComponentsInTable - 1) << endl; + DSP::log << " Number of components" << DSP::e::LogMode::second << (NoOfComponentsInTable - 1) << endl; for (int ind = 0; ind < NoOfComponentsInTable; ind++) { @@ -10513,19 +10513,19 @@ void DSP::Component::ListOfAllComponents(bool list_outputs) if (temp->IsAutoSplit == true) { DSP::log << setw(3) << ind << ": >>auto(inputs=" << temp->NoOfInputs << ",outputs=" << temp->NoOfOutputs << ")" - << DSP::LogMode::second << temp->GetName() << endl; + << DSP::e::LogMode::second << temp->GetName() << endl; } else { if (temp->Convert2Copy() != NULL) { DSP::log << setw(3) << ind << ": >>copy(inputs=" << temp->NoOfInputs << ",outputs=" << temp->NoOfOutputs << ")" - << DSP::LogMode::second << temp->GetName() << endl; + << DSP::e::LogMode::second << temp->GetName() << endl; } else { DSP::log << setw(3) << ind << ": >>block(inputs=" << temp->NoOfInputs << ",outputs=" << temp->NoOfOutputs << ")" - << DSP::LogMode::second << temp->GetName() << endl; + << DSP::e::LogMode::second << temp->GetName() << endl; } } { @@ -10540,7 +10540,7 @@ void DSP::Component::ListOfAllComponents(bool list_outputs) ss << "<" << static_cast<void*>(ComponentsTable[ind]) << "> = " << static_cast<void*>(temp->InputClocks[0]) << "; Master Clock index = " << (int)(temp->InputClocks[0]->GetMasterClockIndex()); } - DSP::log << " InputClocks[0]" << DSP::LogMode::second << ss.str() << endl; + DSP::log << " InputClocks[0]" << DSP::e::LogMode::second << ss.str() << endl; } } } @@ -10549,7 +10549,7 @@ void DSP::Component::ListOfAllComponents(bool list_outputs) { { DSP::log << setw(3) << ind << ": >>source(outputs=" << ComponentsTable[ind]->Convert2Source()->NoOfOutputs << ")" - << DSP::LogMode::second << ComponentsTable[ind]->GetName() << endl; + << DSP::e::LogMode::second << ComponentsTable[ind]->GetName() << endl; } { stringstream ss; @@ -10563,7 +10563,7 @@ void DSP::Component::ListOfAllComponents(bool list_outputs) ss << " = " << static_cast<void*>(ComponentsTable[ind]->Convert2Source()->OutputClocks[0]) << "; Master Clock index = " << (int)(ComponentsTable[ind]->Convert2Source()->OutputClocks[0]->GetMasterClockIndex()); } - DSP::log << " OutputClocks[0]" << DSP::LogMode::second << ss.str() << endl; + DSP::log << " OutputClocks[0]" << DSP::e::LogMode::second << ss.str() << endl; } } else @@ -10572,7 +10572,7 @@ void DSP::Component::ListOfAllComponents(bool list_outputs) temp = ComponentsTable[ind]->Convert2Block(); DSP::log << setw(3) << ind << ": >>mixed(inputs=" << temp->NoOfInputs << ",outputs=" << temp->NoOfOutputs << ")" - << DSP::LogMode::second << temp->GetName() << endl; + << DSP::e::LogMode::second << temp->GetName() << endl; } if (temp->NoOfInputs > 0) { @@ -10590,7 +10590,7 @@ void DSP::Component::ListOfAllComponents(bool list_outputs) << "; Master Clock index = " << (int)(temp->InputClocks[0]->GetMasterClockIndex()); tekst = ss.str(); } - DSP::log << " InputClocks[0]" << DSP::LogMode::second << tekst << endl; + DSP::log << " InputClocks[0]" << DSP::e::LogMode::second << tekst << endl; } if (temp->NoOfOutputs > 0) { stringstream ss; @@ -10604,10 +10604,10 @@ void DSP::Component::ListOfAllComponents(bool list_outputs) ss << "<" << static_cast<void*>(ComponentsTable[ind]) << "> = " << static_cast<void*>(ComponentsTable[ind]->Convert2Source()->OutputClocks[0]) << "; Master Clock index = " << (int)((int)(ComponentsTable[ind]->Convert2Source()->OutputClocks[0]->GetMasterClockIndex())); } - DSP::log << " OutputClocks[0]" << DSP::LogMode::second << ss.str() << endl; + DSP::log << " OutputClocks[0]" << DSP::e::LogMode::second << ss.str() << endl; } else { - DSP::log << " OutputClocks[0]" << DSP::LogMode::second << "undefined (NoOfOutputs == 0)!" << endl; + DSP::log << " OutputClocks[0]" << DSP::e::LogMode::second << "undefined (NoOfOutputs == 0)!" << endl; } } @@ -10617,7 +10617,7 @@ void DSP::Component::ListOfAllComponents(bool list_outputs) { DSP::log << "out" << setw(3) << ind2 << " ==> <" << static_cast<void*>(ComponentsTable[ind]->OutputBlocks[ind2]) << ">[" << setw(3) << ComponentsTable[ind]->OutputBlocks_InputNo[ind2] << "]" - << DSP::LogMode::second + << DSP::e::LogMode::second << ComponentsTable[ind]->OutputBlocks[ind2]->GetName() << endl; } } @@ -10636,7 +10636,7 @@ void DSP::Component::CheckInputsOfAllComponents(void) unsigned int NoOfCopyBlocks; unsigned int NoOfAutoSplitBlocks; - DSP::log << "DSP::Component::CheckInputsOfAllComponents" << DSP::LogMode::second << "Start" << endl; + DSP::log << "DSP::Component::CheckInputsOfAllComponents" << DSP::e::LogMode::second << "Start" << endl; NoOfCopyBlocks = 0; NoOfAutoSplitBlocks = 0; for (int ind = 0; ind < NoOfComponentsInTable; ind++) @@ -10656,7 +10656,7 @@ void DSP::Component::CheckInputsOfAllComponents(void) DSP::log << " >>block (" << ComponentsTable[ind]->GetName() << "): NoOfInputsConnected + InitialNoOfInputsProcessed != NoOfInputs" << endl; DSP::log << " NoOfInputs = " << temp->NoOfInputs << endl; DSP::log << " NoOfInputsConnected = " << temp->NoOfInputsConnected << endl; - DSP::log << DSP::LogMode::Error << " InitialNoOfInputsProcessed = " << temp->InitialNoOfInputsProcessed << endl; + DSP::log << DSP::e::LogMode::Error << " InitialNoOfInputsProcessed = " << temp->InitialNoOfInputsProcessed << endl; } } @@ -10664,7 +10664,7 @@ void DSP::Component::CheckInputsOfAllComponents(void) { if (IsOutputConnectedToThisInput(temp, ind2, tempBlock, tempNo) == false) { - DSP::log << DSP::LogMode::Error << " Block >>" << temp->GetName() << "<< input " + DSP::log << DSP::e::LogMode::Error << " Block >>" << temp->GetName() << "<< input " << setw(2) << setfill('0') << ind2 << " UNCONNECTED" << endl; } else @@ -10673,7 +10673,7 @@ void DSP::Component::CheckInputsOfAllComponents(void) { // non constant input if ((temp->Convert2Copy() == NULL) && (tempBlock->Convert2Copy() != NULL)) { // Copy ==> Copy chains are ignored - DSP::log << DSP::LogMode::Error << " Block >>" << temp->GetName() + DSP::log << DSP::e::LogMode::Error << " Block >>" << temp->GetName() << "<< input " << setw(2) << setfill('0') << ind2 << " connected only to DSP::u::Copy >>" << tempBlock->GetName() << "<< input " << setw(2) << setfill('0') << tempNo << endl; @@ -10686,14 +10686,14 @@ void DSP::Component::CheckInputsOfAllComponents(void) } - DSP::log << " Number of checked components" << DSP::LogMode::second + DSP::log << " Number of checked components" << DSP::e::LogMode::second << (NoOfComponentsInTable - 1) << " (" << NoOfCopyBlocks << " copy blocks & " << NoOfAutoSplitBlocks << " autosplitters)" << endl; if (NoOfComponentsInTable > 1) DSP::log << endl; - DSP::log << "DSP::Component::CheckInputsOfAllComponents" << DSP::LogMode::second << "End" << endl; + DSP::log << "DSP::Component::CheckInputsOfAllComponents" << DSP::e::LogMode::second << "End" << endl; #endif } @@ -10935,7 +10935,7 @@ bool DSP::u::Copy::SetCopyInput(unsigned int InputNo, DSP::Component_ptr block, #ifdef __DEBUG__ if (current->NoOfInputsConnected > current->NoOfInputs) - DSP::log << DSP::LogMode::Error << "DSP::u::Copy::SetCopyInput" << DSP::LogMode::second << "NoOfInputsConnected > NoOfInputs" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::Copy::SetCopyInput" << DSP::e::LogMode::second << "NoOfInputsConnected > NoOfInputs" << endl; #endif // return true if there is output block connected already @@ -11017,7 +11017,7 @@ void DSP::MacroStack::RemoveMacroFromStack(DSP::Macro_ptr macro) if (Length == 0) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::MacroStack::RemoveMacroFromStack" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::MacroStack::RemoveMacroFromStack" << DSP::e::LogMode::second << "Stack empty. No macro:>>" << macro->GetName() << "<< on the list!" << endl; #endif return; @@ -11042,14 +11042,14 @@ void DSP::MacroStack::RemoveMacroFromStack(DSP::Macro_ptr macro) #ifdef __DEBUG__ else { - DSP::log << "DSP::MacroStack::RemoveMacroFromStack" << DSP::LogMode::second << "Current macro stack:" << endl; + DSP::log << "DSP::MacroStack::RemoveMacroFromStack" << DSP::e::LogMode::second << "Current macro stack:" << endl; for (unsigned int ind = 0; ind < Length; ind++) { - DSP::log << " >>" << DSP::LogMode::second << Stack[ind]->GetName() << endl; + DSP::log << " >>" << DSP::e::LogMode::second << Stack[ind]->GetName() << endl; } DSP::log << endl; - DSP::log << DSP::LogMode::Error << "DSP::MacroStack::RemoveMacroFromStack" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::MacroStack::RemoveMacroFromStack" << DSP::e::LogMode::second << "Macro:>>" << macro->GetName() << "<< not found at the bottom of the stack!" << endl; } #endif @@ -11098,7 +11098,7 @@ void DSP::MacroStack::RemoveMacroFromList(DSP::Macro_ptr macro) if (ListLength == 0) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::MacroStack::RemoveMacroFromList" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::MacroStack::RemoveMacroFromList" << DSP::e::LogMode::second << "List empty. No macro:>>" << macro->GetName() << "<< on the list!" << endl; #endif return; @@ -11132,14 +11132,14 @@ void DSP::MacroStack::RemoveMacroFromList(DSP::Macro_ptr macro) #ifdef __DEBUG__ if (ind >= ListLength) { - DSP::log << "DSP::MacroStack::RemoveMacroFromList" << DSP::LogMode::second << "Current macro list:" << endl; + DSP::log << "DSP::MacroStack::RemoveMacroFromList" << DSP::e::LogMode::second << "Current macro list:" << endl; for (ind = 0; ind < ListLength; ind++) { - DSP::log << " >>" << DSP::LogMode::second << List[ind]->GetName() << endl; + DSP::log << " >>" << DSP::e::LogMode::second << List[ind]->GetName() << endl; } DSP::log << endl; - DSP::log << DSP::LogMode::Error << "DSP::MacroStack::RemoveMacroFromList" << DSP::LogMode::second + DSP::log << DSP::e::LogMode::Error << "DSP::MacroStack::RemoveMacroFromList" << DSP::e::LogMode::second << "Macro:>>" << macro->GetName() << "<< not found on the list!" << endl; } #endif @@ -11284,7 +11284,7 @@ unsigned int DSP::Macro::GetMacroInputNo(DSP::Component_ptr output_block, unsign if (output_block->Convert2Copy() != NULL) { - DSP::log << DSP::LogMode::Error << "DSP::Macro::GetMacroInputNo" << DSP::LogMode::second << "Encountered unrecognized copy block" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::Macro::GetMacroInputNo" << DSP::e::LogMode::second << "Encountered unrecognized copy block" << endl; } for (ind = 0; ind < NoOfInputs; ind++) diff --git a/src/cpp/DSP_modules2.cpp b/src/cpp/DSP_modules2.cpp index fba83ef..2c4bd33 100644 --- a/src/cpp/DSP_modules2.cpp +++ b/src/cpp/DSP_modules2.cpp @@ -269,21 +269,21 @@ DSP::u::DynamicCompressor::DynamicCompressor( if (BufferSize_in <= 0) { #ifdef __DEBUG__ - DSP::log << "DSP::u::DynamicCompressor::DynamicCompressor" << DSP::LogMode::second << "BufferSize_in <= 0" << endl; + DSP::log << "DSP::u::DynamicCompressor::DynamicCompressor" << DSP::e::LogMode::second << "BufferSize_in <= 0" << endl; #endif BufferSize_in = 1; } if (OutputDelay_in < -1) { #ifdef __DEBUG__ - DSP::log << "DSP::u::DynamicCompressor::DynamicCompressor" << DSP::LogMode::second << "OutputDelay_in < -1" << endl; + DSP::log << "DSP::u::DynamicCompressor::DynamicCompressor" << DSP::e::LogMode::second << "OutputDelay_in < -1" << endl; #endif OutputDelay_in = 0; } if (OutputDelay_in >= BufferSize_in) { #ifdef __DEBUG__ - DSP::log << "DSP::u::DynamicCompressor::DynamicCompressor" << DSP::LogMode::second << "OutputDelay_in >= BufferSize_in" << endl; + DSP::log << "DSP::u::DynamicCompressor::DynamicCompressor" << DSP::e::LogMode::second << "OutputDelay_in >= BufferSize_in" << endl; #endif OutputDelay_in = BufferSize_in - 1; } @@ -617,7 +617,7 @@ DSP::u::Farrow::Farrow(const bool& IsComplex, const vector<DSP::Float_vector>& F if (InputClock == NULL) { - DSP::log << DSP::LogMode::Error << "DSP::u::Farrow" << DSP::LogMode::second << "Undefined InputClock (AutoUpdate not implemented yet)" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::Farrow" << DSP::e::LogMode::second << "Undefined InputClock (AutoUpdate not implemented yet)" << endl; return; } else @@ -756,11 +756,11 @@ bool DSP::u::Farrow::OutputExecute(OUTPUT_EXECUTE_ARGS) { // This is InputClock calling ;-) if (clock == THIS->InputClocks[0]) { - DSP::log << DSP::LogMode::Error << "DSP::u::Farrow::OutputExecute" << DSP::LogMode::second << "WARNING: InputClock not expected !!!" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::Farrow::OutputExecute" << DSP::e::LogMode::second << "WARNING: InputClock not expected !!!" << endl; } else { - DSP::log << DSP::LogMode::Error << "DSP::u::Farrow::OutputExecute" << DSP::LogMode::second << "WARNING: Unexpected clock called !!!" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::Farrow::OutputExecute" << DSP::e::LogMode::second << "WARNING: Unexpected clock called !!!" << endl; } return true; } @@ -1046,7 +1046,7 @@ void DSP::u::GardnerSampling::Init( { //activate output clock if ((InputClock == NULL) || (OutputClock == NULL)) { - DSP::log << DSP::LogMode::Error << "DSP::u::GardnerSampling::Init" << DSP::LogMode::second << "Can't activate output clock: InputClock or OutputClock is NULL" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::GardnerSampling::Init" << DSP::e::LogMode::second << "Can't activate output clock: InputClock or OutputClock is NULL" << endl; return; } MasterClockIndex = InputClock->GetMasterClockIndex(); @@ -1547,7 +1547,7 @@ DSP::u::PSKencoder::PSKencoder(DSP::e::PSK_type type) : DSP::Block() break; default: - DSP::log << DSP::LogMode::Error << "DSP::u::PSKencoder::PSKencoder" << DSP::LogMode::second << "Unsupported modulation type, falling back to BPSK" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::PSKencoder::PSKencoder" << DSP::e::LogMode::second << "Unsupported modulation type, falling back to BPSK" << endl; Type = DSP::e::PSK_type::BPSK; Execute_ptr = &InputExecute_BPSK; break; @@ -1827,7 +1827,7 @@ unsigned int getConstellation( break; default: - DSP::log << DSP::LogMode::Error << "getConstellation" << DSP::LogMode::second << "Unsupported modulation type" << endl; + DSP::log << DSP::e::LogMode::Error << "getConstellation" << DSP::e::LogMode::second << "Unsupported modulation type" << endl; break; } @@ -1971,7 +1971,7 @@ DSP::u::Serial2Parallel::Serial2Parallel(const DSP::Clock_ptr &InputClock, if (first_output_vector.size() != NoOfOutputs) { outputs.resize(NoOfOutputs, 0.0); if (first_output_vector.size() > 0) { - DSP::log << DSP::LogMode::Error << "DSP::u::Serial2Parallel" << DSP::LogMode::second << "Wrong size of first_output_vector" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::Serial2Parallel" << DSP::e::LogMode::second << "Wrong size of first_output_vector" << endl; } } else { @@ -2403,7 +2403,7 @@ DSP::u::PSKdecoder::PSKdecoder(DSP::e::PSK_type type) : DSP::Block() break; default: - DSP::log << DSP::LogMode::Error << "DSP::u::PSKdecoder::PSKdecoder" << DSP::LogMode::second << "Unsupported modulation type, falling back to BPSK" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::PSKdecoder::PSKdecoder" << DSP::e::LogMode::second << "Unsupported modulation type, falling back to BPSK" << endl; Execute_ptr = &InputExecute_BPSK; break; } diff --git a/src/cpp/DSP_sockets.cpp b/src/cpp/DSP_sockets.cpp index 451e59a..c71cb70 100644 --- a/src/cpp/DSP_sockets.cpp +++ b/src/cpp/DSP_sockets.cpp @@ -91,7 +91,7 @@ bool DSP::Socket::InitServer_ListenSocket(const string & address_with_port) if (listen_ready == true) { - DSP::log << "DSP::Socket::InitServer_ListenSocket" << DSP::LogMode::second << "already initialized" << endl; + DSP::log << "DSP::Socket::InitServer_ListenSocket" << DSP::e::LogMode::second << "already initialized" << endl; return false; } @@ -115,7 +115,7 @@ bool DSP::Socket::InitServer_ListenSocket(const string & address_with_port) //iResult = getaddrinfo(address, DEFAULT_PORT, &hints, &result); //if ( iResult != 0 ) //{ - DSP::log << DSP::LogMode::Error << "DSP::Socket::InitServer" << DSP::LogMode::second << "getaddrinfo failed" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::Socket::InitServer" << DSP::e::LogMode::second << "getaddrinfo failed" << endl; listen_ready = false; return false; //} @@ -130,7 +130,7 @@ bool DSP::Socket::InitServer_ListenSocket(const string & address_with_port) if (ListenSocket == INVALID_SOCKET) { res = WSAGetLastError(); - DSP::log << DSP::LogMode::Error << "DSP::Socket::InitServer" << DSP::LogMode::second << "Error at socket(): " << res << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::Socket::InitServer" << DSP::e::LogMode::second << "Error at socket(): " << res << endl; freeaddrinfo(result); result = NULL; listen_ready = false; @@ -143,7 +143,7 @@ bool DSP::Socket::InitServer_ListenSocket(const string & address_with_port) iResult = ioctlsocket(ListenSocket, FIONBIO, &on); if (iResult == SOCKET_ERROR) { - DSP::log << DSP::LogMode::Error << "DSP::Socket::InitServer" << DSP::LogMode::second << "ioctlsocket failed to set non-blocking mode" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::Socket::InitServer" << DSP::e::LogMode::second << "ioctlsocket failed to set non-blocking mode" << endl; } // Setup the TCP listening socket @@ -151,7 +151,7 @@ bool DSP::Socket::InitServer_ListenSocket(const string & address_with_port) result->ai_addr, (int)result->ai_addrlen); if (iResult == SOCKET_ERROR) { - DSP::log << DSP::LogMode::Error << "DSP::Socket::InitServer" << DSP::LogMode::second << "bind failed" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::Socket::InitServer" << DSP::e::LogMode::second << "bind failed" << endl; //printf("bind failed: %d\n", WSAGetLastError()); freeaddrinfo(result); result = NULL; @@ -164,7 +164,7 @@ bool DSP::Socket::InitServer_ListenSocket(const string & address_with_port) // support multiple outgoing connections if ( listen( ListenSocket, SOMAXCONN ) == SOCKET_ERROR ) { - DSP::log << DSP::LogMode::Error << "DSP::Socket::InitServer" << DSP::LogMode::second << "listen failed" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::Socket::InitServer" << DSP::e::LogMode::second << "listen failed" << endl; //printf("listen failed: %d\n", WSAGetLastError()); freeaddrinfo(result); result = NULL; @@ -226,7 +226,7 @@ bool DSP::Socket::TryAcceptConnection(void) //current_socket_state &= DSP::e::SocketStatus::timeout_mask; // no object if (res == SOCKET_ERROR) { - DSP::log << "DSP::Socket::TryAcceptConnection" << DSP::LogMode::second << "SOCKET_ERROR" << endl; + DSP::log << "DSP::Socket::TryAcceptConnection" << DSP::e::LogMode::second << "SOCKET_ERROR" << endl; closesocket(ListenSocket); ListenSocket = INVALID_SOCKET; // current_socket_state |= DSP::e::SocketStatus::error; no object @@ -237,7 +237,7 @@ bool DSP::Socket::TryAcceptConnection(void) temp_socket = accept(ListenSocket, NULL, NULL); if (temp_socket == INVALID_SOCKET) { - DSP::log << DSP::LogMode::Error << "DSP::Socket::TryAcceptConnection" << DSP::LogMode::second << "accept failed" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::Socket::TryAcceptConnection" << DSP::e::LogMode::second << "accept failed" << endl; //printf("accept failed: %d\n", WSAGetLastError()); closesocket(ListenSocket); ListenSocket = INVALID_SOCKET; @@ -265,12 +265,12 @@ bool DSP::Socket::TryAcceptConnection(void) * ?!? this might block other connections ?!? */ closesocket(temp_socket); - DSP::log << "DSP::Socket::TryAcceptConnection" << DSP::LogMode::second << "socket ID data has not been received (timeout - connection closed)" << endl; + DSP::log << "DSP::Socket::TryAcceptConnection" << DSP::e::LogMode::second << "socket ID data has not been received (timeout - connection closed)" << endl; return false; } if (res == SOCKET_ERROR) { - DSP::log << "DSP::Socket::TryAcceptConnection" << DSP::LogMode::second << "error reading socket ID data" << endl; + DSP::log << "DSP::Socket::TryAcceptConnection" << DSP::e::LogMode::second << "error reading socket ID data" << endl; // current_socket_state |= DSP::e::SocketStatus::error; // no object return false; } @@ -279,18 +279,18 @@ bool DSP::Socket::TryAcceptConnection(void) if (in_counter == 0) { // connection has been closed - DSP::log << "DSP::Socket::TryAcceptConnection" << DSP::LogMode::second << "connection has been closed" << endl; + DSP::log << "DSP::Socket::TryAcceptConnection" << DSP::e::LogMode::second << "connection has been closed" << endl; return false; } if (in_counter < sizeof(uint32_t)) { - DSP::log << "DSP::Socket::TryAcceptConnection" << DSP::LogMode::second << "error reading socket ID data (not enough data)" << endl; + DSP::log << "DSP::Socket::TryAcceptConnection" << DSP::e::LogMode::second << "error reading socket ID data (not enough data)" << endl; // current_socket_state |= DSP::e::SocketStatus::error; // no object return false; } in_counter = recv(temp_socket, (char *)(&temp_ServerObjectID), sizeof(uint32_t), 0); - DSP::log << "DSP::Socket::TryAcceptConnection" << DSP::LogMode::second << "ServerObjectID = " << (int)temp_ServerObjectID << endl; + DSP::log << "DSP::Socket::TryAcceptConnection" << DSP::e::LogMode::second << "ServerObjectID = " << (int)temp_ServerObjectID << endl; // update ConnectSocket in according socket object for (ind = 0; ind < no_of_server_objects; ind++) @@ -302,7 +302,7 @@ bool DSP::Socket::TryAcceptConnection(void) { if (server_objects_list[ind]->ConnectSocket == INVALID_SOCKET) { - DSP::log << "DSP::Socket::TryAcceptConnection" << DSP::LogMode::second + DSP::log << "DSP::Socket::TryAcceptConnection" << DSP::e::LogMode::second << "server_objects_list[" << ind << "]ServerObjectID = " << (unsigned int)server_objects_list[ind]->ServerObjectID << endl; @@ -316,7 +316,7 @@ bool DSP::Socket::TryAcceptConnection(void) } } // current_socket_state |= DSP::e::SocketStatus::error; // no object - DSP::log << DSP::LogMode::Error << "DSP::Socket::TryAcceptConnection" << DSP::LogMode::second << "Unexpected incoming connection" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::Socket::TryAcceptConnection" << DSP::e::LogMode::second << "Unexpected incoming connection" << endl; return false; } @@ -370,7 +370,7 @@ bool DSP::Socket::InitClient(const string & address_with_port) iResult = getaddrinfo(hostname.c_str(), port.c_str(), &hints, &result); if ( iResult != 0 ) { - DSP::log << DSP::LogMode::Error << "DSP::Socket::InitClient" << DSP::LogMode::second << "getaddrinfo failed" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::Socket::InitClient" << DSP::e::LogMode::second << "getaddrinfo failed" << endl; current_socket_state |= DSP::e::SocketStatus::error; return false; } @@ -384,7 +384,7 @@ bool DSP::Socket::InitClient(const string & address_with_port) ConnectSocket = socket(ptr->ai_family, ptr->ai_socktype, ptr->ai_protocol); if (ConnectSocket == INVALID_SOCKET) { - DSP::log << DSP::LogMode::Error << "DSP::Socket::InitClient" << DSP::LogMode::second << "Error at socket()" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::Socket::InitClient" << DSP::e::LogMode::second << "Error at socket()" << endl; //printf("Error at socket(): %ld\n", WSAGetLastError()); freeaddrinfo(result); result = NULL; @@ -396,7 +396,7 @@ bool DSP::Socket::InitClient(const string & address_with_port) iResult = ioctlsocket(ConnectSocket, FIONBIO, &on); if (iResult == SOCKET_ERROR) { - DSP::log << DSP::LogMode::Error << "DSP::Socket::InitClient" << DSP::LogMode::second << "ioctlsocket failed to set non-blocking mode" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::Socket::InitClient" << DSP::e::LogMode::second << "ioctlsocket failed to set non-blocking mode" << endl; current_socket_state |= DSP::e::SocketStatus::error; } } @@ -441,7 +441,7 @@ bool DSP::Socket::TryConnect(uint32_t SerwerObjectID) current_socket_state &= DSP::e::SocketStatus::timeout_mask; socket_ready = true; #ifdef __DEBUG__ - DSP::log << "DSP::Socket::TryConnect" << DSP::LogMode::second << "connection established (" << err << ")" << endl; + DSP::log << "DSP::Socket::TryConnect" << DSP::e::LogMode::second << "connection established (" << err << ")" << endl; #endif break; @@ -478,11 +478,11 @@ bool DSP::Socket::TryConnect(uint32_t SerwerObjectID) #ifdef __DEBUG__ if (res == 0) { - DSP::log << DSP::LogMode::Error << "DSP::Socket::TryConnect" << DSP::LogMode::second << "connected but not ready to write (" << res << ")" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::Socket::TryConnect" << DSP::e::LogMode::second << "connected but not ready to write (" << res << ")" << endl; } else { - DSP::log << "DSP::Socket::TryConnect" << DSP::LogMode::second << "connected and ready to write (" << res << ")" << endl; + DSP::log << "DSP::Socket::TryConnect" << DSP::e::LogMode::second << "connected and ready to write (" << res << ")" << endl; } #endif @@ -493,13 +493,13 @@ bool DSP::Socket::TryConnect(uint32_t SerwerObjectID) if (out_counter < sizeof(uint32_t)) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::Socket::TryConnect" << DSP::LogMode::second << "failed to send expected server object data" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::Socket::TryConnect" << DSP::e::LogMode::second << "failed to send expected server object data" << endl; #endif current_socket_state |= DSP::e::SocketStatus::error; return false; } #ifdef __DEBUG__ - DSP::log << "DSP::Socket::TryConnect" << DSP::LogMode::second << "SerwerObjectID has been sent" << endl; + DSP::log << "DSP::Socket::TryConnect" << DSP::e::LogMode::second << "SerwerObjectID has been sent" << endl; #endif return socket_ready; } @@ -512,7 +512,7 @@ bool DSP::Socket::Init_socket(void) if (iResult != 0) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::Socket::Init_socket" << DSP::LogMode::second << "WSAStartup failed" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::Socket::Init_socket" << DSP::e::LogMode::second << "WSAStartup failed" << endl; #endif current_socket_state |= DSP::e::SocketStatus::error; return false; @@ -688,7 +688,7 @@ bool DSP::u::SocketInput::SetSkip(long long Offset_in) UNUSED_ARGUMENT(Offset_in); #ifdef __DEBUG__ - DSP::log << "DSP::u::SocketInput::SetSkip" << DSP::LogMode::second << "Offset setting not yet supported" << endl; + DSP::log << "DSP::u::SocketInput::SetSkip" << DSP::e::LogMode::second << "Offset setting not yet supported" << endl; #endif return false; } @@ -744,7 +744,7 @@ bool DSP::u::SocketInput::OutputExecute(OUTPUT_EXECUTE_ARGS) } if (THIS->SocketInfoData_received == false) { - DSP::log << "DSP::u::SocketInput::OutputExecute" << DSP::LogMode::second << "THIS->ReadConnectionData" << endl; + DSP::log << "DSP::u::SocketInput::OutputExecute" << DSP::e::LogMode::second << "THIS->ReadConnectionData" << endl; THIS->SocketInfoData_received = THIS->ReadConnectionData(); } @@ -799,7 +799,7 @@ bool DSP::u::SocketInput::OutputExecute(OUTPUT_EXECUTE_ARGS) THIS->current_socket_state &= DSP::e::SocketStatus::timeout_mask; if (res == SOCKET_ERROR) { - DSP::log << "DSP::u::SocketInput::OutputExecute" << DSP::LogMode::second << "SOCKET_ERROR" << endl; + DSP::log << "DSP::u::SocketInput::OutputExecute" << DSP::e::LogMode::second << "SOCKET_ERROR" << endl; // close socket closesocket(THIS->ConnectSocket); THIS->ConnectSocket = INVALID_SOCKET; @@ -818,7 +818,7 @@ bool DSP::u::SocketInput::OutputExecute(OUTPUT_EXECUTE_ARGS) if (in_counter == 0) { // connection has been closed - DSP::log << "DSP::u::SocketInput::OutputExecute" << DSP::LogMode::second << "connection has been closed" << endl; + DSP::log << "DSP::u::SocketInput::OutputExecute" << DSP::e::LogMode::second << "connection has been closed" << endl; // close socket closesocket(THIS->ConnectSocket); THIS->ConnectSocket = INVALID_SOCKET; @@ -834,7 +834,7 @@ bool DSP::u::SocketInput::OutputExecute(OUTPUT_EXECUTE_ARGS) if (in_counter < THIS->inbuffer_size) { #ifdef __DEBUG__ - DSP::log << "DSP::u::SocketInput::OutputExecute" << DSP::LogMode::second << "more data expected" << endl; + DSP::log << "DSP::u::SocketInput::OutputExecute" << DSP::e::LogMode::second << "more data expected" << endl; #endif // __DEBUG__ DSP::Clock::InputNeedsMoreTime[THIS->my_clock->MasterClockIndex] = true; @@ -949,7 +949,7 @@ bool DSP::u::SocketInput::ReadConnectionData(void) if (res == SOCKET_ERROR) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::u::SocketInput::ReadConnectionData" << DSP::LogMode::second << "SOCKET_ERROR" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::SocketInput::ReadConnectionData" << DSP::e::LogMode::second << "SOCKET_ERROR" << endl; #endif // close socket socket_ready = false; @@ -965,7 +965,7 @@ bool DSP::u::SocketInput::ReadConnectionData(void) { // connection has been closed #ifdef __DEBUG__ - DSP::log << "DSP::u::SocketInput::ReadConnectionData" << DSP::LogMode::second << "connection has been closed" << endl; + DSP::log << "DSP::u::SocketInput::ReadConnectionData" << DSP::e::LogMode::second << "connection has been closed" << endl; #endif // close socket socket_ready = false; @@ -979,7 +979,7 @@ bool DSP::u::SocketInput::ReadConnectionData(void) { #ifdef __DEBUG__ { - DSP::log << "DSP::u::SocketInput::ReadConnectionData" << DSP::LogMode::second + DSP::log << "DSP::u::SocketInput::ReadConnectionData" << DSP::e::LogMode::second << "more data expected: in_counter = " << in_counter << "; expected_data_size = " << expected_data_size << endl; } @@ -990,7 +990,7 @@ bool DSP::u::SocketInput::ReadConnectionData(void) in_counter_recv += recv(ConnectSocket, (char *)buffer, expected_data_size, 0); #ifdef __DEBUG__ { - DSP::log << "DSP::u::SocketInput::ReadConnectionData" << DSP::LogMode::second + DSP::log << "DSP::u::SocketInput::ReadConnectionData" << DSP::e::LogMode::second << "in_counter_recv = " << in_counter_recv << "; state = " << state << "; expected_data_size = " << expected_data_size << endl; } @@ -1002,7 +1002,7 @@ bool DSP::u::SocketInput::ReadConnectionData(void) if (buffer[0] != 0xffff) { #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::u::SocketInput::ReadConnectionData" << DSP::LogMode::second << "unexpected marker" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::SocketInput::ReadConnectionData" << DSP::e::LogMode::second << "unexpected marker" << endl; #endif data_type = DSP::e::SocketInfoDataType::end; } @@ -1022,7 +1022,7 @@ bool DSP::u::SocketInput::ReadConnectionData(void) { case DSP::e::SocketInfoDataType::Fp: #ifdef __DEBUG__ - DSP::log << "DSP::u::SocketInput::ReadConnectionData" << DSP::LogMode::second << "DSP::e::SocketInfoDataType::Fp" << endl; + DSP::log << "DSP::u::SocketInput::ReadConnectionData" << DSP::e::LogMode::second << "DSP::e::SocketInfoDataType::Fp" << endl; #endif state = 3; // waiting for Fp data expected_data_size = sizeof(long); @@ -1030,7 +1030,7 @@ bool DSP::u::SocketInput::ReadConnectionData(void) case DSP::e::SocketInfoDataType::Offset: #ifdef __DEBUG__ - DSP::log << "DSP::u::SocketInput::ReadConnectionData" << DSP::LogMode::second << "DSP::e::SocketInfoDataType::Offset" << endl; + DSP::log << "DSP::u::SocketInput::ReadConnectionData" << DSP::e::LogMode::second << "DSP::e::SocketInfoDataType::Offset" << endl; #endif state = 3; // waiting for Offset data expected_data_size = sizeof(long); @@ -1038,7 +1038,7 @@ bool DSP::u::SocketInput::ReadConnectionData(void) case DSP::e::SocketInfoDataType::UserData: #ifdef __DEBUG__ - DSP::log << "DSP::u::SocketInput::ReadConnectionData" << DSP::LogMode::second << "DSP::e::SocketInfoDataType::UserData" << endl; + DSP::log << "DSP::u::SocketInput::ReadConnectionData" << DSP::e::LogMode::second << "DSP::e::SocketInfoDataType::UserData" << endl; #endif state = 3; // waiting for user data // expected_data_size = *((long *)buffer); @@ -1046,7 +1046,7 @@ bool DSP::u::SocketInput::ReadConnectionData(void) break; case DSP::e::SocketInfoDataType::end: #ifdef __DEBUG__ - DSP::log << "DSP::u::SocketInput::ReadConnectionData" << DSP::LogMode::second << "DSP::e::SocketInfoDataType::end" << endl; + DSP::log << "DSP::u::SocketInput::ReadConnectionData" << DSP::e::LogMode::second << "DSP::e::SocketInfoDataType::end" << endl; #endif // ignore: transmission finished break; @@ -1055,7 +1055,7 @@ bool DSP::u::SocketInput::ReadConnectionData(void) // expected_data_size = *((long *)buffer); memcpy(&expected_data_size,buffer, sizeof(long)); #ifdef __DEBUG__ - DSP::log << "DSP::u::SocketInput::ReadConnectionData" << DSP::LogMode::second << "unexpected field type" << endl; + DSP::log << "DSP::u::SocketInput::ReadConnectionData" << DSP::e::LogMode::second << "unexpected field type" << endl; #endif current_socket_state |= DSP::e::SocketStatus::error; break; @@ -1078,7 +1078,7 @@ bool DSP::u::SocketInput::ReadConnectionData(void) break; default: #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::u::SocketInput::ReadConnectionData" << DSP::LogMode::second << "unexpected data type" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::SocketInput::ReadConnectionData" << DSP::e::LogMode::second << "unexpected data type" << endl; #endif current_socket_state |= DSP::e::SocketStatus::error; break; @@ -1089,7 +1089,7 @@ bool DSP::u::SocketInput::ReadConnectionData(void) default: data_type = DSP::e::SocketInfoDataType::end; #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::u::SocketInput::ReadConnectionData" << DSP::LogMode::second << "unexpected state" << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::u::SocketInput::ReadConnectionData" << DSP::e::LogMode::second << "unexpected state" << endl; #endif current_socket_state |= DSP::e::SocketStatus::error; break; @@ -1099,7 +1099,7 @@ bool DSP::u::SocketInput::ReadConnectionData(void) #ifdef __DEBUG__ { - DSP::log << "DSP::u::SocketInput::ReadConnectionData" << DSP::LogMode::second + DSP::log << "DSP::u::SocketInput::ReadConnectionData" << DSP::e::LogMode::second << "in_counter_recv = " << in_counter_recv << endl; } #endif @@ -1304,7 +1304,7 @@ bool DSP::u::SocketOutput::SendConnectionData(void) if (res == SOCKET_ERROR) { #ifdef __DEBUG__ - DSP::log << "DSP::Socket::TryAcceptConnection" << DSP::LogMode::second << "SOCKET_ERROR" << endl; + DSP::log << "DSP::Socket::TryAcceptConnection" << DSP::e::LogMode::second << "SOCKET_ERROR" << endl; #endif closesocket(ConnectSocket); ConnectSocket = INVALID_SOCKET; @@ -1318,17 +1318,17 @@ bool DSP::u::SocketOutput::SendConnectionData(void) buffer[0] = 0xffff; out_counter = send(ConnectSocket, (char *)buffer, sizeof(unsigned short), 0); #ifdef __DEBUG__ - DSP::log << "DSP::u::SocketOutput::SendConnectionData" << DSP::LogMode::second + DSP::log << "DSP::u::SocketOutput::SendConnectionData" << DSP::e::LogMode::second << "marker(end) out_counter = " << out_counter << endl; #endif // version buffer[0] = 0x0001; out_counter += send(ConnectSocket, (char *)buffer, sizeof(unsigned short), 0); #ifdef __DEBUG__ - DSP::log << "DSP::u::SocketOutput::SendConnectionData" << DSP::LogMode::second + DSP::log << "DSP::u::SocketOutput::SendConnectionData" << DSP::e::LogMode::second << "version(end) out_counter = " << out_counter << endl; - DSP::log << "DSP::u::SocketOutput::SendConnectionData" << DSP::LogMode::second + DSP::log << "DSP::u::SocketOutput::SendConnectionData" << DSP::e::LogMode::second << "DSP::e::SocketInfoDataType::Fp(start) out_counter = " << out_counter << endl; #endif @@ -1343,9 +1343,9 @@ bool DSP::u::SocketOutput::SendConnectionData(void) long_val = -1; memcpy(buffer,&long_val,sizeof(long)); // not specified yet out_counter += send(ConnectSocket, (char *)buffer, sizeof(long), 0); #ifdef __DEBUG__ - DSP::log << "DSP::u::SocketOutput::SendConnectionData" << DSP::LogMode::second + DSP::log << "DSP::u::SocketOutput::SendConnectionData" << DSP::e::LogMode::second << "DSP::e::SocketInfoDataType::Fp(end) out_counter = " << out_counter << endl; - DSP::log << "DSP::u::SocketOutput::SendConnectionData" << DSP::LogMode::second + DSP::log << "DSP::u::SocketOutput::SendConnectionData" << DSP::e::LogMode::second << "DSP::e::SocketInfoDataType::Offset(start) out_counter = " << out_counter << endl; #endif @@ -1362,7 +1362,7 @@ bool DSP::u::SocketOutput::SendConnectionData(void) out_counter += send(ConnectSocket, (char *)buffer, sizeof(long), 0); #ifdef __DEBUG__ - DSP::log << "DSP::u::SocketOutput::SendConnectionData" << DSP::LogMode::second + DSP::log << "DSP::u::SocketOutput::SendConnectionData" << DSP::e::LogMode::second << "DSP::e::SocketInfoDataType::Offset(end) out_counter = " << out_counter << endl; #endif @@ -1402,7 +1402,7 @@ void DSP::u::SocketOutput::InputExecute(INPUT_EXECUTE_ARGS) } if (THIS->SocketInfoData_sent == false) { - DSP::log << "DSP::u::SocketOutput::InputExecute" << DSP::LogMode::second << "THIS->SendConnectionData" << endl; + DSP::log << "DSP::u::SocketOutput::InputExecute" << DSP::e::LogMode::second << "THIS->SendConnectionData" << endl; THIS->SocketInfoData_sent = THIS->SendConnectionData(); } diff --git a/src/include/DSP_lib.h b/src/include/DSP_lib.h index 9fef922..fa9cfd2 100644 --- a/src/include/DSP_lib.h +++ b/src/include/DSP_lib.h @@ -11,7 +11,7 @@ #define DSP_VER_MAJOR 0 #define DSP_VER_MINOR 20 -#define DSP_VER_BUILD 2 // !!! without zeroes before, else this will be treated as octal number +#define DSP_VER_BUILD 3 // !!! without zeroes before, else this will be treated as octal number #define DSP_VER_YEAR 2021 #define DSP_VER DSP_VER_MAJOR.DSP_VER_MINOR.DSP_VER_BUILD @@ -682,12 +682,12 @@ string DSP::lib_version_string(); * - can list all existing blocks (for example to check if there are some not deleted blocks after clean up process) * . * \section lib_LOG_usr User LOG messages - * - DSP::LogMode::Info, DSP::LogMode::Error, DSP::LogMode::first, DSP::LogMode::second - * - DSP::log << "Hello" << DSP::LogMode::second << "This is echo !!!" << endl; - * - DSP::log << DSP::LogMode::Error << "MAIN" << DSP::LogMode::second << "end" << endl; + * - DSP::e::LogMode::Info, DSP::e::LogMode::Error, DSP::e::LogMode::first, DSP::e::LogMode::second + * - DSP::log << "Hello" << DSP::e::LogMode::second << "This is echo !!!" << endl; + * - DSP::log << DSP::e::LogMode::Error << "MAIN" << DSP::e::LogMode::second << "end" << endl; * . - * - DSP::LogMode::pause, DSP::LogMode::pause_off - * - DSP::log << DSP::LogMode::pause << "Finished SolveMatrix test" << endl; + * - DSP::e::LogMode::pause, DSP::e::LogMode::pause_off + * - DSP::log << DSP::e::LogMode::pause << "Finished SolveMatrix test" << endl; * . * . * \section lib_LOG_wx Working with wxWidgets diff --git a/src/include/DSP_logstream.h b/src/include/DSP_logstream.h index 42ab582..bccd75e 100644 --- a/src/include/DSP_logstream.h +++ b/src/include/DSP_logstream.h @@ -27,7 +27,8 @@ class logstream; - enum class LogMode { + namespace e { + enum struct LogMode { first, // Main part of message (default) second, // Second part of message pause, // Force pause after message in Info mode @@ -36,28 +37,35 @@ Error // ErrorMessage mode }; - logstream& operator<< (logstream& os, const LogMode& log_mode); - - class logbuf; - - typedef std::shared_ptr<logbuf> logbuf_ptr; - //! LOG actions state enumerations /*! Several options may be used together */ - enum E_LS_Mode + enum struct LogState : unsigned int { - LS_off=0, - LS_console = 1, - LS_file = LS_console << 1, - LS_append = LS_file << 1, //! only valid with LS_file - LS_errors_only = LS_append << 1, - LS_user_function = LS_errors_only << 1, - - LS_file_append= (LS_file | LS_append) + off=0, + console = 1, + file = console << 1, + append = file << 1, //! only valid with LS_file + errors_only = append << 1, + user_function = errors_only << 1, + + file_append= (file | append) }; - inline E_LS_Mode operator|(E_LS_Mode __a, E_LS_Mode __b) - { return E_LS_Mode(static_cast<int>(__a) | static_cast<int>(__b)); } + inline LogState operator|(LogState __a, LogState __b) + { return LogState(static_cast<unsigned int>(__a) | static_cast<unsigned int>(__b)); } + inline LogState operator&(LogState __a, LogState __b) + { return LogState(static_cast<unsigned int>(__a) & static_cast<unsigned int>(__b)); } + } + + + class logbuf; + + typedef std::shared_ptr<logbuf> logbuf_ptr; + } + + DSP::logstream& operator<< (DSP::logstream& os, const DSP::e::LogMode& log_mode); + + namespace DSP { class logstream : public std::ostream // std::basic_ostream { @@ -66,13 +74,13 @@ logstream(void); ~logstream(void); - friend logstream& operator<< (logstream& os, const LogMode& log_mode); + friend logstream& ::operator<< (logstream& os, const DSP::e::LogMode& log_mode); public: //! Sets current LOG actions state - void SetLogState(E_LS_Mode Mode); + void SetLogState(const DSP::e::LogState &Mode); //! Returns current LOG actions state - E_LS_Mode GetLogState(void); + DSP::e::LogState GetLogState(void); //! Sets/changes current LOG file name /*! * \warning this function does not change LOG state to LS_file @@ -102,23 +110,6 @@ logbuf_ptr log_buf; }; - // template <class charT, class Traits> - // inline basic_ostream<charT,Traits>& operator<< (basic_ostream<charT,Traits>& os, const DSP::logMode& log_mode) { - inline ostream& operator<< (ostream& os, const LogMode& log_mode) { - logstream *p; - try { - p = dynamic_cast<logstream*>(&os); - } - catch (const std::bad_cast &) - { - return os; - } - - *p << log_mode; - return os; - } - - //! "globalny" log stream extern logstream log; @@ -140,4 +131,22 @@ } +// template <class charT, class Traits> +// inline basic_ostream<charT,Traits>& operator<< (basic_ostream<charT,Traits>& os, const DSP::e::LogMode& log_mode) { +inline ostream& operator<< (ostream& os, const DSP::e::LogMode& log_mode) { + DSP::logstream *p; + try { + p = dynamic_cast<DSP::logstream*>(&os); + } + catch (const std::bad_cast &) + { + return os; + } + + *p << log_mode; + return os; +} + + + #endif // DSP_TEESTREAM_H diff --git a/src/include/DSP_modules.h b/src/include/DSP_modules.h index 5b4c732..c43edf1 100644 --- a/src/include/DSP_modules.h +++ b/src/include/DSP_modules.h @@ -1038,8 +1038,8 @@ class DSP::Component : public virtual DSP::name, public DSP::_connect_class UNUSED_ARGUMENT(clock); #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::Component::Notify"; - DSP::log << DSP::LogMode::second << "Component >>" << GetName() << "<< registered for notifications but notification function not implemented !!!"; + DSP::log << DSP::e::LogMode::Error << "DSP::Component::Notify"; + DSP::log << DSP::e::LogMode::second << "Component >>" << GetName() << "<< registered for notifications but notification function not implemented !!!"; DSP::log << endl; #endif return; @@ -1538,7 +1538,7 @@ class DSP::Block : public virtual DSP::Component tekst << "WARNING: Block uses DummyExecute. Check block constructor if Execute_ptr is set correctly (" << Caller->GetName() << ")"; } - DSP::log << DSP::LogMode::Error << "DSP::Block::Execute" << DSP::LogMode::second << tekst.str() << endl; + DSP::log << DSP::e::LogMode::Error << "DSP::Block::Execute" << DSP::e::LogMode::second << tekst.str() << endl; #endif } @@ -1626,8 +1626,8 @@ class DSP::Source : public virtual DSP::Component UNUSED_DEBUG_ARGUMENT(clock); #ifdef __DEBUG__ - DSP::log << DSP::LogMode::Error << "DSP::Block::Execute" - << DSP::LogMode::Error + DSP::log << DSP::e::LogMode::Error << "DSP::Block::Execute" + << DSP::e::LogMode::Error << "WARNING: Source uses DummyExecute. Check source constructor if OutputExecute_ptr is set correctly (" << source->GetName() << ")" << endl; #endif -- GitLab