View Javadoc

1   package net.sf.jack4j;
2   
3   /*
4   Copyright (C) 2008 Ondrej Par
5   
6   This program is free software; you can redistribute it and/or modify
7   it under the terms of the GNU Lesser General Public License as published by
8   the Free Software Foundation; either version 2.1 of the License, or
9   (at your option) any later version.
10  
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  GNU Lesser General Public License for more details.
15  
16  You should have received a copy of the GNU Lesser General Public License
17  along with this program; if not, write to the Free Software
18  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19  
20  */
21  
22  /**
23   * Allows access to Jack statistics information.
24   * 
25   * <p>
26   * The Statistics object is always attached to a single {@link JackClient}
27   * instance, and is only usable during the lifetime of the client.
28   * 
29   * @author repa
30   * 
31   */
32  public class Statistics {
33  
34  	private final JackClient client;
35  	@SuppressWarnings("unused")
36  	private final long clientHandle;
37  
38  	Statistics(JackClient client) {
39  		this.client = client;
40  		this.clientHandle = client.getClientHandle();
41  	}
42  
43  	/**
44  	 * Returns the maximum delay reported by the back-end since startup or
45  	 * reset.
46  	 */
47  	public native float getMaxDelayedUsecs();
48  
49  	/**
50  	 * Returns the delay in microseconds due to the most recent XRUN occurrence.
51  	 */
52  	public native float getXRunDelayedUsecs();
53  
54  	/**
55  	 * Reset the maximum delay counter.
56  	 */
57  	public native void resetMaxDelayedUsecs();
58  
59  	/**
60  	 * @return the client
61  	 */
62  	public JackClient getClient() {
63  		return client;
64  	}
65  }