/Users/lyon/j4p/src/sound/player/LiveSoundEvent.java
|
1 package sound.player;
2
3 /**
4 * Created by IntelliJ IDEA.
5 * User: Douglas Lyon
6 * Date: Dec 13, 2004
7 * Time: 8:56:46 PM
8 * Copyright DocJava, Inc.
9 */
10 public class LiveSoundEvent {
11
12 /**
13 * Construct a LiveSoundEvent, with the specified parameter.
14 *
15 * @param parameter The audio parameter of LiveSound that
16 * has changed. The value of parameter should be one of
17 * LiveSoundEvent.SAMPLE_RATE, LiveSoundEvent.CHANNELS,
18 * LiveSoundEvent.BUFFER_SIZE, or
19 * LiveSoundEvent.BITS_PER_SAMPLE.
20 */
21 public LiveSoundEvent(int parameter) {
22 // FIXME: Should check that the value is parameter is legal.
23 _parameter = parameter;
24 }
25
26 ///////////////////////////////////////////////////////////////////
27 //// public methods ////
28
29 /**
30 * Return the parameter of LiveSound that has changed. The
31 * corresponding method of LiveSound may then be invoked do
32 * discover the new value of the parameter. For example, if
33 * a sample rate change occurs, then this method will return
34 * LiveSoundEvent.SAMPLE_RATE. The getSampleRate() method of
35 * LiveSound may then be invoked to discover the new value
36 * of the sample rate.
37 *
38 * @return SAMPLE_RATE, CHANNELS, BUFFER_SIZE, or BITS_PER_SAMPLE.
39 */
40 public int getSoundParameter() {
41 return _parameter;
42 }
43
44 ///////////////////////////////////////////////////////////////////
45 //// public members ////
46
47 /**
48 * The value indicates a sample rate change event.
49 */
50 public static final int SAMPLE_RATE = 0;
51
52 /**
53 * The value indicates a channel number change event.
54 */
55 public static final int CHANNELS = 1;
56
57 /**
58 * The value indicates a buffer size change event.
59 */
60 public static final int BUFFER_SIZE = 2;
61
62 /**
63 * The value indicates a bits per channel change event.
64 */
65 public static final int BITS_PER_SAMPLE = 3;
66
67 ///////////////////////////////////////////////////////////////////
68 //// private fields ////
69
70 private int _parameter;
71 }