| 26 | |
| 27 | |
| 28 | SFXDSVoice* 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 | |
| 57 | SFXDSVoice::SFXDSVoice( SFXDSDevice *device, |
| 58 | SFXDSBuffer *buffer, |
nothing calls this directly
no test coverage detected