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

Diff of /jsampler/trunk/src/org/jsampler/DefaultMidiDeviceModel.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1142 by iliev, Mon Aug 7 18:25:58 2006 UTC revision 1143 by iliev, Mon Apr 2 21:18:31 2007 UTC
# Line 1  Line 1 
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-2006 Grigor Iliev <grigor@grigoriliev.com>
5   *   *
6   *   This file is part of JSampler.   *   This file is part of JSampler.
7   *   *
# Line 29  import javax.swing.SwingUtilities; Line 29  import javax.swing.SwingUtilities;
29  import org.jsampler.event.MidiDeviceEvent;  import org.jsampler.event.MidiDeviceEvent;
30  import org.jsampler.event.MidiDeviceListener;  import org.jsampler.event.MidiDeviceListener;
31    
32    import org.jsampler.task.Midi;
33    
34  import org.linuxsampler.lscp.BoolParameter;  import org.linuxsampler.lscp.BoolParameter;
35  import org.linuxsampler.lscp.MidiInputDevice;  import org.linuxsampler.lscp.MidiInputDevice;
36  import org.linuxsampler.lscp.Parameter;  import org.linuxsampler.lscp.Parameter;
# Line 79  public class DefaultMidiDeviceModel impl Line 81  public class DefaultMidiDeviceModel impl
81           * -1 if the device number is not set.           * -1 if the device number is not set.
82           */           */
83          public int          public int
84          getDeviceID() { return midiDevice.getDeviceID(); }          getDeviceId() { return midiDevice.getDeviceId(); }
85                    
86          /**          /**
87           * Gets the current settings of the MIDI device represented by this model.           * Gets the current settings of the MIDI device represented by this model.
# Line 120  public class DefaultMidiDeviceModel impl Line 122  public class DefaultMidiDeviceModel impl
122          isActive() { return midiDevice.isActive(); }          isActive() { return midiDevice.isActive(); }
123                    
124          /**          /**
125             * Schedules a new task for enabling/disabling the MIDI device.
126             * @param active If <code>true</code> the MIDI device is enabled,
127             * else the device is disabled.
128             */
129            public void
130            setBackendActive(boolean active) {
131                    CC.getTaskQueue().add(new Midi.EnableDevice(getDeviceId(), active));
132            }
133            
134            /**
135             * Schedules a new task for changing the port number of the MIDI device.
136             * @param ports The new number of ports.
137             */
138            public void
139            setBackendPortCount(int ports) {
140                    CC.getTaskQueue().add(new Midi.SetPortCount(getDeviceId(), ports));
141            }
142            
143            /**
144             * Schedules a new task for altering a specific
145             * setting of the specified MIDI input port.
146             * @param port The port number.
147             * @param prm The parameter to be set.
148             */
149            public void
150            setBackendPortParameter(int port, Parameter prm) {
151                    CC.getTaskQueue().add(new Midi.SetPortParameter(getDeviceId(), port, prm));
152            }
153            
154            /**
155           * Notifies listeners that the settings of the MIDI device are changed.           * Notifies listeners that the settings of the MIDI device are changed.
156           */           */
157          private void          private void

Legend:
Removed from v.1142  
changed lines
  Added in v.1143

  ViewVC Help
Powered by ViewVC