Glk::SoundChannel Class Reference

Holds the data for a playing sound. More...

#include <sound.h>

+ Collaboration diagram for Glk::SoundChannel:

Public Member Functions

 SoundChannel (Sounds *owner, uint volume)
 Constructor. More...
 ~SoundChannel ()
 Destructor. More...
uint play (uint soundNum, uint repeats=1, uint notify=0)
 Play a sound. More...
void stop ()
 Stop playing sound. More...
void poll ()
 Poll for whether a playing sound was finished. More...
void setVolume (uint volume, uint duration=0, uint notify=0)
 Change the volume. More...
void pause ()
 Pause playback. More...
void unpause ()
 Unpause playback. More...

Public Attributes

uint _rock
gidispatch_rock_t _dispRock

Private Attributes

uint _soundNum
uint _notify
Audio::SoundHandle _handle
uint _defaultVolume

Detailed Description

Holds the data for a playing sound.

Definition at line 40 of file sound.h.

Constructor & Destructor Documentation

◆ SoundChannel()

Glk::SoundChannel::SoundChannel ( Sounds owner,
uint  volume 


Definition at line 76 of file sound.cpp.

◆ ~SoundChannel()

Glk::SoundChannel::~SoundChannel ( )


Definition at line 84 of file sound.cpp.

Member Function Documentation

◆ pause()

void Glk::SoundChannel::pause ( )

Pause playback.

Definition at line 177 of file sound.cpp.

◆ play()

uint Glk::SoundChannel::play ( uint  soundNum,
uint  repeats = 1,
uint  notify = 0 

Play a sound.

Definition at line 92 of file sound.cpp.

◆ poll()

void Glk::SoundChannel::poll ( )

Poll for whether a playing sound was finished.

Definition at line 159 of file sound.cpp.

◆ setVolume()

void Glk::SoundChannel::setVolume ( uint  volume,
uint  duration = 0,
uint  notify = 0 

Change the volume.

volumeVolume from 0 (silence) to 0x10000 (full volume)
durationOptional duration for a gradual volume change
notifyIf non-zero, triggers a evtype_VolumeNotify when the volume change duration finishes

Definition at line 167 of file sound.cpp.

◆ stop()

void Glk::SoundChannel::stop ( void  )

Stop playing sound.

Definition at line 155 of file sound.cpp.

◆ unpause()

void Glk::SoundChannel::unpause ( )

Unpause playback.

Definition at line 181 of file sound.cpp.

Member Data Documentation

◆ _defaultVolume

uint Glk::SoundChannel::_defaultVolume

Definition at line 46 of file sound.h.

◆ _dispRock

gidispatch_rock_t Glk::SoundChannel::_dispRock

Definition at line 49 of file sound.h.

◆ _handle

Audio::SoundHandle Glk::SoundChannel::_handle

Definition at line 45 of file sound.h.

◆ _notify

uint Glk::SoundChannel::_notify

Definition at line 44 of file sound.h.

◆ _owner

Sounds* Glk::SoundChannel::_owner

Definition at line 42 of file sound.h.

◆ _rock

uint Glk::SoundChannel::_rock

Definition at line 48 of file sound.h.

◆ _soundNum

uint Glk::SoundChannel::_soundNum

Definition at line 43 of file sound.h.

The documentation for this class was generated from the following files: