summaryrefslogtreecommitdiff
path: root/common/statistics.h
blob: 04c4eb57ae1055c8f750e25e07460eb9ee65f547 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
*  Copyright (C) 2004 Rui Nuno Capela, Lee Revell
*  
*  This program is free software; you can redistribute it and/or
*  modify it under the terms of the GNU Lesser General Public License
*  as published by the Free Software Foundation; either version 2.1
*  of the License, or (at your option) any later version.
*  
*  This program is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
*  Lesser General Public License for more details.
*  
*  You should have received a copy of the GNU Lesser General Public
*  License along with this program; if not, write to the Free
*  Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
*  02111-1307, USA.
*
*  $Id: statistics.h,v 1.2.2.3 2006/06/20 14:44:00 letz Exp $
*/

#ifndef __statistics_h__
#define __statistics_h__

#ifdef __cplusplus
extern "C"
{
#endif

//#include <jack/types.h>
#include "types.h"

    /**
     * @return the maximum delay reported by the backend since
     * startup or reset.  When compared to the period size in usecs, this
     * can be used to estimate the ideal period size for a given setup.
     */
    float jack_get_max_delayed_usecs (jack_client_t *client);

    /**
     * @return the delay in microseconds due to the most recent XRUN
     * occurrence.  This probably only makes sense when called from a @ref
     * JackXRunCallback defined using jack_set_xrun_callback().
     */
    float jack_get_xrun_delayed_usecs (jack_client_t *client);

    /**
     * Reset the maximum delay counter.  This would be useful
     * to estimate the effect that a change to the configuration of a running
     * system (e.g. toggling kernel preemption) has on the delay
     * experienced by JACK, without having to restart the JACK engine.
     */
    void jack_reset_max_delayed_usecs (jack_client_t *client);

#ifdef __cplusplus
}
#endif

#endif /* __statistics_h__ */