MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / UpdateDialog

Method UpdateDialog

editor/WorldSoundsDialog.cpp:575–762  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

573}
574
575void CWorldSoundsDialog::UpdateDialog() {
576 CEdit *ebox;
577 CStatic *sbox;
578 CButton *bbox;
579 int n = D3EditState.current_sound;
580 char str[50];
581 int radio_index[4];
582 int i;
583
584 int total_hardware_memory = 0;
585 int total_memory = 0;
586
587 Sound_system.CheckAndForceSoundDataAlloc(D3EditState.current_sound);
588
589 for (i = 0; i < MAX_SOUNDS; i++) {
590 if (Sounds[i].used)
591 total_memory += SoundFiles[Sounds[i].sample_index].sample_length * 2;
592 }
593
594 if (Num_sounds < 1) {
595 bbox = (CButton *)GetDlgItem(IDC_NEXT_SOUND);
596 bbox->EnableWindow(FALSE);
597 bbox = (CButton *)GetDlgItem(IDC_PREV_SOUND);
598 bbox->EnableWindow(FALSE);
599
600 return;
601 } else {
602 bbox = (CButton *)GetDlgItem(IDC_NEXT_SOUND);
603 bbox->EnableWindow(TRUE);
604 bbox = (CButton *)GetDlgItem(IDC_PREV_SOUND);
605 bbox->EnableWindow(TRUE);
606 }
607
608 if (!Sounds[n].used)
609 n = D3EditState.current_sound = GetNextSound(n);
610
611 ebox = (CEdit *)GetDlgItem(IDC_SOUNDMAXDIST_EDIT);
612 sprintf(str, "%f", Sounds[n].max_distance);
613 ebox->SetWindowText(str);
614
615 sbox = (CStatic *)GetDlgItem(IDC_SOUND_MEMORY_STATIC);
616 sprintf(str, "%d, %d H, %d Total", SoundFiles[Sounds[n].sample_index].sample_length / 512,
617 total_hardware_memory / 1024, total_memory / 1024);
618 sbox->SetWindowText(str);
619
620 ebox = (CEdit *)GetDlgItem(IDC_SOUNDMINDIST_EDIT);
621 sprintf(str, "%f", Sounds[n].min_distance);
622 ebox->SetWindowText(str);
623
624 ebox = (CEdit *)GetDlgItem(IDC_SOUNDINNERCONEANGLE_EDIT);
625 sprintf(str, "%d", Sounds[n].inner_cone_angle);
626 ebox->SetWindowText(str);
627
628 ebox = (CEdit *)GetDlgItem(IDC_SOUNDOUTERCONEANGLE_EDIT);
629 sprintf(str, "%d", Sounds[n].outer_cone_angle);
630 ebox->SetWindowText(str);
631
632 ebox = (CEdit *)GetDlgItem(IDC_SOUNDOUTERCONEVOL_EDIT);

Callers

nothing calls this directly

Calls 4

GetNextSoundFunction · 0.85
mng_FindTrackLockFunction · 0.85
SetCheckMethod · 0.80

Tested by

no test coverage detected