Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Sound Class Reference

The Sound class plays WAVE sound files and can invoke the audible alarm. More...

#include </home/clem/local/src/opie/core/multimedia/opieplayer/libflash/sound.h>

Inheritance diagram for Sound:

Inheritance graph
[legend]
Collaboration diagram for Sound:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Sound (long id)
 ~Sound ()
void setSoundFlags (long f)
char * setNbSamples (long n)
long getRate ()
long getChannel ()
long getNbSamples ()
long getSampleSize ()
char * getSamples ()
 Sound (const QString &name)
 ~Sound ()
void play ()
void playLoop ()
void stop ()
bool isFinished () const
bool isFinished () const __attribute__((weak))

Static Public Member Functions

static void soundAlarm ()

Private Attributes

long soundRate
long stereo
long sampleSize
char * samples
long nbSamples
SoundDatad

Friends

void register_qpe_sound_finished (Sound *, QObject *obj, const char *slot)

Detailed Description

The Sound class plays WAVE sound files and can invoke the audible alarm.

The Sound class is constructed with the .wav music file name. The Sound class retrieves the sound file from the shared Resource class. This class ties together QSound and the available sound resources.

To sound an audible system alarm, call the static method soundAlarm()

Definition at line 25 of file sound.h.


Constructor & Destructor Documentation

Sound::Sound long  id  ) 
 

Definition at line 40 of file sound.cc.

References samples, sampleSize, soundRate, and stereo.

Sound::~Sound  ) 
 

Destroys the sound

Definition at line 48 of file sound.cc.

References samples.

Sound::Sound const QString name  ) 
 

Opens a wave sound file name for playing Resource is used for finding the file

Definition at line 179 of file sound.cpp.

References d.

Sound::~Sound  ) 
 


Member Function Documentation

long Sound::getChannel  ) 
 

Definition at line 116 of file sound.cc.

References stereo.

Referenced by SoundMixer::startSound().

long Sound::getNbSamples  ) 
 

Definition at line 121 of file sound.cc.

References nbSamples.

Referenced by SoundMixer::startSound().

long Sound::getRate  ) 
 

Definition at line 111 of file sound.cc.

References soundRate.

Referenced by SoundMixer::startSound().

char * Sound::getSamples  ) 
 

Definition at line 131 of file sound.cc.

References samples.

Referenced by SoundMixer::startSound().

long Sound::getSampleSize  ) 
 

Definition at line 126 of file sound.cc.

References sampleSize.

Referenced by SoundMixer::startSound().

bool Sound::isFinished  )  const
 

bool Sound::isFinished  )  const
 

Definition at line 220 of file sound.cpp.

References d, and SoundData::isFinished().

Referenced by Opie::Core::Internal::Zaurus::buzzer(), Opie::Core::Internal::SIMpad::playAlarmSound(), Opie::Core::Internal::Ramses::playAlarmSound(), Opie::Core::Internal::MyPal::playAlarmSound(), Opie::Core::Internal::iPAQ::playAlarmSound(), and Opie::Core::Internal::GenuineIntel::playAlarmSound().

void Sound::play  ) 
 

Play the sound once

Definition at line 195 of file sound.cpp.

References d, SoundData::killTimers(), and SoundData::playLoop().

Referenced by Bullet::Bullet(), Opie::Core::Internal::Zaurus::buzzer(), Base::damageBase(), Man::done(), ParaShoot::levelUp(), Opie::Core::Internal::Ramses::playAlarmSound(), and Simple2::slotFire().

void Sound::playLoop  ) 
 

Play the sound, repeatedly until stop() is called

Definition at line 204 of file sound.cpp.

References d, SoundData::killTimers(), and SoundData::playLoop().

Referenced by Helicopter::Helicopter().

char * Sound::setNbSamples long  n  ) 
 

Definition at line 96 of file sound.cc.

References nbSamples, samples, sampleSize, size, and stereo.

Referenced by CInputScript::ParseDefineSound().

void Sound::setSoundFlags long  f  ) 
 

Definition at line 56 of file sound.cc.

References GET_SOUND_RATE_CODE, printf, sampleSize, soundIs16bit, soundIsADPCMCompressed, soundIsStereo, soundRate, and stereo.

Referenced by CInputScript::ParseDefineSound().

void Sound::soundAlarm  )  [static]
 

Sounds the audible system alarm. This is used for applications such as Calendar when it needs to alarm the user of an event.

Definition at line 232 of file sound.cpp.

Referenced by Clock::alarmTimeout(), DateBook::appMessage(), Clock::appMessage(), OPimMainWindow::startAlarm(), Opie::OPimMainWindow::startAlarm(), OPimMainWindow::timerEvent(), Opie::OPimMainWindow::timerEvent(), and DateBook::timerEvent().

void Sound::stop void   ) 
 

Do not repeat the sound after it finishes. This will end a playLoop()

Definition at line 213 of file sound.cpp.

References d, and SoundData::killTimers().


Friends And Related Function Documentation

void register_qpe_sound_finished Sound snd,
QObject *  obj,
const char *  slot
[friend]
 

Definition at line 170 of file sound.cpp.


Member Data Documentation

SoundData* Sound::d [private]
 

Definition at line 44 of file sound.h.

Referenced by isFinished(), play(), playLoop(), register_qpe_sound_finished(), Sound(), and stop().

long Sound::nbSamples [private]
 

Definition at line 31 of file sound.h.

Referenced by getNbSamples(), and setNbSamples().

char* Sound::samples [private]
 

Definition at line 30 of file sound.h.

Referenced by getSamples(), setNbSamples(), Sound(), and ~Sound().

long Sound::sampleSize [private]
 

Definition at line 28 of file sound.h.

Referenced by getSampleSize(), setNbSamples(), setSoundFlags(), and Sound().

long Sound::soundRate [private]
 

Definition at line 26 of file sound.h.

Referenced by getRate(), setSoundFlags(), and Sound().

long Sound::stereo [private]
 

Definition at line 27 of file sound.h.

Referenced by getChannel(), setNbSamples(), setSoundFlags(), and Sound().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:52:15 2005 for OPIE by  doxygen 1.4.2