This commit is contained in:
tildearrow 2023-08-30 23:14:47 -05:00
parent 274ce8a646
commit 922800d864
5 changed files with 32 additions and 12 deletions

View file

@ -221,6 +221,8 @@ if (WITH_PORTAUDIO)
message(STATUS "Using system-installed PortAudio")
else()
set(PA_BUILD_SHARED_LIBS OFF CACHE BOOL "Build dynamic library" FORCE)
# don't - Furnace has its own implementation
set(PA_USE_JACK OFF CACHE BOOL "Enable support for JACK Audio Connection Kit" FORCE)
add_subdirectory(extern/portaudio EXCLUDE_FROM_ALL)
list(APPEND DEPENDENCIES_LIBRARIES PortAudio)
message(STATUS "Using vendored PortAudio")

View file

@ -478,8 +478,6 @@ void FurnaceGUI::drawChanOsc() {
needlePos-=phase;
}
chanOscPitch[ch]=(float)point/32.0f;
needlePos-=displaySize;
for (unsigned short i=0; i<precision; i++) {

View file

@ -6914,6 +6914,8 @@ FurnaceGUI::FurnaceGUI():
displayEditString(false),
mobileEdit(false),
killGraphics(false),
audioEngineChanged(false),
settingsChanged(false),
vgmExportVersion(0x171),
vgmExportTrailingTicks(-1),
drawHalt(10),

View file

@ -1334,6 +1334,7 @@ class FurnaceGUI {
bool displayPendingIns, pendingInsSingle, displayPendingRawSample, snesFilterHex, modTableHex, displayEditString;
bool mobileEdit;
bool killGraphics;
bool audioEngineChanged, settingsChanged;
bool willExport[DIV_MAX_CHIPS];
int vgmExportVersion;
int vgmExportTrailingTicks;

View file

@ -744,6 +744,7 @@ void FurnaceGUI::drawSettings() {
settings.audioEngine=DIV_AUDIO_PORTAUDIO;
}
if (settings.audioEngine!=prevAudioEngine) {
audioEngineChanged=true;
if (!isProAudio[settings.audioEngine]) settings.audioChans=2;
}
ImGui::EndCombo();
@ -777,17 +778,30 @@ void FurnaceGUI::drawSettings() {
ImGui::AlignTextToFramePadding();
ImGui::Text("Device");
ImGui::TableNextColumn();
String audioDevName=settings.audioDevice.empty()?"<System default>":settings.audioDevice;
if (ImGui::BeginCombo("##AudioDevice",audioDevName.c_str())) {
if (ImGui::Selectable("<System default>",settings.audioDevice.empty())) {
settings.audioDevice="";
}
for (String& i: e->getAudioDevices()) {
if (ImGui::Selectable(i.c_str(),i==settings.audioDevice)) {
settings.audioDevice=i;
if (audioEngineChanged) {
ImGui::BeginDisabled();
if (ImGui::BeginCombo("##AudioDevice","<click on OK or Apply first>")) {
ImGui::Text("ALERT - TRESPASSER DETECTED");
if (ImGui::IsItemHovered()) {
showError("you have been arrested for trying to engage with a disabled combo box.");
ImGui::CloseCurrentPopup();
}
ImGui::EndCombo();
}
ImGui::EndDisabled();
} else {
String audioDevName=settings.audioDevice.empty()?"<System default>":settings.audioDevice;
if (ImGui::BeginCombo("##AudioDevice",audioDevName.c_str())) {
if (ImGui::Selectable("<System default>",settings.audioDevice.empty())) {
settings.audioDevice="";
}
for (String& i: e->getAudioDevices()) {
if (ImGui::Selectable(i.c_str(),i==settings.audioDevice)) {
settings.audioDevice=i;
}
}
ImGui::EndCombo();
}
ImGui::EndCombo();
}
ImGui::TableNextRow();
@ -3031,6 +3045,7 @@ void FurnaceGUI::drawSettings() {
ImGui::SameLine();
if (ImGui::Button("Cancel##SettingsCancel")) {
settingsOpen=false;
audioEngineChanged=false;
syncSettings();
}
ImGui::SameLine();
@ -3057,7 +3072,7 @@ void FurnaceGUI::syncSettings() {
settings.patFontSize=e->getConfInt("patFontSize",18);
settings.iconSize=e->getConfInt("iconSize",16);
settings.audioEngine=(e->getConfString("audioEngine","SDL")=="SDL")?1:0;
if (e->getConfString("audioEngine","SDL")=="PortAudio") {
if (e->getConfString("audioEngine","SDL")=="JACK") {
settings.audioEngine=DIV_AUDIO_JACK;
} else if (e->getConfString("audioEngine","SDL")=="PortAudio") {
settings.audioEngine=DIV_AUDIO_PORTAUDIO;
@ -3690,6 +3705,8 @@ void FurnaceGUI::commitSettings() {
} else {
rend->createFontsTexture();
}
audioEngineChanged=false;
}
bool FurnaceGUI::importColors(String path) {