1 |
/* |
2 |
* JSampler - a java front-end for LinuxSampler |
3 |
* |
4 |
* Copyright (C) 2005-2006 Grigor Iliev <grigor@grigoriliev.com> |
5 |
* |
6 |
* This file is part of JSampler. |
7 |
* |
8 |
* JSampler 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 |
* JSampler 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 JSampler; 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.jsampler; |
24 |
|
25 |
import org.jsampler.event.AudioDeviceListener; |
26 |
|
27 |
import org.linuxsampler.lscp.AudioOutputDevice; |
28 |
import org.linuxsampler.lscp.Parameter; |
29 |
|
30 |
|
31 |
/** |
32 |
* A data model for an audio output device. |
33 |
* @author Grigor Iliev |
34 |
*/ |
35 |
public interface AudioDeviceModel { |
36 |
/** |
37 |
* Registers the specified listener to be notified when |
38 |
* the settings of the audio device are changed. |
39 |
* @param l The <code>AudioDeviceListener</code> to register. |
40 |
*/ |
41 |
public void |
42 |
addAudioDeviceListener(AudioDeviceListener l); |
43 |
|
44 |
/** |
45 |
* Removes the specified listener. |
46 |
* @param l The <code>AudioDeviceListener</code> to remove. |
47 |
*/ |
48 |
public void removeAudioDeviceListener(AudioDeviceListener l); |
49 |
|
50 |
/** |
51 |
* Gets the numerical ID of this audio device. |
52 |
* @return The numerical ID of this audio device or |
53 |
* -1 if the device number is not set. |
54 |
*/ |
55 |
public int getDeviceId(); |
56 |
|
57 |
/** |
58 |
* Gets the current settings of the audio device represented by this model. |
59 |
* @return <code>AudioOutputDevice</code> instance providing |
60 |
* the current settings of the audio device represented by this model. |
61 |
*/ |
62 |
public AudioOutputDevice getDeviceInfo(); |
63 |
|
64 |
/** |
65 |
* Updates the settings of the audio device represented by this model. |
66 |
* @param device The new audio device settings. |
67 |
*/ |
68 |
public void setDeviceInfo(AudioOutputDevice device); |
69 |
|
70 |
/** |
71 |
* Sets whether the audio device is enabled or disabled. |
72 |
* @param active If <code>true</code> the audio device is enabled, |
73 |
* else the device is disabled. |
74 |
*/ |
75 |
public void setActive(boolean active); |
76 |
|
77 |
/** |
78 |
* Determines whether the audio device is active. |
79 |
* @return <code>true</code> if the device is enabled and <code>false</code> otherwise. |
80 |
*/ |
81 |
public boolean isActive(); |
82 |
|
83 |
/** |
84 |
* Schedules a new task for enabling/disabling the audio device. |
85 |
* @param active If <code>true</code> the audio device is enabled, |
86 |
* else the device is disabled. |
87 |
*/ |
88 |
public void setBackendActive(boolean active); |
89 |
|
90 |
/** |
91 |
* Schedules a new task for changing the channel number of the audio device. |
92 |
* @param channels The new number of audio channels. |
93 |
*/ |
94 |
public void setBackendChannelCount(int channels); |
95 |
|
96 |
/** |
97 |
* Schedules a new task for altering a specific |
98 |
* setting of the specified audio output channel. |
99 |
* @param channel The channel number. |
100 |
* @param prm The parameter to be set. |
101 |
*/ |
102 |
public void setBackendChannelParameter(int channel, Parameter prm); |
103 |
} |