--- hatari/src/gui-sdl/dlgSound.c 2019/04/09 08:49:44 1.1.1.9 +++ hatari/src/gui-sdl/dlgSound.c 2019/04/09 08:52:15 1.1.1.11 @@ -15,21 +15,23 @@ const char DlgSound_fileid[] = "Hatari d #define DLGSOUND_ENABLE 3 -#define DLGSOUND_11KHZ 5 -#define DLGSOUND_12KHZ 6 -#define DLGSOUND_16KHZ 7 -#define DLGSOUND_22KHZ 8 -#define DLGSOUND_25KHZ 9 -#define DLGSOUND_32KHZ 10 -#define DLGSOUND_44KHZ 11 -#define DLGSOUND_48KHZ 12 -#define DLGSOUND_50KHZ 13 -#define DLGSOUND_TABLE 15 -#define DLGSOUND_LINEAR 16 -#define DLGSOUND_RECNAME 20 -#define DLGSOUND_RECBROWSE 21 -#define DLGSOUND_RECORD 22 -#define DLGSOUND_EXIT 23 +#define DLGSOUND_SYNC 4 +#define DLGSOUND_11KHZ 6 +#define DLGSOUND_12KHZ 7 +#define DLGSOUND_16KHZ 8 +#define DLGSOUND_22KHZ 9 +#define DLGSOUND_25KHZ 10 +#define DLGSOUND_32KHZ 11 +#define DLGSOUND_44KHZ 12 +#define DLGSOUND_48KHZ 13 +#define DLGSOUND_50KHZ 14 +#define DLGSOUND_MODEL 16 +#define DLGSOUND_TABLE 17 +#define DLGSOUND_LINEAR 18 +#define DLGSOUND_RECNAME 22 +#define DLGSOUND_RECBROWSE 23 +#define DLGSOUND_RECORD 24 +#define DLGSOUND_EXIT 25 static char dlgRecordName[35]; @@ -38,33 +40,35 @@ static char dlgRecordName[35]; /* The sound dialog: */ static SGOBJ sounddlg[] = { - { SGBOX, 0,0, 0, 0, 38,24, NULL }, - { SGBOX, 0,0, 1, 1, 36,11, NULL }, + { SGBOX, 0,0, 0, 0, 40,25, NULL }, + { SGBOX, 0,0, 1, 1, 38,13, NULL }, { SGTEXT, 0,0, 4, 2, 13,1, "SOUND" }, - { SGCHECKBOX, 0,0, 14, 2, 14,1, "Enabled" }, + { SGCHECKBOX, 0,0, 13, 2, 14,1, "Enabled" }, + { SGCHECKBOX, 0,0, 25, 2, 14,1, "Synchronize" }, { SGTEXT, 0,0, 4, 4, 14,1, "Playback quality:" }, { SGRADIOBUT, 0,0, 2, 6, 10,1, "11025 Hz" }, { SGRADIOBUT, 0,0, 2, 7, 10,1, "12517 Hz" }, { SGRADIOBUT, 0,0, 2, 8, 10,1, "16000 Hz" }, - { SGRADIOBUT, 0,0, 14, 6, 10,1, "22050 Hz" }, - { SGRADIOBUT, 0,0, 14, 7, 10,1, "25033 Hz" }, - { SGRADIOBUT, 0,0, 14, 8, 10,1, "32000 Hz" }, - { SGRADIOBUT, 0,0, 26, 6, 10,1, "44100 Hz" }, - { SGRADIOBUT, 0,0, 26, 7, 10,1, "48000 Hz" }, - { SGRADIOBUT, 0,0, 26, 8, 10,1, "50066 Hz" }, - - { SGTEXT, 0,0, 2,10, 10,1, "YM mixing:" }, - { SGRADIOBUT, 0,0, 14,10, 10,1, "ST table" }, - { SGRADIOBUT, 0,0, 26,10, 10,1, "Linear" }, - - { SGBOX, 0,0, 1,13, 36,8, NULL }, - { SGTEXT, 0,0, 13,14, 14,1, "Capture YM/WAV" }, - { SGTEXT, 0,0, 2,16, 26,1, "File name (*.wav / *.ym):" }, - { SGTEXT, 0,0, 2,17, 34,1, dlgRecordName }, - { SGBUTTON, 0,0, 28,16, 8,1, " Browse " }, - { SGBUTTON, 0,0, 12,19, 16,1, NULL }, - { SGBUTTON, SG_DEFAULT, 0, 10,22, 20,1, "Back to main menu" }, + { SGRADIOBUT, 0,0, 15, 6, 10,1, "22050 Hz" }, + { SGRADIOBUT, 0,0, 15, 7, 10,1, "25033 Hz" }, + { SGRADIOBUT, 0,0, 15, 8, 10,1, "32000 Hz" }, + { SGRADIOBUT, 0,0, 28, 6, 10,1, "44100 Hz" }, + { SGRADIOBUT, 0,0, 28, 7, 10,1, "48000 Hz" }, + { SGRADIOBUT, 0,0, 28, 8, 10,1, "50066 Hz" }, + + { SGTEXT, 0,0, 4,10, 10,1, "YM voices mixing:" }, + { SGRADIOBUT, 0,0, 2,12, 10,1, "Math model" }, + { SGRADIOBUT, 0,0, 15,12, 10,1, "ST table" }, + { SGRADIOBUT, 0,0, 28,12, 10,1, "Linear" }, + + { SGBOX, 0,0, 1,15, 38,7, NULL }, + { SGTEXT, 0,0, 13,16, 14,1, "Capture YM/WAV" }, + { SGTEXT, 0,0, 2,17, 26,1, "File name (*.wav / *.ym):" }, + { SGTEXT, 0,0, 2,18, 34,1, dlgRecordName }, + { SGBUTTON, 0,0, 28,17, 8,1, " Browse " }, + { SGBUTTON, 0,0, 12,20, 16,1, NULL }, + { SGBUTTON, SG_DEFAULT, 0, 10,23, 20,1, "Back to main menu" }, { -1, 0, 0, 0,0, 0,0, NULL } }; @@ -100,6 +104,11 @@ void Dialog_SoundDlg(void) else sounddlg[DLGSOUND_ENABLE].state &= ~SG_SELECTED; + if (ConfigureParams.Sound.bEnableSoundSync) + sounddlg[DLGSOUND_SYNC].state |= SG_SELECTED; + else + sounddlg[DLGSOUND_SYNC].state &= ~SG_SELECTED; + for (i = DLGSOUND_11KHZ; i <= DLGSOUND_50KHZ; i++) sounddlg[i].state &= ~SG_SELECTED; @@ -113,8 +122,12 @@ void Dialog_SoundDlg(void) } } + sounddlg[DLGSOUND_MODEL].state &= ~SG_SELECTED; sounddlg[DLGSOUND_TABLE].state &= ~SG_SELECTED; sounddlg[DLGSOUND_LINEAR].state &= ~SG_SELECTED; + if (ConfigureParams.Sound.YmVolumeMixing == YM_MODEL_MIXING) + sounddlg[DLGSOUND_MODEL].state |= SG_SELECTED; + else if (ConfigureParams.Sound.YmVolumeMixing == YM_TABLE_MIXING) sounddlg[DLGSOUND_TABLE].state |= SG_SELECTED; else @@ -164,6 +177,8 @@ void Dialog_SoundDlg(void) /* Read values from dialog */ ConfigureParams.Sound.bEnableSound = (sounddlg[DLGSOUND_ENABLE].state & SG_SELECTED); + ConfigureParams.Sound.bEnableSoundSync = (sounddlg[DLGSOUND_SYNC].state & SG_SELECTED); + for (i = DLGSOUND_11KHZ; i <= DLGSOUND_50KHZ; i++) { if (sounddlg[i].state & SG_SELECTED) @@ -173,6 +188,9 @@ void Dialog_SoundDlg(void) } } + if (sounddlg[DLGSOUND_MODEL].state & SG_SELECTED) + ConfigureParams.Sound.YmVolumeMixing = YM_MODEL_MIXING; + else if (sounddlg[DLGSOUND_TABLE].state & SG_SELECTED) ConfigureParams.Sound.YmVolumeMixing = YM_TABLE_MIXING; else