MCPcopy Create free account
hub / github.com/TASEmulators/fceux / UpdateSoundChannelQualityMode

Function UpdateSoundChannelQualityMode

src/drivers/win/sound.cpp:759–811  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

757}
758
759void UpdateSoundChannelQualityMode(HWND hwndDlg)
760{
761 //If high quality, enable all
762 //If low quality, we only have two sliders, sq1 and triangle, rename them and disable the others
763
764 if (soundquality) //If high or highest
765 {
766 //Enable sliders & corresponding group boxes
767 if (soundo)
768 {
769 EnableWindow(GetDlgItem(hwndDlg,CTL_VOLUME_TRACKBAR_SQUARE2),TRUE);
770 EnableWindow(GetDlgItem(hwndDlg,CTL_VOLUME_TRACKBAR_NOISE),TRUE);
771 EnableWindow(GetDlgItem(hwndDlg,CTL_VOLUME_TRACKBAR_PCM),TRUE);
772 //Enable group boxes
773 EnableWindow(GetDlgItem(hwndDlg,133),TRUE);
774 EnableWindow(GetDlgItem(hwndDlg,134),TRUE);
775 EnableWindow(GetDlgItem(hwndDlg,135),TRUE);
776 }
777 //Set text for group boxes
778 SetDlgItemText(hwndDlg, ID_SOUND_TRITOP, ""); //Hacky, a static text box above the group box so I have more text space
779 SetDlgItemText(hwndDlg, 131, "Triangle");
780 SetDlgItemText(hwndDlg, 132, "Square 1");
781 SetDlgItemText(hwndDlg, 133, "Square 2");
782 SetDlgItemText(hwndDlg, 134, "Noise");
783 SetDlgItemText(hwndDlg, 135, "PCM");
784 //Set quality message off
785 SetDlgItemText(hwndDlg, ID_SOUND_QUALITYNOTIFY, "");
786 }
787 else //If low
788 {
789 //Disable sliders
790 EnableWindow(GetDlgItem(hwndDlg,CTL_VOLUME_TRACKBAR_SQUARE2),FALSE);
791 EnableWindow(GetDlgItem(hwndDlg,CTL_VOLUME_TRACKBAR_NOISE),FALSE);
792 EnableWindow(GetDlgItem(hwndDlg,CTL_VOLUME_TRACKBAR_PCM),FALSE);
793 //Disable group boxes
794 EnableWindow(GetDlgItem(hwndDlg,133),FALSE);
795 EnableWindow(GetDlgItem(hwndDlg,134),FALSE);
796 EnableWindow(GetDlgItem(hwndDlg,135),FALSE);
797 //Set text for group boxes
798 //These disabled until there is some control for pcm & triangle in low quality setting
799 //SetDlgItemText(hwndDlg, ID_SOUND_TRITOP, "Triangle/"); //Hacky, a static text box above the group box so I have more text space
800 //SetDlgItemText(hwndDlg, 131, "noise/pcm");
801 SetDlgItemText(hwndDlg, 131, "Noise");
802 SetDlgItemText(hwndDlg, 132, "Square");
803 SetDlgItemText(hwndDlg, 133, "Disabled"); //Set Square 2 to disabled
804 SetDlgItemText(hwndDlg, 134, "Disabled"); //Set Noise to disabled
805 SetDlgItemText(hwndDlg, 135, "Disabled"); //Set PCM to disabled
806 //Set quality message on
807 SetDlgItemText(hwndDlg, ID_SOUND_QUALITYNOTIFY, "(To enable these, use a higher quality setting)");
808 }
809
810 return;
811}
812
813
814

Callers 1

UpdateSDFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected