1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-09-27 22:17:51 +00:00

Allow selecting audio backend in IDE

This change allows selecting the audio backend to use in your compiler
programs. The selection can be made via the 'Compiler Settings' dialog
in the IDE (renamed from the 'C++ Compiler Settings' dialog).

The new miniaudio backend is the default, a checkbox for "Use old audio
backend" exists in the IDE for switching back to the old backend (in the
event someone runs into compatibility issues or etc.). Eventually we'll
drop the old one.
This commit is contained in:
Matthew Kilgore 2022-08-26 23:37:32 -04:00 committed by Matt Kilgore
parent 48208e2eda
commit 333bc6231d
3 changed files with 33 additions and 8 deletions

View file

@ -25,6 +25,7 @@ DIM SHARED MaxParallelProcesses AS _UNSIGNED LONG
DIM SHARED ExtraCppFlags AS STRING, ExtraLinkerFlags AS STRING
DIM SHARED StripDebugSymbols AS _UNSIGNED LONG
DIM SHARED OptimizeCppProgram AS _UNSIGNED LONG
DIM SHARED UseMiniaudioBackend AS _UNSIGNED LONG
ConfigFile$ = "internal/config.ini"
iniFolderIndex$ = STR$(tempfolderindex)
@ -535,5 +536,7 @@ MaxParallelProcesses = ReadWriteLongSettingValue&(compilerSettingsSection$, "Max
ExtraCppFlags = ReadWriteStringSettingValue$(compilerSettingsSection$, "ExtraCppFlags", "")
ExtraLinkerFlags = ReadWriteStringSettingValue$(compilerSettingsSection$, "ExtraLinkerFlags", "")
UseMiniaudioBackend = ReadWriteBooleanSettingValue%(compilerSettingsSection$, "UseMiniaudioBackend", -1)
'End of initial settings ------------------------------------------------------

View file

@ -399,8 +399,8 @@ FUNCTION ide2 (ignore)
menuDesc$(m, i - 1) = "Changes or customizes IDE color scheme"
menu$(m, i) = "#Code Layout...": i = i + 1
menuDesc$(m, i - 1) = "Changes auto-format features"
menu$(m, i) = "C++ Co#mpiler Settings...": i = i + 1
menuDesc$(m, i - 1) = "Change settings for compiling the C++ code"
menu$(m, i) = "Co#mpiler Settings...": i = i + 1
menuDesc$(m, i - 1) = "Change settings for compiling your code"
menu$(m, i) = "-": i = i + 1
menu$(m, i) = "#Language...": i = i + 1
menuDesc$(m, i - 1) = "Changes code page to use with TTF fonts"
@ -5103,7 +5103,7 @@ FUNCTION ide2 (ignore)
GOTO ideloop
END IF
IF menu$(m, s) = "C++ Co#mpiler Settings..." THEN
IF menu$(m, s) = "Co#mpiler Settings..." THEN
PCOPY 2, 0
retval = ideCompilerSettingsBox
IF retval THEN idechangemade = 1: idelayoutallow = 2: startPausedPending = 0 'recompile if options changed
@ -15123,6 +15123,7 @@ FUNCTION ideCompilerSettingsBox
DIM maxParallelTextBox AS LONG
DIM extraCppFlagsTextBox AS LONG
DIM extraLinkerFlagsTextBox AS LONG
DIM useOldAudioBackend AS LONG
sep = CHR$(0)
'-------- end of generic dialog box header --------
@ -15185,6 +15186,15 @@ FUNCTION ideCompilerSettingsBox
y = y + 1 ' Blank line
i = i + 1
useOldAudioBackend = i
o(i).typ = 4 'check box
y = y + 1: o(i).y = y
o(i).nam = idenewtxt("#Use old audio backend (LGPL)")
o(i).sel = NOT UseMiniaudioBackend
y = y + 1 ' Blank line
i = i + 1
buttonsid = i
o(i).typ = 3
@ -15192,7 +15202,7 @@ FUNCTION ideCompilerSettingsBox
o(i).txt = idenewtxt("#OK" + sep + "#Cancel")
o(i).dft = 1
idepar p, 60, y, "C++ Compiler Settings"
idepar p, 60, y, "Compiler Settings"
'-------- end of init --------
'-------- generic init --------
@ -15289,6 +15299,12 @@ FUNCTION ideCompilerSettingsBox
WriteConfigSetting generalSettingsSection$, "DebugInfo", BoolToTFString$(Include_GDB_Debugging_Info)
END IF
v% = o(useOldAudioBackend).sel: IF v% <> 0 THEN v% = -1
IF UseMiniaudioBackend <> NOT v% THEN
UseMiniaudioBackend = NOT v%
WriteConfigSetting compilerSettingsSection$, "UseMiniaudioBackend", BoolToTFString$(UseMiniaudioBackend)
END IF
v% = VAL(idetxt(o(maxParallelTextBox).txt))
IF v% > 0 AND v% <> MaxParallelProcesses THEN
MaxParallelProcesses = v%

View file

@ -12366,15 +12366,21 @@ IF DEPENDENCY(DEPENDENCY_ICON) THEN makedeps$ = makedeps$ + " DEP_ICON=y"
IF DEPENDENCY(DEPENDENCY_SCREENIMAGE) THEN makedeps$ = makedeps$ + " DEP_SCREENIMAGE=y"
IF DEPENDENCY(DEPENDENCY_LOADFONT) THEN makedeps$ = makedeps$ + " DEP_FONT=y"
IF DEPENDENCY(DEPENDENCY_DEVICEINPUT) THEN makedeps$ = makedeps$ + " DEP_DEVICEINPUT=y"
IF DEPENDENCY(DEPENDENCY_AUDIO_DECODE) THEN makedeps$ = makedeps$ + " DEP_AUDIO_DECODE=y"
IF DEPENDENCY(DEPENDENCY_AUDIO_CONVERSION) THEN makedeps$ = makedeps$ + " DEP_AUDIO_CONVERSION=y"
IF DEPENDENCY(DEPENDENCY_AUDIO_DECODE) THEN makedeps$ = makedeps$ + " DEP_AUDIO_DECODE=y"
IF DEPENDENCY(DEPENDENCY_AUDIO_OUT) THEN makedeps$ = makedeps$ + " DEP_AUDIO_OUT=y"
IF DEPENDENCY(DEPENDENCY_ZLIB) THEN makedeps$ = makedeps$ + " DEP_ZLIB=y"
IF inline_DATA = 0 AND DataOffset THEN makedeps$ = makedeps$ + " DEP_DATA=y"
IF Console THEN makedeps$ = makedeps$ + " DEP_CONSOLE=y"
IF ExeIconSet OR VersionInfoSet THEN makedeps$ = makedeps$ + " DEP_ICON_RC=y"
IF UseMiniaudioBackend = 0 THEN
IF DEPENDENCY(DEPENDENCY_AUDIO_DECODE) THEN makedeps$ = makedeps$ + " DEP_AUDIO_DECODE=y"
IF DEPENDENCY(DEPENDENCY_AUDIO_CONVERSION) THEN makedeps$ = makedeps$ + " DEP_AUDIO_CONVERSION=y"
IF DEPENDENCY(DEPENDENCY_AUDIO_OUT) THEN makedeps$ = makedeps$ + " DEP_AUDIO_OUT=y"
ELSE
IF DEPENDENCY(DEPENDENCY_AUDIO_DECODE) OR DEPENDENCY(DEPENDENCY_AUDIO_CONVERSION) OR DEPENDENCY(DEPENDENCY_AUDIO_OUT) THEN
makedeps$ = makedeps$ + " DEP_AUDIO_MINIAUDIO=y"
END IF
END IF
IF tempfolderindex > 1 THEN makedeps$ = makedeps$ + " TEMP_ID=" + str2$(tempfolderindex)
CxxFlagsExtra$ = ExtraCppFlags