org.ocap.hardware.device.OCSound Maven / Gradle / Ivy
package org.ocap.hardware.device;
import org.havi.ui.HSound;
/**
* Extends the HAVi HSound
class, adding additional configuration options.
* Instances of this class provide control over audio gain level, muting, and
* output ports.
*
* @see AudioOutputPort
*/
public class OCSound extends HSound
{
/**
* Creates an OCSound
object.
* The following defaults apply upon construction:
*
* Attribute Method Default
* Level
* {@link #getLevel()}
* 1.0
* Mute
* {@link #isMuted()}
* false
* Outputs
* {@link #getAudioOutputs}
* the default audio output for the application constructing the
* OCSound
instance
*
*/
public OCSound()
{
// to be implemented
}
/**
* Set the gain using a floating point scale with values between 0.0 and 1.0.
* 0.0 is silence; 1.0 is the loudest level for associated audio output ports.
*
* @param level The new gain value specified in the level scale.
* @return The level that was actually set.
*
* @see #getLevel
* @see AudioOutputPort#setLevel
* @see AudioOutputPort#getLevel
*/
public float setLevel(float level)
{
return 0F;
}
/**
* Get the current gain set for this OCSound
* as a value between 0.0 and 1.0.
*
* @return The gain in the level scale (0.0-1.0).
* @see #setLevel
*/
public float getLevel()
{
return 0F;
}
/**
* Get the mute state of the audio signal associated with this audio clip.
*
* @return The current mute state:
* true
if muted and false
otherwise.
* @see #setMuted
*/
public boolean isMuted()
{
return true;
}
/**
* Mute or unmute the signal associated with this OCSound
.
* Redundant invocations of this method are ignored.
* The mute state does not effect the gain (as represented by {@link #getLevel()}.
*
* @param mute The new mute state:
* true
mutes the signal and false
unmutes the signal.
*
* @see #isMuted()
*/
public void setMuted(boolean mute)
{
// to be implemented
}
/**
* Get the audio output ports on which this audio clip would be played.
* By default, audio-clips will be played on the default audio output port
* for the application that created this OCSound
.
* Unless AudioOutputPort
s have been removed by calling
* removeAudioOutput
, this method SHALL return the
* at least the default AudioOutputPort
for the application.
* Unless AudioOutputPort
s have been added by calling
* addAudioOutput
, this method SHALL return at most
* the default AudioOutputPort
for the application.
*
* @return The set of target AudioOutputPort
s as an array.
* If all ports have been removed, then an empty array SHALL be returned.
*
* @see #addAudioOutput
* @see #removeAudioOutput
*/
public AudioOutputPort[] getAudioOutputs()
{
return new AudioOutputPort[0];
}
/**
* Add an AudioOutputPort
to the set of audio output ports where
* this clip will be played.
*
* Redundant additions SHALL have no effect.
*
* @param au The AudioOutputPort
to add.
*/
public void addAudioOutput(AudioOutputPort au)
{
// to be implemented
}
/**
* Remove an AudioOutputPort
from the set of audio ouput ports where
* this clip will be played.
*
* Attempting to remove an AudioOutputPort
that is not currently
* in the set of audio output ports for this OCSound
SHALL have
* no effect.
*
* @param au The AudioOutputPort
to remove.
*/
public void removeAudioOutput(AudioOutputPort au)
{
// to be implemented
}
}