Browse Source

Correct use of JACK_MONITOR for audioadapters.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@2745 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/1.90
sletz 17 years ago
parent
commit
b8d7ceffa5
5 changed files with 30 additions and 6 deletions
  1. +9
    -4
      common/JackAudioAdapterInterface.cpp
  2. +9
    -2
      common/JackAudioAdapterInterface.h
  3. +4
    -0
      linux/alsa/JackAlsaAdapter.cpp
  4. +4
    -0
      macosx/JackCoreAudioAdapter.cpp
  5. +4
    -0
      windows/JackPortAudioAdapter.cpp

+ 9
- 4
common/JackAudioAdapterInterface.cpp View File

@@ -23,6 +23,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
namespace Jack
{

#ifdef JACK_MONITOR

void MeasureTable::Write(int time1, int time2, float r1, float r2, int pos1, int pos2)
{
int pos = (++fCount) % TABLE_MAX;
@@ -56,9 +58,9 @@ void MeasureTable::Save()
fprintf(file, "set xlabel \"audio cycles\"\n");
fprintf(file, "set ylabel \"frames\"\n");
fprintf(file, "plot ");
sprintf(buffer, "\"JackAudioAdapter.log\" using 2 title \"Consumer time\" with lines,");
sprintf(buffer, "\"JackAudioAdapter.log\" using 2 title \"Consumer interrupt period\" with lines,");
fprintf(file, buffer);
sprintf(buffer, "\"JackAudioAdapter.log\" using 3 title \"Producer time\" with lines");
sprintf(buffer, "\"JackAudioAdapter.log\" using 3 title \"Producer interrupt period\" with lines");
fprintf(file, buffer);
fclose(file);
@@ -68,6 +70,7 @@ void MeasureTable::Save()
fprintf(file, "set grid\n");
fprintf(file, "set title \"Audio adapter timing\"\n");
fprintf(file, "set xlabel \"audio cycles\"\n");
fprintf(file, "set ylabel \"resampling ratio\"\n");
fprintf(file, "plot ");
sprintf(buffer, "\"JackAudioAdapter.log\" using 4 title \"Ratio 1\" with lines,");
fprintf(file, buffer);
@@ -83,13 +86,15 @@ void MeasureTable::Save()
fprintf(file, "set xlabel \"audio cycles\"\n");
fprintf(file, "set ylabel \"frames\"\n");
fprintf(file, "plot ");
sprintf(buffer, "\"JackAudioAdapter.log\" using 6 title \"Position in consumer ringbuffer\" with lines,");
sprintf(buffer, "\"JackAudioAdapter.log\" using 6 title \"Frames position in consumer ringbuffer\" with lines,");
fprintf(file, buffer);
sprintf(buffer, "\"JackAudioAdapter.log\" using 7 title \"Position in producer ringbuffer\" with lines");
sprintf(buffer, "\"JackAudioAdapter.log\" using 7 title \"Frames position in producer ringbuffer\" with lines");
fprintf(file, buffer);
fclose(file);
}

#endif

void JackAudioAdapterInterface::ResetRingBuffers()
{
int i;


+ 9
- 2
common/JackAudioAdapterInterface.h View File

@@ -20,6 +20,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#ifndef __JackAudioAdapterInterface__
#define __JackAudioAdapterInterface__

#if defined(HAVE_CONFIG_H)
#include "config.h"
#endif

#include "ringbuffer.h"
#include "jack.h"
#include "JackError.h"
@@ -27,10 +31,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#include "JackFilters.h"
#include <samplerate.h>


namespace Jack
{

#ifdef JACK_MONITOR

#define TABLE_MAX 100000

struct Measure
@@ -58,6 +63,8 @@ struct MeasureTable

};

#endif

/*!
\brief Base class for audio adapters.
*/
@@ -67,7 +74,7 @@ class JackAudioAdapterInterface

protected:

#ifdef DEBUG
#ifdef JACK_MONITOR
MeasureTable fTable;
#endif


+ 4
- 0
linux/alsa/JackAlsaAdapter.cpp View File

@@ -17,6 +17,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

*/

#if defined(HAVE_CONFIG_H)
#include "config.h"
#endif

#include "JackAlsaAdapter.h"

namespace Jack


+ 4
- 0
macosx/JackCoreAudioAdapter.cpp View File

@@ -17,6 +17,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

*/

#if defined(HAVE_CONFIG_H)
#include "config.h"
#endif

#include "JackCoreAudioAdapter.h"
#include "JackError.h"
#include <unistd.h>


+ 4
- 0
windows/JackPortAudioAdapter.cpp View File

@@ -17,6 +17,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

*/

#if defined(HAVE_CONFIG_H)
#include "config.h"
#endif

#include "JackPortAudioAdapter.h"
#include "JackError.h"



Loading…
Cancel
Save