ddf / Minim

A Java audio library, designed to be used with Processing.
http://code.compartmental.net/tools/minim
GNU Lesser General Public License v3.0
668 stars 136 forks source link

Result from Controller.getGain() is ambiguous #50

Closed migglu closed 8 years ago

migglu commented 8 years ago

If the current gain is 0, the getGain() method would return 0, but if no gain control is available it would also return 0. This would probably also be an issue with getVolume(), getPan() etc.

As I understand it the gain() method is deprecated in favor of these getGain() and setGain(), but there is no hasGainControl() that would tell whether or not gain control is present.

ddf commented 8 years ago

You can use hasControl(Controller.GAIN) to query for the existence of a gain control. The methods that give direct access to FloatControl objects are all deprecated because my plan is to remove all Javasound classes from the core library code eventually. When that happens there will either be a new method for querying availability or I will simply make them all work. That's a ways off though, so don't be shy about using the deprecated methods for now.