From 1d427a83a7b949c2e2080e84667d7dc38bd158e2 Mon Sep 17 00:00:00 2001 From: moret Date: Tue, 22 Jul 2008 16:19:36 +0000 Subject: [PATCH] Fix netmaster timing monitoring git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@2721 0c269be4-1314-0410-8aa9-9f06e86f4224 --- common/JackNetDriver.cpp | 12 ++++++++---- common/JackNetDriver.h | 3 ++- common/JackNetManager.cpp | 12 ++++++++---- common/JackNetManager.h | 3 ++- 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/common/JackNetDriver.cpp b/common/JackNetDriver.cpp index ceadbaea..a2af0405 100644 --- a/common/JackNetDriver.cpp +++ b/common/JackNetDriver.cpp @@ -33,8 +33,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. namespace Jack { #ifdef JACK_MONITOR - uint JackNetDriver::fMeasureCnt = 512; + uint JackNetDriver::fMeasureCnt = 50; uint JackNetDriver::fMeasurePoints = 5; + uint JackNetDriver::fMonitorPlotOptionsCnt = 2; std::string JackNetDriver::fMonitorPlotOptions[] = { std::string ( "set xlabel \"audio cycles\"" ), @@ -65,9 +66,11 @@ namespace Jack //monitor #ifdef JACK_MONITOR + fMonitor = new NetMonitor ( JackNetDriver::fMeasureCnt, JackNetDriver::fMeasurePoints ); fMeasure = new jack_time_t[JackNetDriver::fMeasurePoints]; std::string plot_file_name = std::string ( fParams.fName ); - fMonitor.SetPlotFile ( plot_file_name, JackNetDriver::fMonitorPlotOptions, 2, JackNetDriver::fMonitorFieldNames, 5 ); + fMonitor->SetPlotFile ( plot_file_name, JackNetDriver::fMonitorPlotOptions, JackNetDriver::fMonitorPlotOptionsCnt, + JackNetDriver::fMonitorFieldNames, JackNetDriver::fMeasurePoints ); #endif } @@ -86,6 +89,7 @@ namespace Jack delete[] fMidiPlaybackPortList; #ifdef JACK_MONITOR delete[] fMeasure; + delete fMonitor; #endif } @@ -109,7 +113,7 @@ namespace Jack int JackNetDriver::Close() { std::string filename = string ( fParams.fName ); - fMonitor.Save ( filename ); + fMonitor->Save ( filename ); return JackDriver::Close(); } #endif @@ -639,7 +643,7 @@ namespace Jack #ifdef JACK_MONITOR fMeasure[4] = GetMicroSeconds() - fUsecCycleStart; - fMonitor.Write ( fMeasure ); + fMonitor->Write ( fMeasure ); #endif return 0; diff --git a/common/JackNetDriver.h b/common/JackNetDriver.h index f4a47144..bed405c7 100644 --- a/common/JackNetDriver.h +++ b/common/JackNetDriver.h @@ -64,10 +64,11 @@ namespace Jack #ifdef JACK_MONITOR static uint fMeasureCnt; static uint fMeasurePoints; + static uint fMonitorPlotOptionsCnt; static std::string fMonitorPlotOptions[]; static std::string fMonitorFieldNames[]; jack_time_t* fMeasure; - NetMonitor fMonitor; + NetMonitor* fMonitor; jack_time_t fUsecCycleStart; #endif diff --git a/common/JackNetManager.cpp b/common/JackNetManager.cpp index 4eb64732..40cda6cd 100644 --- a/common/JackNetManager.cpp +++ b/common/JackNetManager.cpp @@ -28,8 +28,9 @@ namespace Jack { //JackNetMaster****************************************************************************************************** #ifdef JACK_MONITOR - uint JackNetMaster::fMeasureCnt = 512; + uint JackNetMaster::fMeasureCnt = 50; uint JackNetMaster::fMeasurePoints = 5; + uint JackNetMaster::fMonitorPlotOptionsCnt = 2; std::string JackNetMaster::fMonitorPlotOptions[] = { std::string ( "set xlabel \"audio cycles\"" ), @@ -118,9 +119,11 @@ namespace Jack //monitor #ifdef JACK_MONITOR + fMonitor = new NetMonitor ( JackNetMaster::fMeasureCnt, JackNetMaster::fMeasurePoints ); fMeasure = new jack_nframes_t[JackNetMaster::fMeasurePoints]; std::string plot_file_name = std::string ( fParams.fName ); - fMonitor.SetPlotFile ( plot_file_name, fMonitorPlotOptions, 2, fMonitorFieldNames, 5 ); + fMonitor->SetPlotFile ( plot_file_name, JackNetMaster::fMonitorPlotOptions, JackNetMaster::fMonitorPlotOptionsCnt, + JackNetMaster::fMonitorFieldNames, JackNetMaster::fMeasurePoints ); #endif } @@ -146,8 +149,9 @@ namespace Jack delete[] fRxBuffer; #ifdef JACK_MONITOR std::string filename = string ( fParams.fName ); - fMonitor.Save ( filename ); + fMonitor->Save ( filename ); delete[] fMeasure; + delete fMonitor; #endif } @@ -521,7 +525,7 @@ fail: #ifdef JACK_MONITOR fMeasure[4] = jack_frames_since_cycle_start( fJackClient ); - fMonitor.Write ( fMeasure ); + fMonitor->Write ( fMeasure ); #endif return 0; } diff --git a/common/JackNetManager.h b/common/JackNetManager.h index 22f4783d..e984342c 100644 --- a/common/JackNetManager.h +++ b/common/JackNetManager.h @@ -82,10 +82,11 @@ namespace Jack #ifdef JACK_MONITOR static uint fMeasureCnt; static uint fMeasurePoints; + static uint fMonitorPlotOptionsCnt; static std::string fMonitorPlotOptions[]; static std::string fMonitorFieldNames[]; jack_nframes_t* fMeasure; - NetMonitor fMonitor; + NetMonitor* fMonitor; #endif bool Init();