diff data/model/ReadOnlyWaveFileModel.cpp @ 1457:0925b37a3ed1

Some messing around with profiling
author Chris Cannam
date Tue, 24 Apr 2018 14:13:51 +0100
parents 87ae75da6527
children 710e6250a401
line wrap: on
line diff
--- a/data/model/ReadOnlyWaveFileModel.cpp	Tue Apr 24 10:01:34 2018 +0100
+++ b/data/model/ReadOnlyWaveFileModel.cpp	Tue Apr 24 14:13:51 2018 +0100
@@ -207,11 +207,17 @@
 }
     
 floatvec_t
-ReadOnlyWaveFileModel::getData(int channel, sv_frame_t start, sv_frame_t count) const
+ReadOnlyWaveFileModel::getData(int channel,
+                               sv_frame_t start,
+                               sv_frame_t count)
+    const
 {
-    // Read directly from the file.  This is used for e.g. audio
-    // playback or input to transforms.
+    // Read a single channel (if channel >= 0) or a mixdown of all
+    // channels (if channel == -1) directly from the file.  This is
+    // used for e.g. audio playback or input to transforms.
 
+    Profiler profiler("ReadOnlyWaveFileModel::getData");
+    
 #ifdef DEBUG_WAVE_FILE_MODEL
     cout << "ReadOnlyWaveFileModel::getData[" << this << "]: " << channel << ", " << start << ", " << count << endl;
 #endif
@@ -268,8 +274,10 @@
 ReadOnlyWaveFileModel::getMultiChannelData(int fromchannel, int tochannel,
                                            sv_frame_t start, sv_frame_t count) const
 {
-    // Read directly from the file.  This is used for e.g. audio
-    // playback or input to transforms.
+    // Read a set of channels directly from the file.  This is used
+    // for e.g. audio playback or input to transforms.
+
+    Profiler profiler("ReadOnlyWaveFileModel::getMultiChannelData");
 
 #ifdef DEBUG_WAVE_FILE_MODEL
     cout << "ReadOnlyWaveFileModel::getData[" << this << "]: " << fromchannel << "," << tochannel << ", " << start << ", " << count << endl;
@@ -278,16 +286,18 @@
     int channels = getChannelCount();
 
     if (fromchannel > tochannel) {
-        SVCERR << "ERROR: ReadOnlyWaveFileModel::getData: fromchannel ("
-                  << fromchannel << ") > tochannel (" << tochannel << ")"
-                  << endl;
+        SVCERR << "ERROR: ReadOnlyWaveFileModel::getMultiChannelData: "
+               << "fromchannel (" << fromchannel
+               << ") > tochannel (" << tochannel << ")"
+               << endl;
         return {};
     }
 
     if (tochannel >= channels) {
-        SVCERR << "ERROR: ReadOnlyWaveFileModel::getData: tochannel ("
-                  << tochannel << ") >= channel count (" << channels << ")"
-                  << endl;
+        SVCERR << "ERROR: ReadOnlyWaveFileModel::getMultiChannelData: "
+               << "tochannel (" << tochannel
+               << ") >= channel count (" << channels << ")"
+               << endl;
         return {};
     }