1 |
/* |
2 |
* JSampler - a java front-end for LinuxSampler |
3 |
* |
4 |
* Copyright (C) 2005-2011 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.Effect; |
29 |
import org.linuxsampler.lscp.Parameter; |
30 |
|
31 |
|
32 |
/** |
33 |
* A data model for an audio output device. |
34 |
* @author Grigor Iliev |
35 |
*/ |
36 |
public interface AudioDeviceModel { |
37 |
/** |
38 |
* Registers the specified listener to be notified when |
39 |
* the settings of the audio device are changed. |
40 |
* @param l The <code>AudioDeviceListener</code> to register. |
41 |
*/ |
42 |
public void |
43 |
addAudioDeviceListener(AudioDeviceListener l); |
44 |
|
45 |
/** |
46 |
* Removes the specified listener. |
47 |
* @param l The <code>AudioDeviceListener</code> to remove. |
48 |
*/ |
49 |
public void removeAudioDeviceListener(AudioDeviceListener l); |
50 |
|
51 |
/** |
52 |
* Gets the numerical ID of this audio device. |
53 |
* @return The numerical ID of this audio device or |
54 |
* -1 if the device number is not set. |
55 |
*/ |
56 |
public int getDeviceId(); |
57 |
|
58 |
/** |
59 |
* Gets the current settings of the audio device represented by this model. |
60 |
* @return <code>AudioOutputDevice</code> instance providing |
61 |
* the current settings of the audio device represented by this model. |
62 |
*/ |
63 |
public AudioOutputDevice getDeviceInfo(); |
64 |
|
65 |
/** |
66 |
* Updates the settings of the audio device represented by this model. |
67 |
* @param device The new audio device settings. |
68 |
*/ |
69 |
public void setDeviceInfo(AudioOutputDevice device); |
70 |
|
71 |
/** |
72 |
* Sets whether the audio device is enabled or disabled. |
73 |
* @param active If <code>true</code> the audio device is enabled, |
74 |
* else the device is disabled. |
75 |
*/ |
76 |
public void setActive(boolean active); |
77 |
|
78 |
/** |
79 |
* Determines whether the audio device is active. |
80 |
* @return <code>true</code> if the device is enabled and <code>false</code> otherwise. |
81 |
*/ |
82 |
public boolean isActive(); |
83 |
|
84 |
/** |
85 |
* Schedules a new task for enabling/disabling the audio device. |
86 |
* @param active If <code>true</code> the audio device is enabled, |
87 |
* else the device is disabled. |
88 |
*/ |
89 |
public void setBackendActive(boolean active); |
90 |
|
91 |
/** |
92 |
* Schedules a new task for altering |
93 |
* a specific setting of the audio output device. |
94 |
* @param prm The parameter to be set. |
95 |
*/ |
96 |
public void setBackendDeviceParameter(Parameter prm); |
97 |
|
98 |
/** |
99 |
* Schedules a new task for changing the channel number of the audio device. |
100 |
* @param channels The new number of audio channels. |
101 |
*/ |
102 |
public void setBackendChannelCount(int channels); |
103 |
|
104 |
/** |
105 |
* Schedules a new task for altering a specific |
106 |
* setting of the specified audio output channel. |
107 |
* @param channel The channel number. |
108 |
* @param prm The parameter to be set. |
109 |
*/ |
110 |
public void setBackendChannelParameter(int channel, Parameter prm); |
111 |
|
112 |
/** Gets the current number of send effect chains. */ |
113 |
public int getSendEffectChainCount(); |
114 |
|
115 |
/** Gets the effect chain at the specified position. */ |
116 |
public EffectChain getSendEffectChain(int chainIdx); |
117 |
|
118 |
public EffectChain getSendEffectChainById(int chainId); |
119 |
|
120 |
/** |
121 |
* Gets the index of the send effect chain with ID <code>chainId</code>. |
122 |
* @param chainId The ID of the send effect chain. |
123 |
* @return The zero-based position of the specified send effect chain |
124 |
* in the send effect chain list or <code>-1</code> |
125 |
* if there is no send effect chain with ID <code>chainId</code>. |
126 |
*/ |
127 |
public int getSendEffectChainIndex(int chainId); |
128 |
|
129 |
/** |
130 |
* Adds the specified send effect chain to the audio output device. |
131 |
*/ |
132 |
public void addSendEffectChain(EffectChain chain); |
133 |
|
134 |
/** Schedules a new task for removing the specified send effect chain. */ |
135 |
public void removeBackendSendEffectChain(int chainId); |
136 |
|
137 |
/** |
138 |
* Removes the specified send effect chain from the audio output device. |
139 |
*/ |
140 |
public void removeSendEffectChain(int chainId); |
141 |
|
142 |
public void removeAllSendEffectChains(); |
143 |
|
144 |
/** |
145 |
* Schedules a new task for adding a new send effect chain and |
146 |
* assigning it to the specified audio output device. |
147 |
*/ |
148 |
public void addBackendSendEffectChain(); |
149 |
|
150 |
/** |
151 |
* Schedules a new task for creating new effect instances and inserting them |
152 |
* in the specified send effect chain at the specified position. |
153 |
*/ |
154 |
public void addBackendEffectInstances(Effect[] effects, int chainId, int index); |
155 |
|
156 |
/** |
157 |
* Schedules a new task for removing the specified |
158 |
* effect instance from the specified send effect chain. |
159 |
*/ |
160 |
public void removeBackendEffectInstance(int chainId, int instanceId); |
161 |
} |