-// set source velocity of all managed sounds
-void SGSampleGroup::set_velocity( const SGVec3f &vel ) {
- if ( isnan(vel[0]) || isnan(vel[1]) || isnan(vel[2]) )
- {
- SG_LOG( SG_GENERAL, SG_ALERT, "NAN's found in SampleGroup velocity");
- return;
- }
-
- if (_velocity != vel) {
- sample_map_iterator sample_current = _samples.begin();
- sample_map_iterator sample_end = _samples.end();
- for ( ; sample_current != sample_end; ++sample_current ) {
- SGSoundSample *sample = sample_current->second;
- sample->set_velocity( vel );
- }
- _velocity = vel;
- }
-}
-
-// set the source position of all managed sounds
-void SGSampleGroup::set_position_geod( const SGGeod& pos ) {
-
- sample_map_iterator sample_current = _samples.begin();
- sample_map_iterator sample_end = _samples.end();
- for ( ; sample_current != sample_end; ++sample_current ) {
- SGSoundSample *sample = sample_current->second;
- sample->set_position_geod( pos );
+void SGSampleGroup::set_volume( float vol )
+{
+ if (vol > _volume*1.01 || vol < _volume*0.99) {
+ _volume = vol;
+ if (_volume < 0.0) _volume = 0.0;
+ if (_volume > 1.0) _volume = 1.0;
+ _changed = true;