| 448 | } |
| 449 | |
| 450 | void CWorldSoundsDialog::OnLoadSound() { |
| 451 | char filename[255]; |
| 452 | int raw_handle; |
| 453 | int sound_handle; |
| 454 | int c = 1, finding_name = 1; |
| 455 | |
| 456 | // Get the filename of the representing image |
| 457 | |
| 458 | CString filter = "Descent III files (*.wav)|*.wav||"; |
| 459 | |
| 460 | if (!OpenFileDialog(this, (LPCSTR)filter, filename, Current_sounds_dir, sizeof(Current_sounds_dir))) |
| 461 | return; |
| 462 | |
| 463 | sound_handle = D3EditState.current_sound; |
| 464 | |
| 465 | // Okay, we selected a file. Lets do what needs to be done here. |
| 466 | raw_handle = LoadSoundFile(filename, Sounds[sound_handle].import_volume, true); |
| 467 | |
| 468 | if (raw_handle < 0) { |
| 469 | OutrageMessageBox("Invalid sound file."); |
| 470 | return; |
| 471 | } |
| 472 | |
| 473 | Sounds[sound_handle].sample_index = raw_handle; |
| 474 | |
| 475 | // Finally, save a local copy of the raw |
| 476 | |
| 477 | std::filesystem::path curname = LocalSoundsDir / SoundFiles[Sounds[sound_handle].sample_index].name; |
| 478 | cf_CopyFile(curname, filename); |
| 479 | |
| 480 | UpdateDialog(); |
| 481 | } |
| 482 | |
| 483 | void CWorldSoundsDialog::OnNextSound() { |
| 484 | D3EditState.current_sound = GetNextSound(D3EditState.current_sound); |
nothing calls this directly
no test coverage detected