1 |
/* |
/* |
2 |
* JSampler - a java front-end for LinuxSampler |
* JSampler - a java front-end for LinuxSampler |
3 |
* |
* |
4 |
* Copyright (C) 2005 Grigor Kirilov Iliev |
* Copyright (C) 2005-2007 Grigor Iliev <grigor@grigoriliev.com> |
5 |
* |
* |
6 |
* This file is part of JSampler. |
* This file is part of JSampler. |
7 |
* |
* |
29 |
import org.jsampler.event.AudioDeviceEvent; |
import org.jsampler.event.AudioDeviceEvent; |
30 |
import org.jsampler.event.AudioDeviceListener; |
import org.jsampler.event.AudioDeviceListener; |
31 |
|
|
32 |
|
import org.jsampler.task.Audio; |
33 |
|
|
34 |
import org.linuxsampler.lscp.AudioOutputDevice; |
import org.linuxsampler.lscp.AudioOutputDevice; |
35 |
|
import org.linuxsampler.lscp.Parameter; |
36 |
|
|
37 |
|
|
38 |
/** |
/** |
80 |
* -1 if the device number is not set. |
* -1 if the device number is not set. |
81 |
*/ |
*/ |
82 |
public int |
public int |
83 |
getDeviceID() { return audioDevice.getDeviceID(); } |
getDeviceId() { return audioDevice.getDeviceId(); } |
84 |
|
|
85 |
/** |
/** |
86 |
* Gets the current settings of the audio device represented by this model. |
* Gets the current settings of the audio device represented by this model. |
121 |
isActive() { return audioDevice.isActive(); } |
isActive() { return audioDevice.isActive(); } |
122 |
|
|
123 |
/** |
/** |
124 |
|
* Schedules a new task for enabling/disabling the audio device. |
125 |
|
* @param active If <code>true</code> the audio device is enabled, |
126 |
|
* else the device is disabled. |
127 |
|
*/ |
128 |
|
public void |
129 |
|
setBackendActive(boolean active) { |
130 |
|
CC.getTaskQueue().add(new Audio.EnableDevice(getDeviceId(), active)); |
131 |
|
} |
132 |
|
|
133 |
|
/** |
134 |
|
* Schedules a new task for changing the channel number of the audio device. |
135 |
|
* @param channels The new number of audio channels. |
136 |
|
*/ |
137 |
|
public void |
138 |
|
setBackendChannelCount(int channels) { |
139 |
|
CC.getTaskQueue().add(new Audio.SetChannelCount(getDeviceId(), channels)); |
140 |
|
} |
141 |
|
|
142 |
|
/** |
143 |
|
* Schedules a new task for altering a specific |
144 |
|
* setting of the specified audio output channel. |
145 |
|
* @param channel The channel number. |
146 |
|
* @param prm The parameter to be set. |
147 |
|
*/ |
148 |
|
public void |
149 |
|
setBackendChannelParameter(int channel, Parameter prm) { |
150 |
|
CC.getTaskQueue().add(new Audio.SetChannelParameter(getDeviceId(), channel, prm)); |
151 |
|
} |
152 |
|
|
153 |
|
/** |
154 |
* Notifies listeners that the settings of the audio device are changed. |
* Notifies listeners that the settings of the audio device are changed. |
155 |
*/ |
*/ |
156 |
private void |
private void |