MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / create

Method create

Engine/source/sfx/dsound/sfxDSVoice.cpp:28–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26
27
28SFXDSVoice* SFXDSVoice::create( SFXDSDevice *device, SFXDSBuffer *buffer )
29{
30 AssertFatal( buffer, "SFXDSVoice::create() - Got null buffer!" );
31
32 IDirectSoundBuffer8 *dsBuffer8 = NULL;
33 if ( !buffer->createVoice( &dsBuffer8 ) || !dsBuffer8 )
34 return NULL;
35
36 // Now try to grab a 3D interface... if we don't
37 // get one its probably because its not a 3d sound.
38 IDirectSound3DBuffer8* dsBuffer3d8 = NULL;
39 dsBuffer8->QueryInterface( IID_IDirectSound3DBuffer8, (LPVOID*)&dsBuffer3d8 );
40
41 // Create the voice and return!
42 SFXDSVoice* voice = new SFXDSVoice( device,
43 buffer,
44 dsBuffer8,
45 dsBuffer3d8 );
46
47 // Now set the voice to a default state.
48 // The buffer from which we have duplicated may have been assigned different
49 // properties and we don't want to inherit these.
50
51 voice->setVolume( 1.0 );
52 voice->setPitch( 1.0 );
53
54 return voice;
55}
56
57SFXDSVoice::SFXDSVoice( SFXDSDevice *device,
58 SFXDSBuffer *buffer,

Callers

nothing calls this directly

Calls 3

createVoiceMethod · 0.45
setVolumeMethod · 0.45
setPitchMethod · 0.45

Tested by

no test coverage detected