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") message(STATUS "Using system-installed PortAudio")
else() else()
set(PA_BUILD_SHARED_LIBS OFF CACHE BOOL "Build dynamic library" FORCE) 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) add_subdirectory(extern/portaudio EXCLUDE_FROM_ALL)
list(APPEND DEPENDENCIES_LIBRARIES PortAudio) list(APPEND DEPENDENCIES_LIBRARIES PortAudio)
message(STATUS "Using vendored PortAudio") message(STATUS "Using vendored PortAudio")

View file

@ -479,8 +479,6 @@ void FurnaceGUI::drawChanOsc() {
} }
chanOscPitch[ch]=(float)point/32.0f; chanOscPitch[ch]=(float)point/32.0f;
needlePos-=displaySize; needlePos-=displaySize;
for (unsigned short i=0; i<precision; i++) { for (unsigned short i=0; i<precision; i++) {
float y=(float)buf->data[(unsigned short)(needlePos+(i*displaySize/precision))]/32768.0f; float y=(float)buf->data[(unsigned short)(needlePos+(i*displaySize/precision))]/32768.0f;

View file

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

View file

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

View file

@ -744,6 +744,7 @@ void FurnaceGUI::drawSettings() {
settings.audioEngine=DIV_AUDIO_PORTAUDIO; settings.audioEngine=DIV_AUDIO_PORTAUDIO;
} }
if (settings.audioEngine!=prevAudioEngine) { if (settings.audioEngine!=prevAudioEngine) {
audioEngineChanged=true;
if (!isProAudio[settings.audioEngine]) settings.audioChans=2; if (!isProAudio[settings.audioEngine]) settings.audioChans=2;
} }
ImGui::EndCombo(); ImGui::EndCombo();
@ -777,6 +778,18 @@ void FurnaceGUI::drawSettings() {
ImGui::AlignTextToFramePadding(); ImGui::AlignTextToFramePadding();
ImGui::Text("Device"); ImGui::Text("Device");
ImGui::TableNextColumn(); ImGui::TableNextColumn();
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; String audioDevName=settings.audioDevice.empty()?"<System default>":settings.audioDevice;
if (ImGui::BeginCombo("##AudioDevice",audioDevName.c_str())) { if (ImGui::BeginCombo("##AudioDevice",audioDevName.c_str())) {
if (ImGui::Selectable("<System default>",settings.audioDevice.empty())) { if (ImGui::Selectable("<System default>",settings.audioDevice.empty())) {
@ -789,6 +802,7 @@ void FurnaceGUI::drawSettings() {
} }
ImGui::EndCombo(); ImGui::EndCombo();
} }
}
ImGui::TableNextRow(); ImGui::TableNextRow();
ImGui::TableNextColumn(); ImGui::TableNextColumn();
@ -3031,6 +3045,7 @@ void FurnaceGUI::drawSettings() {
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button("Cancel##SettingsCancel")) { if (ImGui::Button("Cancel##SettingsCancel")) {
settingsOpen=false; settingsOpen=false;
audioEngineChanged=false;
syncSettings(); syncSettings();
} }
ImGui::SameLine(); ImGui::SameLine();
@ -3057,7 +3072,7 @@ void FurnaceGUI::syncSettings() {
settings.patFontSize=e->getConfInt("patFontSize",18); settings.patFontSize=e->getConfInt("patFontSize",18);
settings.iconSize=e->getConfInt("iconSize",16); settings.iconSize=e->getConfInt("iconSize",16);
settings.audioEngine=(e->getConfString("audioEngine","SDL")=="SDL")?1:0; 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; settings.audioEngine=DIV_AUDIO_JACK;
} else if (e->getConfString("audioEngine","SDL")=="PortAudio") { } else if (e->getConfString("audioEngine","SDL")=="PortAudio") {
settings.audioEngine=DIV_AUDIO_PORTAUDIO; settings.audioEngine=DIV_AUDIO_PORTAUDIO;
@ -3690,6 +3705,8 @@ void FurnaceGUI::commitSettings() {
} else { } else {
rend->createFontsTexture(); rend->createFontsTexture();
} }
audioEngineChanged=false;
} }
bool FurnaceGUI::importColors(String path) { bool FurnaceGUI::importColors(String path) {