1 |
iliev |
596 |
/* |
2 |
|
|
* jlscp - a java LinuxSampler control protocol API |
3 |
|
|
* |
4 |
|
|
* Copyright (C) 2005 Grigor Kirilov Iliev |
5 |
|
|
* |
6 |
|
|
* This file is part of jlscp. |
7 |
|
|
* |
8 |
|
|
* jlscp is free software; you can redistribute it and/or modify |
9 |
|
|
* it under the terms of the GNU General Public License version 2 |
10 |
|
|
* as published by the Free Software Foundation. |
11 |
|
|
* |
12 |
|
|
* jlscp is distributed in the hope that it will be useful, |
13 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 |
|
|
* GNU General Public License for more details. |
16 |
|
|
* |
17 |
|
|
* You should have received a copy of the GNU General Public License |
18 |
|
|
* along with jlscp; if not, write to the Free Software |
19 |
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
20 |
|
|
* MA 02111-1307 USA |
21 |
|
|
*/ |
22 |
|
|
|
23 |
|
|
package org.linuxsampler.lscp; |
24 |
|
|
|
25 |
|
|
/** |
26 |
|
|
* Provides information about the current settings of a specific audio output device. |
27 |
|
|
* @author Grigor Iliev |
28 |
|
|
*/ |
29 |
|
|
public class AudioOutputDevice extends AbstractDevice { |
30 |
|
|
private Parameter<Integer> channels = null; |
31 |
|
|
private Parameter<Integer> samplerate = null; |
32 |
|
|
|
33 |
|
|
|
34 |
|
|
/** Creates a new instance of AudioOutputDevice */ |
35 |
|
|
public |
36 |
|
|
AudioOutputDevice() { |
37 |
|
|
|
38 |
|
|
} |
39 |
|
|
|
40 |
|
|
/** |
41 |
|
|
* Gets the amount of audio output channels this device currently offers. |
42 |
|
|
* @return The amount of audio output channels this device currently offers. |
43 |
|
|
*/ |
44 |
|
|
public int |
45 |
|
|
getChannelCount() { return channels == null ? 0 : channels.getValue(); } |
46 |
|
|
|
47 |
|
|
/** |
48 |
|
|
* Gets the <code>CHANNELS</code> parameter. |
49 |
|
|
* @return A <code>Parameter<Integer></code> instance. |
50 |
|
|
*/ |
51 |
|
|
public Parameter<Integer> |
52 |
|
|
getChannelsParameter() { return channels; } |
53 |
|
|
|
54 |
|
|
/** |
55 |
|
|
* Sets the <code>CHANNELS</code> parameter. |
56 |
|
|
* @param channels The new <code>CHANNELS</code> parameter. |
57 |
|
|
*/ |
58 |
|
|
public void |
59 |
|
|
setChannelsParameter(Parameter<Integer> channels) { this.channels = channels; } |
60 |
|
|
|
61 |
|
|
/** |
62 |
|
|
* Gets the sample rate this device uses. |
63 |
|
|
* @return The sample rate this device uses. |
64 |
|
|
*/ |
65 |
|
|
public int |
66 |
|
|
getSampleRate() { return samplerate == null ? 0 : samplerate.getValue(); } |
67 |
|
|
|
68 |
|
|
/** |
69 |
|
|
* Gets the <code>SAMPLERATE</code> parameter. |
70 |
|
|
* @return A <code>Parameter<Integer></code> instance. |
71 |
|
|
*/ |
72 |
|
|
public Parameter<Integer> |
73 |
|
|
getSampleRateParameter() { return samplerate; } |
74 |
|
|
|
75 |
|
|
/** |
76 |
|
|
* Sets the <code>SAMPLERATE</code> parameter. |
77 |
|
|
* @param samplerate The new <code>SAMPLERATE</code> parameter. |
78 |
|
|
*/ |
79 |
|
|
public void |
80 |
|
|
setSampleRateParameter(Parameter<Integer> samplerate) { this.samplerate = samplerate; } |
81 |
|
|
} |