Share via


BumpBar.BumpBarSound Method

Sounds the bump bar enunciator for the bump bar(s) specified by the units parameter.

Namespace: Microsoft.PointOfService
Assembly: Microsoft.PointOfService (in microsoft.pointofservice.dll)

Usage

'Usage
Dim units As DeviceUnits
Dim frequency As Integer
Dim duration As Integer
Dim numberOfCycles As Integer
Dim interSoundWait As Integer
Dim bumpBar1 As BumpBar
bumpBar1.BumpBarSound(units, frequency, duration, numberOfCycles, interSoundWait)

Syntax

'Declaration
Public MustOverride Sub BumpBarSound( _
    ByVal units As DeviceUnits, _
    ByVal frequency As Integer, _
    ByVal duration As Integer, _
    ByVal numberOfCycles As Integer, _
    ByVal interSoundWait As Integer _
)
public abstract void BumpBarSound(
    DeviceUnits units,
    int frequency,
    int duration,
    int numberOfCycles,
    int interSoundWait
);
public: abstract Void BumpBarSound(
    DeviceUnits^ units,
    Int32 frequency,
    Int32 duration,
    Int32 numberOfCycles,
    Int32 interSoundWait
);
public abstract void BumpBarSound(
    DeviceUnits units,
    int frequency,
    int duration,
    int numberOfCycles,
    int interSoundWait
);
public abstract function BumpBarSound(
     units : DeviceUnits,
     frequency : int,
     duration : int,
     numberOfCycles : int,
     interSoundWait : int
) : Void;

Parameters

  • units
    Bitwise mask indicating which bump bar unit(s) to operate on.
  • frequency
    Tone frequency in Hertz.
  • duration
    Tone duration in milliseconds.
  • numberOfCycles
    If WaitForever, then start bump bar sounding and, repeat continuously. Else perform the specified number of cycles.
  • interSoundWait
    When numberOfCycles is not one, then pause for interSoundWait milliseconds before repeating the tone cycle (before playing the tone again)

Remarks

BumpBarSound is performed synchronously if AsyncMode is FALSE, and asynchronously if AsyncMode is TRUE.

The duration of a tone cycle is:

After the bump bar has started an asynchronous sound, you can stop the sound by using the ClearOutput method. (When an interSoundWait value of WaitForever is used to start the sound, an application must use ClearOutput to stop the continuous sounding of tones.)

If the CapTone property is FALSE for the selected unit(s), an Illegal exception is thrown.

The following code example sounds one tone on unit ID 1 and unit ID 4. The frequency is set to 64 Hertz and will sound for 100 milliseconds:

BB.BumpBarSound( Unit1 | Unit4, 64, 100, 1, 0 )

BumpBarSound returns void if successful, and it can throw the following exceptions:

Value

Meaning

Illegal

One of the following errors occurred:

  • numberOfCycles is neither a positive, non-zero value nor WaitForever.

  • numberOfCycles is WaitForever when AsyncMode is FALSE.

  • A negative interSoundWait is specified.

  • units is zero or a non-existent unit is specified.

  • A unit in Units does not support the CapTone capability.

The DeviceErrorEventArgs.ErrorUnits and DeviceErrorEventArgs.ErrorCodeExtended properties may be updated before return.

Failure

An error occurred while communicating with one of the bump bar units specified by the units parameter. The DeviceErrorEventArgs.ErrorUnits and DeviceErrorEventArgs.ErrorCodeExtended properties are updated before return. (Can only be returned if AsyncMode is FALSE.)

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, Windows Longhorn, and Windows 2000

Target Platforms

See Also

Reference

BumpBar Class
BumpBar Members
Microsoft.PointOfService Namespace
AsyncMode
ErrorString
ErrorUnits
CapTone
ClearOutput