Opus+ Version 1.0 Java API

opusplus.core.instruments
Class DrumKit

java.lang.Object
  extended by opusplus.core.instruments.DrumKit
All Implemented Interfaces:
java.lang.Cloneable

public class DrumKit
extends java.lang.Object

    
implements java.lang.Cloneable

    

Holds a selection of drum sounds which act as a 'kit'. These kits can be assembled at runtime to provide a variety of percussive possibilities.

Author:
Adrian Marriott

Constructor Summary
DrumKit(java.lang.String kitName)
          Creates a named, empty drum kit object containing no drums
DrumKit(java.lang.String kitName, DrumScale upper, DrumScale lower)
          Creates a named drum kit object containing the drums scales specified
 
Method Summary
 java.lang.Object clone()
          Deep copy implementation of the clone method.
 java.lang.String dumpKit()
          Prints a representation of the kit useful for debugging purposes.
 boolean equals(DrumKit other)
          Equality definition for drum kits.
 java.util.ArrayList getDrumIds()
          Returns an array list of the drum identifiers that comprise this kit.
 DrumKitId getDrumKitId()
          Not all drum kits have an id.
 java.lang.String getKitName()
          Returns the unique name of the kit.
 int getKitSize()
          Get kit size returns the number of drum sounds in this kit
 DrumScale getLowerDrumScale()
          Returns the lower drum scale which comprises part of this drum kit
 DrumScale getUpperDrumScale()
          Returns the upper drum scale which comprises part of this drum kit
 void setLowerDrumScale(DrumScale lower)
          Sets the lower drum scale which comprises part of this kit
 void setUpperDrumScale(DrumScale upper)
          Sets the upper drum scale which comprises part of this drum kit
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DrumKit

public DrumKit(java.lang.String kitName)
Creates a named, empty drum kit object containing no drums


DrumKit

public DrumKit(java.lang.String kitName,
               DrumScale upper,
               DrumScale lower)
Creates a named drum kit object containing the drums scales specified

Method Detail

getKitName

public java.lang.String getKitName()
Returns the unique name of the kit.


getLowerDrumScale

public final DrumScale getLowerDrumScale()
Returns the lower drum scale which comprises part of this drum kit


setLowerDrumScale

public final void setLowerDrumScale(DrumScale lower)
Sets the lower drum scale which comprises part of this kit


getUpperDrumScale

public final DrumScale getUpperDrumScale()
Returns the upper drum scale which comprises part of this drum kit


setUpperDrumScale

public final void setUpperDrumScale(DrumScale upper)
Sets the upper drum scale which comprises part of this drum kit


getKitSize

public int getKitSize()
Get kit size returns the number of drum sounds in this kit


getDrumIds

public java.util.ArrayList getDrumIds()
Returns an array list of the drum identifiers that comprise this kit.


getDrumKitId

public DrumKitId getDrumKitId()
Not all drum kits have an id. Only the 'standard drum kits have this luxury. For kits known at compile time, this method returns the enumerated constant which can be used to identify this kit object. This allows functions to be passed kit objects and perform operations on them in switch and case easily. However, these are of limited use because for those kits created at run-time, this method returns null.


dumpKit

public java.lang.String dumpKit()
Prints a representation of the kit useful for debugging purposes.


equals

public boolean equals(DrumKit other)
Equality definition for drum kits. Two drum kits are equal if they have the same drums sounds in each of their voices and in the same order. Note, this does NOT override the system equals() method because the signature should take an Object argument. This means that it will not be used by methods such as contains() on collections for example.


clone

public java.lang.Object clone()
Deep copy implementation of the clone method.

Overrides:
clone in class java.lang.Object

Opus+ Version 1.0 Java API

Copyright © 2005-2010 Adrian Marriott.
All Rights Reserved.