Audaspace 1.5.0
A high level audio library.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
IHandle Interface Referenceabstract

The IHandle interface represents a playback handles of a specific device. More...

#include <IHandle.h>

Inheritance diagram for IHandle:
Inheritance graph
[legend]

Public Member Functions

virtual ~IHandle ()
 Destroys the handle.
 
virtual bool pause ()=0
 Pauses a played back sound.
 
virtual bool resume ()=0
 Resumes a paused sound.
 
virtual bool stop ()=0
 Stops a played back or paused sound.
 
virtual bool getKeep ()=0
 Gets the behaviour of the device for a played back sound when the sound doesn't return any more samples.
 
virtual bool setKeep (bool keep)=0
 Sets the behaviour of the device for a played back sound when the sound doesn't return any more samples.
 
virtual bool seek (double position)=0
 Seeks in a played back sound.
 
virtual double getPosition ()=0
 Retrieves the current playback position of a sound.
 
virtual Status getStatus ()=0
 Returns the status of a played back sound.
 
virtual float getVolume ()=0
 Retrieves the volume of a playing sound.
 
virtual bool setVolume (float volume)=0
 Sets the volume of a playing sound.
 
virtual float getPitch ()=0
 Retrieves the pitch of a playing sound.
 
virtual bool setPitch (float pitch)=0
 Sets the pitch of a playing sound.
 
virtual int getLoopCount ()=0
 Retrieves the loop count of a playing sound.
 
virtual bool setLoopCount (int count)=0
 Sets the loop count of a playing sound.
 
virtual bool setStopCallback (stopCallback callback=0, void *data=0)=0
 Sets the callback function that's called when the end of a playing sound is reached.
 

Detailed Description

The IHandle interface represents a playback handles of a specific device.

Member Function Documentation

◆ getKeep()

virtual bool IHandle::getKeep ( )
pure virtual

Gets the behaviour of the device for a played back sound when the sound doesn't return any more samples.

Returns
  • true if the source will be paused when it's end is reached
  • false if the handle won't kept or is invalid.

Implemented in SoftwareDevice::SoftwareHandle.

◆ getLoopCount()

virtual int IHandle::getLoopCount ( )
pure virtual

Retrieves the loop count of a playing sound.

A negative value indicates infinity.

Returns
The remaining loop count.

Implemented in SoftwareDevice::SoftwareHandle.

◆ getPitch()

virtual float IHandle::getPitch ( )
pure virtual

Retrieves the pitch of a playing sound.

Returns
The pitch.

Implemented in SoftwareDevice::SoftwareHandle.

◆ getPosition()

virtual double IHandle::getPosition ( )
pure virtual

Retrieves the current playback position of a sound.

Returns
The playback position in seconds, or 0.0 if the handle is invalid.

Implemented in SoftwareDevice::SoftwareHandle.

◆ getStatus()

virtual Status IHandle::getStatus ( )
pure virtual

Returns the status of a played back sound.

Returns
  • STATUS_INVALID if the sound has stopped or the handle is . invalid
  • STATUS_PLAYING if the sound is currently played back.
  • STATUS_PAUSED if the sound is currently paused.
  • STATUS_STOPPED if the sound finished playing and is still kept in the device.
See also
Status

Implemented in SoftwareDevice::SoftwareHandle.

◆ getVolume()

virtual float IHandle::getVolume ( )
pure virtual

Retrieves the volume of a playing sound.

Returns
The volume.

Implemented in SoftwareDevice::SoftwareHandle.

◆ pause()

virtual bool IHandle::pause ( )
pure virtual

Pauses a played back sound.

Returns
  • true if the sound has been paused.
  • false if the sound isn't playing back or the handle is invalid.

Implemented in SoftwareDevice::SoftwareHandle.

◆ resume()

virtual bool IHandle::resume ( )
pure virtual

Resumes a paused sound.

Returns
  • true if the sound has been resumed.
  • false if the sound isn't paused or the handle is invalid.

Implemented in SoftwareDevice::SoftwareHandle.

◆ seek()

virtual bool IHandle::seek ( double position)
pure virtual

Seeks in a played back sound.

Parameters
positionThe new position from where to play back, in seconds.
Returns
  • true if the handle is valid.
  • false if the handle is invalid.
Warning
Whether the seek works or not depends on the sound source.

Implemented in SoftwareDevice::SoftwareHandle.

◆ setKeep()

virtual bool IHandle::setKeep ( bool keep)
pure virtual

Sets the behaviour of the device for a played back sound when the sound doesn't return any more samples.

Parameters
keepTrue when the source should be paused and not deleted.
Returns
  • true if the behaviour has been changed.
  • false if the handle is invalid.

Implemented in SoftwareDevice::SoftwareHandle.

◆ setLoopCount()

virtual bool IHandle::setLoopCount ( int count)
pure virtual

Sets the loop count of a playing sound.

A negative value indicates infinity.

Parameters
countThe new loop count.
Returns
  • true if the handle is valid.
  • false if the handle is invalid.

Implemented in SoftwareDevice::SoftwareHandle.

◆ setPitch()

virtual bool IHandle::setPitch ( float pitch)
pure virtual

Sets the pitch of a playing sound.

Parameters
pitchThe pitch.
Returns
  • true if the handle is valid.
  • false if the handle is invalid.

Implemented in SoftwareDevice::SoftwareHandle.

◆ setStopCallback()

virtual bool IHandle::setStopCallback ( stopCallback callback = 0,
void * data = 0 )
pure virtual

Sets the callback function that's called when the end of a playing sound is reached.

Parameters
callbackThe callback function.
dataThe data that should be passed to the callback function.
Returns
  • true if the handle is valid.
  • false if the handle is invalid.

Implemented in SoftwareDevice::SoftwareHandle.

◆ setVolume()

virtual bool IHandle::setVolume ( float volume)
pure virtual

Sets the volume of a playing sound.

Parameters
volumeThe volume.
Returns
  • true if the handle is valid.
  • false if the handle is invalid.

Implemented in SoftwareDevice::SoftwareHandle.

◆ stop()

virtual bool IHandle::stop ( )
pure virtual

Stops a played back or paused sound.

The handle is definitely invalid afterwards.

Returns
  • true if the sound has been stopped.
  • false if the handle is invalid.

Implemented in SoftwareDevice::SoftwareHandle.


The documentation for this interface was generated from the following file: