/[svn]/jsampler/trunk/src/org/jsampler/SamplerModel.java
ViewVC logotype

Annotation of /jsampler/trunk/src/org/jsampler/SamplerModel.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 911 - (hide annotations) (download)
Mon Aug 7 18:25:58 2006 UTC (17 years, 8 months ago) by iliev
File size: 9405 byte(s)
updating to JSampler 0.3a

1 iliev 787 /*
2     * JSampler - a java front-end for LinuxSampler
3     *
4     * Copyright (C) 2005 Grigor Kirilov Iliev
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.AudioDeviceListListener;
26     import org.jsampler.event.MidiDeviceListListener;
27     import org.jsampler.event.SamplerChannelListListener;
28     import org.jsampler.event.SamplerListener;
29    
30     import org.linuxsampler.lscp.*;
31    
32    
33     /**
34 iliev 911 * A data model representing a sampler.
35 iliev 787 * @author Grigor Iliev
36     */
37     public interface SamplerModel {
38     /**
39     * Registers the specified listener for receiving event messages.
40     * @param l The <code>SamplerListener</code> to register.
41     */
42     public void addSamplerListener(SamplerListener l);
43    
44     /**
45     * Removes the specified listener.
46     * @param l The <code>SamplerListener</code> to remove.
47     */
48     public void removeSamplerListener(SamplerListener l);
49    
50     /**
51     * Registers the specified listener for receiving event messages.
52     * @param listener The <code>AudioDeviceListListener</code> to register.
53     */
54     public void addAudioDeviceListListener(AudioDeviceListListener listener);
55    
56     /**
57     * Removes the specified listener.
58     * @param listener The <code>AudioDeviceListListener</code> to remove.
59     */
60     public void removeAudioDeviceListListener(AudioDeviceListListener listener);
61    
62     /**
63     * Registers the specified listener for receiving event messages.
64     * @param listener The <code>MidiDeviceListListener</code> to register.
65     */
66     public void addMidiDeviceListListener(MidiDeviceListListener listener);
67    
68     /**
69     * Removes the specified listener.
70     * @param listener The <code>MidiDeviceListListener</code> to remove.
71     */
72     public void removeMidiDeviceListListener(MidiDeviceListListener listener);
73    
74     /**
75     * Registers the specified listener for receiving event messages.
76     * @param listener The <code>SamplerChannelListListener</code> to register.
77     */
78     public void addSamplerChannelListListener(SamplerChannelListListener listener);
79    
80     /**
81     * Removes the specified listener.
82     * @param listener The <code>SamplerChannelListListener</code> to remove.
83     */
84     public void removeSamplerChannelListListener(SamplerChannelListListener listener);
85    
86     /**
87     * Gets information about the LinuxSampler instance the front-end is connected to.
88     *
89     * @return <code>ServerInfo</code> instance containing
90     * information about the LinuxSampler instance the front-end is connected to.
91     */
92     public ServerInfo getServerInfo();
93    
94     /**
95     * Gets all audio output drivers currently available for the LinuxSampler instance.
96     *
97     * @return <code>AudioOutputDriver</code> array containing all audio output drivers
98     * currently available for the LinuxSampler instance.
99     */
100     public AudioOutputDriver[] getAudioOutputDrivers();
101    
102     /**
103     * Gets the model of the audio device with ID <code>deviceID</code>.
104     * @param deviceID The ID of the audio device whose model should be obtained.
105     * @return The model of the specified audio device or <code>null</code>
106     * if there is no audio device with ID <code>deviceID</code>.
107     */
108     public AudioDeviceModel getAudioDeviceModel(int deviceID);
109    
110     /**
111     * Gets the current number of audio devices.
112     * @return The current number of audio devices.
113     */
114     public int getAudioDeviceCount();
115    
116     /**
117     * Gets the current list of audio device models.
118     * @return The current list of audio device models.
119     */
120     public AudioDeviceModel[] getAudioDeviceModels();
121    
122     /**
123     * Adds the specified audio device.
124     * @param device The audio device to be added.
125     */
126     public void addAudioDevice(AudioOutputDevice device);
127    
128     /**
129     * Removes the specified audio device.
130     * @param deviceID The ID of the audio device to be removed.
131     * @return <code>true</code> if the audio device is removed successfully, <code>false</code>
132     * if the device list does not contain audio device with ID <code>deviceID</code>.
133     */
134     public boolean removeAudioDevice(int deviceID);
135    
136     /**
137     * Gets all MIDI input drivers currently available for the LinuxSampler instance.
138     *
139     * @return <code>MidiInputDriver</code> array containing all MIDI input drivers currently
140     * available for the LinuxSampler instance.
141     */
142     public MidiInputDriver[] getMidiInputDrivers();
143    
144     /**
145     * Gets the model of the MIDI device with ID <code>deviceID</code>.
146     * @param deviceID The ID of the MIDI device whose model should be obtained.
147     * @return The model of the specified MIDI device or <code>null</code>
148     * if there is no MIDI device with ID <code>deviceID</code>.
149     */
150     public MidiDeviceModel getMidiDeviceModel(int deviceID);
151    
152     /**
153     * Gets the current number of MIDI input devices.
154     * @return The current number of MIDI input devices.
155     */
156     public int getMidiDeviceCount();
157    
158     /**
159     * Gets the current list of MIDI device models.
160     * @return The current list of MIDI device models.
161     */
162     public MidiDeviceModel[] getMidiDeviceModels();
163    
164     /**
165     * Adds the specified MIDI device.
166     * @param device The MIDI device to be added.
167     */
168     public void addMidiDevice(MidiInputDevice device);
169    
170     /**
171     * Removes the specified MIDI device.
172     * @param deviceID The ID of the MIDI device to be removed.
173     * @return <code>true</code> if the MIDI device is removed successfully, <code>false</code>
174     * if the device list does not contain MIDI device with ID <code>deviceID</code>.
175     */
176     public boolean removeMidiDevice(int deviceID);
177    
178     /**
179     * Gets a list of all available engines.
180     * @return A list of all available engines.
181     */
182     public SamplerEngine[] getEngines();
183    
184     /**
185     * Gets the current list of sampler channel models.
186     * @return The current list of sampler channel models.
187     */
188     public SamplerChannelModel[] getChannelModels();
189    
190     /**
191     * Gets the model of the sampler channel with ID <code>channelID</code>.
192     * @param channelID The ID of the sampler channel whose model should be obtained.
193     * @return The model of the specified sampler channel or <code>null</code>
194     * if there is no channel with ID <code>channelID</code>.
195     */
196     public SamplerChannelModel getChannelModel(int channelID);
197    
198     /**
199     * Gets the current number of sampler channels.
200     * @return The current number of sampler channels.
201     */
202     public int getChannelCount();
203    
204     /**
205     * Creates a new sampler channel. The channel will be actually added to this model
206     * when the back-end notifies for its creation.
207     * @see #addChannel
208     */
209     public void createChannel();
210    
211     /**
212     * Adds the specified sampler channel.
213     * @param channel The channel to be added.
214     */
215     public void addChannel(SamplerChannel channel);
216    
217     /**
218     * Removes the specified sampler channel.
219 iliev 911 * Note that this method doesn't remove the channel in the backend,
220     * it is used to remove the channel from the model when those channel
221     * is removed in the backend.
222 iliev 787 * @param channelID The ID of the channel to be removed.
223     * @return <code>true</code> if the channel is removed successfully, <code>false</code>
224     * if the channel's list does not contain channel with ID <code>channelID</code>.
225     */
226     public boolean removeChannel(int channelID);
227    
228     /**
229     * Updates the settings of the specified channel.
230     * @param channel A <code>SamplerChannel</code> instance containing the new settings
231     * for the channel.
232     */
233     public void changeChannel(SamplerChannel channel);
234    
235     /**
236     * Determines whether there is at least one solo channel in the current list
237     * of sampler channels.
238     * @return <code>true</code> if there is at least one solo channel in the current list of
239     * sampler channels, <code>false</code> otherwise.
240     */
241     public boolean hasSoloChannel();
242    
243     /**
244     * Gets the number of solo channels in the current list of sampler channels.
245     * @return The number of solo channels in the current list of sampler channels.
246     */
247     public int getSoloChannelCount();
248    
249     /**
250     * Gets the number of muted channels in the current list of sampler channels.
251     * This number includes the channels muted because of the presence of a solo channel.
252     * @return The number of muted channels in the current list of sampler channels.
253     */
254     public int getMutedChannelCount();
255    
256     /**
257     * Gets the number of channels muted because of the presence of a solo channel.
258     * @return The number of channels muted because of the presence of a solo channel.
259     */
260     public int getMutedBySoloChannelCount();
261    
262     /**
263     * Gets the total number of active voices.
264     * @return The total number of active voices.
265     */
266     public int getTotalVoiceCount();
267    
268     /**
269     * Gets the maximum number of active voices.
270     * @return The maximum number of active voices.
271     */
272     public int getTotalVoiceCountMax();
273    
274     /**
275     * Updates the current and the maximum number of active voices in the sampler.
276     * @param count The new number of active voices.
277     * @param countMax The maximum number of active voices.
278     */
279     public void updateActiveVoiceInfo(int count, int countMax);
280     }

  ViewVC Help
Powered by ViewVC