Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 9, 2009, 10:09:27 PM (16 years ago)
Author:
scheusso
Message:

Approach to make sounds synchronisable (not yet working)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/orxonox/sound/AmbientSound.cc

    r6203 r6307  
    4242
    4343    AmbientSound::AmbientSound(BaseObject* creator)
    44         : BaseObject(creator)
     44        : BaseObject(creator), Synchronisable(creator)
    4545    {
    4646        RegisterObject(AmbientSound);
     
    4848        // Ambient sounds always fade in
    4949        this->setVolume(0);
     50        this->registerVariables();
    5051    }
    5152
    5253    AmbientSound::~AmbientSound()
    5354    {
     55    }
     56   
     57    void AmbientSound::registerVariables()
     58    {
     59        registerVariable(volume_, ObjectDirection::ToClient, new NetworkCallback<BaseSound>(static_cast<BaseSound*>(this), &BaseSound::volumeChanged));
     60//         registerVariable(source_, ObjectDirection::ToClient, new NetworkCallback<BaseSound>(static_cast<BaseSound*>(this), &BaseSound::sourceChanged));
     61        registerVariable(ambientSource_, ObjectDirection::ToClient, new NetworkCallback<AmbientSound>(this, &AmbientSound::ambientSourceChanged));
     62        registerVariable(bLooping_, ObjectDirection::ToClient, new NetworkCallback<BaseSound>(static_cast<BaseSound*>(this), &BaseSound::loopingChanged));
     63        registerVariable(pitch_, ObjectDirection::ToClient, new NetworkCallback<BaseSound>(static_cast<BaseSound*>(this), &BaseSound::pitchChanged));
     64        registerVariable((int&)(BaseSound::state_), ObjectDirection::ToClient);
    5465    }
    5566
Note: See TracChangeset for help on using the changeset viewer.