static void SoundProperties_Multiple_OnOK( HWND hwndDlg ) { int c = g_Params.items.Count(); for ( int i = 0; i < c; i++ ) { // Gather info and make changes CSoundEntry *item = g_Params.items[ i ]; Assert( item ); if ( !item ) continue; int idx = g_pSoundEmitterSystem->GetSoundIndex( item->GetName() ); if ( !g_pSoundEmitterSystem->IsValidIndex( idx ) ) { continue; } CSoundParametersInternal *baseparams = g_pSoundEmitterSystem->InternalGetParametersForSound( idx ); if ( !baseparams ) return; // Start with old settings CSoundParametersInternal outparams; outparams.CopyFrom( *baseparams ); char sz[ 128 ]; GetDlgItemText( hwndDlg, IDC_CHANNEL, sz, sizeof( sz ) ); outparams.ChannelFromString( sz ); GetDlgItemText( hwndDlg, IDC_VOLUME, sz, sizeof( sz ) ); outparams.VolumeFromString( sz ); GetDlgItemText( hwndDlg, IDC_SOUNDLEVEL, sz, sizeof( sz ) ); outparams.SoundLevelFromString( sz ); GetDlgItemText( hwndDlg, IDC_PITCH, sz, sizeof( sz ) ); outparams.PitchFromString( sz ); bool owneronly = SendMessage( GetDlgItem( hwndDlg, IDC_OWNERONLY ), BM_GETCHECK, 0, 0 ) == BST_CHECKED ? true : false; outparams.SetOnlyPlayToOwner( owneronly ); g_pSoundEmitterSystem->UpdateSoundParameters( item->GetName(), outparams ); } // Repopulate things GetWorkspaceManager()->RefreshBrowsers(); }