1 /* |
1 /* |
2 * Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
25 |
25 |
26 package javax.sound.midi; |
26 package javax.sound.midi; |
27 |
27 |
28 import java.util.EventListener; |
28 import java.util.EventListener; |
29 |
29 |
30 |
|
31 /** |
30 /** |
32 * The <code>ControllerEventListener</code> interface should be implemented |
31 * The {@code ControllerEventListener} interface should be implemented by |
33 * by classes whose instances need to be notified when a <code>Sequencer</code> |
32 * classes whose instances need to be notified when a {@link Sequencer} has |
34 * has processed a requested type of MIDI control-change event. |
33 * processed a requested type of MIDI control-change event. To register a |
35 * To register a <code>ControllerEventListener</code> object to receive such |
34 * {@code ControllerEventListener} object to receive such notifications, invoke |
36 * notifications, invoke the |
35 * the |
37 * {@link Sequencer#addControllerEventListener(ControllerEventListener, int[]) |
36 * {@link Sequencer#addControllerEventListener(ControllerEventListener, int[]) |
38 * addControllerEventListener} method of <code>Sequencer</code>, |
37 * addControllerEventListener} method of {@code Sequencer}, specifying the types |
39 * specifying the types of MIDI controllers about which you are interested in |
38 * of MIDI controllers about which you are interested in getting control-change |
40 * getting control-change notifications. |
39 * notifications. |
41 * |
|
42 * @see MidiChannel#controlChange(int, int) |
|
43 * |
40 * |
44 * @author Kara Kytle |
41 * @author Kara Kytle |
|
42 * @see MidiChannel#controlChange(int, int) |
45 */ |
43 */ |
46 public interface ControllerEventListener extends EventListener { |
44 public interface ControllerEventListener extends EventListener { |
47 |
45 |
48 /** |
46 /** |
49 * Invoked when a <code>Sequencer</code> has encountered and processed |
47 * Invoked when a {@link Sequencer} has encountered and processed a |
50 * a control-change event of interest to this listener. The event passed |
48 * control-change event of interest to this listener. The event passed in is |
51 * in is a <code>ShortMessage</code> whose first data byte indicates |
49 * a {@code ShortMessage} whose first data byte indicates the controller |
52 * the controller number and whose second data byte is the value to which |
50 * number and whose second data byte is the value to which the controller |
53 * the controller was set. |
51 * was set. |
54 * |
52 * |
55 * @param event the control-change event that the sequencer encountered in |
53 * @param event the control-change event that the sequencer encountered in |
56 * the sequence it is processing |
54 * the sequence it is processing |
57 * |
|
58 * @see Sequencer#addControllerEventListener(ControllerEventListener, int[]) |
55 * @see Sequencer#addControllerEventListener(ControllerEventListener, int[]) |
59 * @see MidiChannel#controlChange(int, int) |
56 * @see MidiChannel#controlChange(int, int) |
60 * @see ShortMessage#getData1 |
57 * @see ShortMessage#getData1 |
61 * @see ShortMessage#getData2 |
58 * @see ShortMessage#getData2 |
62 */ |
59 */ |
63 public void controlChange(ShortMessage event); |
60 void controlChange(ShortMessage event); |
64 } |
61 } |