Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10351 in orxonox.OLD


Ignore:
Timestamp:
Jan 24, 2007, 7:44:32 PM (17 years ago)
Author:
patrick
Message:

more sound entity

Location:
trunk/src/world_entities
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/sound_entity.cc

    r10321 r10351  
    4040  this->soundSource.setSourceNode(this);
    4141
     42  if( root != NULL)
     43    this->loadParams(root);
     44
    4245  this->thunderBuffer = OrxSound::ResourceSoundBuffer("sounds/atmosphere/thunder.wav");
    4346}
     
    5053{
    5154}
     55
     56
     57/**
     58 * loading stuff
     59 * @param root xml element
     60 */
     61void SoundEntity::loadParams(const TiXmlElement* root)
     62{
     63  LoadParam(root, "soundfile", this, SoundEntity, setSoundFile)
     64      .describe("Sets the file of the sound source");
     65
     66  LoadParam(root, "frequency", this, SoundEntity, setSoundFile)
     67      .describe("Sets the file of the sound source");
     68}
     69
     70
     71/**
     72 * sets the sound file
     73 * @param fileName name of the sound source
     74 */
     75void SoundEntity::setSoundFile(const std::string fileName)
     76{
     77  this->soundBuffer = OrxSound::ResourceSoundBuffer(fileName);
     78}
     79
    5280
    5381void SoundEntity::activate()
  • trunk/src/world_entities/sound_entity.h

    r10321 r10351  
    2626    virtual ~SoundEntity ();
    2727
     28    virtual void loadParams(const TiXmlElement* root);
     29
     30    void setSoundFile(const std::string fileName);
     31
    2832    virtual void activate();
    2933    virtual void deactivate();
     
    3438
    3539    OrxSound::SoundSource    soundSource;
    36     OrxSound::SoundBuffer    thunderBuffer;
     40    OrxSound::SoundBuffer    soundBuffer;
    3741};
    3842
Note: See TracChangeset for help on using the changeset viewer.