Source for javax.sound.midi.MidiChannel

   1: /* MidiChannel.java -- A MIDI channel
   2:    Copyright (C) 2005 Free Software Foundation, Inc.
   3: 
   4: This file is part of GNU Classpath.
   5: 
   6: GNU Classpath is free software; you can redistribute it and/or modify
   7: it under the terms of the GNU General Public License as published by
   8: the Free Software Foundation; either version 2, or (at your option)
   9: any later version.
  10: 
  11: GNU Classpath is distributed in the hope that it will be useful, but
  12: WITHOUT ANY WARRANTY; without even the implied warranty of
  13: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14: General Public License for more details.
  15: 
  16: You should have received a copy of the GNU General Public License
  17: along with GNU Classpath; see the file COPYING.  If not, write to the
  18: Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  19: 02110-1301 USA.
  20: 
  21: Linking this library statically or dynamically with other modules is
  22: making a combined work based on this library.  Thus, the terms and
  23: conditions of the GNU General Public License cover the whole
  24: combination.
  25: 
  26: As a special exception, the copyright holders of this library give you
  27: permission to link this library with independent modules to produce an
  28: executable, regardless of the license terms of these independent
  29: modules, and to copy and distribute the resulting executable under
  30: terms of your choice, provided that you also meet, for each linked
  31: independent module, the terms and conditions of the license of that
  32: module.  An independent module is a module which is not derived from
  33: or based on this library.  If you modify this library, you may extend
  34: this exception to your version of the library, but you are not
  35: obligated to do so.  If you do not wish to do so, delete this
  36: exception statement from your version. */
  37: 
  38: 
  39: package javax.sound.midi;
  40: 
  41: /**
  42:  * A MIDI channel.
  43:  * 
  44:  * @author Anthony Green (green@redhat.com)
  45:  * @since 1.3
  46:  *
  47:  */
  48: public interface MidiChannel
  49: {
  50:   
  51:   /**
  52:    * Start playing a note.
  53:    * 
  54:    * @param noteNumber the MIDI note number
  55:    * @param velocity the velocity at which the key was pressed
  56:    */
  57:   public void noteOn(int noteNumber, int velocity);
  58:   
  59:   /**
  60:    * Stop playing a note.
  61:    *
  62:    * @param noteNumber the MIDI note number
  63:    * @param velocity the volcity at which the ket was released
  64:    */
  65:   public void noteOff(int noteNumber, int velocity);
  66:   
  67:   /**
  68:    * Stop playing a note.
  69:    * 
  70:    * @param noteNumber the MIDI note number
  71:    */
  72:   public void noteOff(int noteNumber);
  73:   
  74:   /**
  75:    * Change in a key pressure for a note.
  76:    * 
  77:    * @param noteNumber the MIDI note number
  78:    * @param pressure the key pressure
  79:    */
  80:   public void setPolyPressure(int noteNumber, int pressure);
  81:   
  82:   /**
  83:    * Get the key pressure for a note.
  84:    * 
  85:    * @param noteNumber the MIDI note number
  86:    * @return the key pressure
  87:    */
  88:   public int getPolyPressure(int noteNumber);
  89:   
  90:   /**
  91:    * Set the key pressure for the channel.
  92:    * 
  93:    * @param pressure the key pressure
  94:    */
  95:   public void setChannelPressure(int pressure);
  96:   
  97:   /**
  98:    * Get the key pressure for the channel.
  99:    * 
 100:    * @return the key pressure
 101:    */
 102:   public int getChannelPressure();
 103:   
 104:   /**
 105:    * Set a change in a controller's value.
 106:    * 
 107:    * @param controller the MIDI controller number (0 to 127)
 108:    * @param value the new value (0 to 127)
 109:    */
 110:   public void controlChange(int controller, int value);
 111:   
 112:   /**
 113:    * Get a controller's value.
 114:    * 
 115:    * @param controller the MIDI controller number (0 to 127)
 116:    * @return the controller's value (0 to 127)
 117:    */
 118:   public int getController(int controller);
 119:   
 120:   /**
 121:    * Change the patch for this channel.
 122:    * 
 123:    * @param program the patch number to switch to (0 to 127)
 124:    */
 125:   public void programChange(int program);
 126:   
 127:   /**
 128:    * Change the bank and patch for this channel.
 129:    * 
 130:    * @param bank the bank to switch to (0 to 16383)
 131:    * @param program the patch to switch to (0 to 127)
 132:    */
 133:   public void programChange(int bank, int program);
 134:   
 135:   /**
 136:    * Get the current patch for this channel.
 137:    * 
 138:    * @return current patch (0 to 127)
 139:    */
 140:   public int getProgram();
 141:   
 142:   /**
 143:    * Change the pitch bend for this channel using a positive 14-bit value.
 144:    * 
 145:    * @param bend the new pitch bend value
 146:    */
 147:   public void setPitchBend(int bend);
 148:   
 149:   /**
 150:    * Get the pitch bend for this channel as a positive 14-bit value.
 151:    * 
 152:    * @return the current patch bend value
 153:    */
 154:   public int getPitchBend();
 155:   
 156:   /**
 157:    * Reset all MIDI controllers to their default values.
 158:    */
 159:   public void resetAllControllers();
 160:   
 161:   /**
 162:    * Stop playing all notes.  Sound may not stop.
 163:    */
 164:   public void allNotesOff();
 165:   
 166:   /**
 167:    * Stop all sound.
 168:    */
 169:   public void allSoundOff();
 170:   
 171:   /**
 172:    * Set whether or not local controls are on or off.  They are on by
 173:    * default.
 174:    * 
 175:    * @param on true to enable local controls, false to disable
 176:    * @return the new value
 177:    */
 178:   public boolean localControl(boolean on);
 179:   
 180:   /**
 181:    * Turns mono mode on or off.
 182:    * 
 183:    * @param on true to enable mono mode, false to disable 
 184:    */
 185:   public void setMono(boolean on);
 186:   
 187:   /**
 188:    * Get the current mono mode.
 189:    * 
 190:    * @return true if mono is enabled, false otherwise
 191:    */
 192:   public boolean getMono();
 193:   
 194:   /**
 195:    * Turns omni mode on or off.
 196:    * 
 197:    * @param on true to enable omni mode, false to disable
 198:    */
 199:   public void setOmni(boolean on);
 200:   
 201:   /**
 202:    * Get the current omni mode.
 203:    * 
 204:    * @return true if omni is enabled, false otherwise
 205:    */
 206:   public boolean getOmni();
 207:   
 208:   /**
 209:    * Turns mute mode on or off.
 210:    * 
 211:    * @param mute true to enable mute mode, false to disable
 212:    */
 213:   public void setMute(boolean mute);
 214:   
 215:   /**
 216:    * Get the current mute mode.
 217:    * 
 218:    * @return true if mute is enabled, false otherwise
 219:    */
 220:   public boolean getMute();
 221:   
 222:   /**
 223:    * Turns solo mode on or off.  If any channels are soloed, then only those
 224:    * channels make sounds, otherwise all channels will make sound.
 225:    * 
 226:    * @param solo true to enable solo mode, false to disable
 227:    */
 228:   public void setSolo(boolean solo);
 229:   
 230:   /**
 231:    * Get the current solo mode.
 232:    * 
 233:    * @return true is solo is enabled, false otherwise.
 234:    */
 235:   public boolean getSolo();
 236: }