Remove graphicsdev

This commit is contained in:
Luke Street 2022-01-31 19:00:38 -05:00
parent 49cfab476f
commit 9f8035dbd8
19 changed files with 117 additions and 112 deletions

View File

@ -94,8 +94,8 @@ add_library(boo
lib/audiodev/MIDIEncoder.cpp lib/audiodev/MIDIEncoder.cpp
lib/audiodev/WAVOut.cpp lib/audiodev/WAVOut.cpp
lib/Common.hpp lib/Common.hpp
lib/graphicsdev/Common.cpp # lib/graphicsdev/Common.cpp
lib/graphicsdev/Common.hpp # lib/graphicsdev/Common.hpp
lib/inputdev/DeviceBase.cpp include/boo/inputdev/DeviceBase.hpp lib/inputdev/DeviceBase.cpp include/boo/inputdev/DeviceBase.hpp
lib/inputdev/CafeProPad.cpp include/boo/inputdev/CafeProPad.hpp lib/inputdev/CafeProPad.cpp include/boo/inputdev/CafeProPad.hpp
lib/inputdev/RevolutionPad.cpp include/boo/inputdev/RevolutionPad.hpp lib/inputdev/RevolutionPad.cpp include/boo/inputdev/RevolutionPad.hpp
@ -107,7 +107,7 @@ add_library(boo
lib/inputdev/DeviceFinder.cpp include/boo/inputdev/DeviceFinder.hpp lib/inputdev/DeviceFinder.cpp include/boo/inputdev/DeviceFinder.hpp
lib/inputdev/HIDParser.cpp include/boo/inputdev/HIDParser.hpp lib/inputdev/HIDParser.cpp include/boo/inputdev/HIDParser.hpp
lib/inputdev/IHIDDevice.hpp lib/inputdev/IHIDDevice.hpp
include/boo/IGraphicsContext.hpp # include/boo/IGraphicsContext.hpp
include/boo/audiodev/IAudioSubmix.hpp include/boo/audiodev/IAudioSubmix.hpp
include/boo/audiodev/IAudioVoice.hpp include/boo/audiodev/IAudioVoice.hpp
include/boo/audiodev/IAudioVoiceEngine.hpp include/boo/audiodev/IAudioVoiceEngine.hpp
@ -115,8 +115,8 @@ add_library(boo
include/boo/audiodev/IMIDIReader.hpp include/boo/audiodev/IMIDIReader.hpp
include/boo/audiodev/MIDIDecoder.hpp include/boo/audiodev/MIDIDecoder.hpp
include/boo/audiodev/MIDIEncoder.hpp include/boo/audiodev/MIDIEncoder.hpp
include/boo/graphicsdev/IGraphicsDataFactory.hpp # include/boo/graphicsdev/IGraphicsDataFactory.hpp
include/boo/graphicsdev/IGraphicsCommandQueue.hpp # include/boo/graphicsdev/IGraphicsCommandQueue.hpp
include/boo/inputdev/IHIDListener.hpp include/boo/inputdev/IHIDListener.hpp
include/boo/inputdev/XInputPad.hpp include/boo/inputdev/XInputPad.hpp
include/boo/boo.hpp include/boo/boo.hpp
@ -155,28 +155,28 @@ target_include_directories(boo PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/include
) )
if(NOT GEKKO AND NOT CAFE AND NOT WINDOWS_STORE AND NOT NX) #if(NOT GEKKO AND NOT CAFE AND NOT WINDOWS_STORE AND NOT NX)
add_library(glew lib/graphicsdev/glew.c) # add_library(glew lib/graphicsdev/glew.c)
# For some reason, clang takes forever if glew.c is not built with -Os # # For some reason, clang takes forever if glew.c is not built with -Os
if(CMAKE_C_COMPILER_ID STREQUAL "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "AppleClang") # if(CMAKE_C_COMPILER_ID STREQUAL "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "AppleClang")
set_source_files_properties(lib/graphicsdev/glew.c PROPERTIES COMPILE_FLAGS -Os) # set_source_files_properties(lib/graphicsdev/glew.c PROPERTIES COMPILE_FLAGS -Os)
endif() # endif()
target_include_directories(glew PUBLIC include/boo/graphicsdev) # target_include_directories(glew PUBLIC include/boo/graphicsdev)
target_compile_definitions(glew PUBLIC -DGLEW_NO_GLU=1) # target_compile_definitions(glew PUBLIC -DGLEW_NO_GLU=1)
endif() #endif()
#
if(NOT GEKKO AND NOT CAFE AND NOT WINDOWS_STORE AND NOT NX AND NOT APPLE) #if(NOT GEKKO AND NOT CAFE AND NOT WINDOWS_STORE AND NOT NX AND NOT APPLE)
target_sources(boo PRIVATE lib/graphicsdev/GL.cpp) # target_sources(boo PRIVATE lib/graphicsdev/GL.cpp)
target_compile_definitions(boo PUBLIC -DBOO_HAS_GL=1) # target_compile_definitions(boo PUBLIC -DBOO_HAS_GL=1)
target_link_libraries(boo PUBLIC glew) # target_link_libraries(boo PUBLIC glew)
#
target_sources(boo PRIVATE # target_sources(boo PRIVATE
include/boo/graphicsdev/GL.hpp # include/boo/graphicsdev/GL.hpp
include/boo/graphicsdev/GLSLMacros.hpp # include/boo/graphicsdev/GLSLMacros.hpp
include/boo/graphicsdev/Vulkan.hpp # include/boo/graphicsdev/Vulkan.hpp
include/boo/graphicsdev/VulkanDispatchTable.hpp # include/boo/graphicsdev/VulkanDispatchTable.hpp
) # )
endif() #endif()
set(AudioMatrix_SRC lib/audiodev/AudioMatrix.cpp) set(AudioMatrix_SRC lib/audiodev/AudioMatrix.cpp)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64 if(CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64
@ -192,15 +192,15 @@ if(WINDOWS_STORE)
lib/audiodev/WASAPI.cpp lib/audiodev/WASAPI.cpp
lib/inputdev/HIDDeviceUWP.cpp lib/inputdev/HIDDeviceUWP.cpp
lib/inputdev/HIDListenerUWP.cpp lib/inputdev/HIDListenerUWP.cpp
lib/graphicsdev/D3D11.cpp # lib/graphicsdev/D3D11.cpp
lib/graphicsdev/D3D12.cpp # lib/graphicsdev/D3D12.cpp
lib/win/ApplicationUWP.cpp # lib/win/ApplicationUWP.cpp
lib/win/UWPCommon.hpp # lib/win/UWPCommon.hpp
lib/win/WinCommon.hpp # lib/win/WinCommon.hpp
lib/win/WindowUWP.cpp # lib/win/WindowUWP.cpp
include/boo/UWPViewProvider.hpp include/boo/UWPViewProvider.hpp
include/boo/graphicsdev/D3D.hpp # include/boo/graphicsdev/D3D.hpp
) )
target_compile_definitions(boo PUBLIC target_compile_definitions(boo PUBLIC
@ -219,22 +219,22 @@ if(WINDOWS_STORE)
Xinput Xinput
) )
elseif(WIN32) elseif(WIN32)
unset(VULKAN_SDK_DIRS CACHE) # unset(VULKAN_SDK_DIRS CACHE)
get_filename_component(VULKAN_SDK_DIRS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\LunarG\\VulkanSDK;VK_SDK_PATHs]" ABSOLUTE CACHE) # get_filename_component(VULKAN_SDK_DIRS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\LunarG\\VulkanSDK;VK_SDK_PATHs]" ABSOLUTE CACHE)
if (NOT "${VULKAN_SDK_DIRS}" STREQUAL "/registry") # if (NOT "${VULKAN_SDK_DIRS}" STREQUAL "/registry")
message(STATUS "Enabling Vulkan support") # message(STATUS "Enabling Vulkan support")
list(GET VULKAN_SDK_DIRS 0 VULKAN_SDK_DIR) # list(GET VULKAN_SDK_DIRS 0 VULKAN_SDK_DIR)
target_include_directories(boo PUBLIC "${VULKAN_SDK_DIR}/Include") # target_include_directories(boo PUBLIC "${VULKAN_SDK_DIR}/Include")
target_compile_definitions(boo PUBLIC # target_compile_definitions(boo PUBLIC
-DBOO_HAS_VULKAN=1 # -DBOO_HAS_VULKAN=1
-DVK_USE_PLATFORM_WIN32_KHR=1 # -DVK_USE_PLATFORM_WIN32_KHR=1
) # )
target_sources(boo PRIVATE # target_sources(boo PRIVATE
lib/graphicsdev/Vulkan.cpp # lib/graphicsdev/Vulkan.cpp
lib/graphicsdev/VulkanDispatchTable.cpp # lib/graphicsdev/VulkanDispatchTable.cpp
) # )
set(BOO_ENABLE_VULKAN_IN_OPTICK TRUE) # set(BOO_ENABLE_VULKAN_IN_OPTICK TRUE)
endif() # endif()
find_file(TE_VIRTUAL_MIDI_H teVirtualMIDI.h PATHS find_file(TE_VIRTUAL_MIDI_H teVirtualMIDI.h PATHS
"$ENV{PROGRAMFILES\(X86\)}/Tobias Erichsen/teVirtualMIDISDK/C-Binding") "$ENV{PROGRAMFILES\(X86\)}/Tobias Erichsen/teVirtualMIDISDK/C-Binding")
@ -252,7 +252,7 @@ elseif(WIN32)
target_sources(boo PRIVATE target_sources(boo PRIVATE
${AudioMatrix_SRC} ${AudioMatrix_SRC}
lib/audiodev/WASAPI.cpp lib/audiodev/WASAPI.cpp
lib/graphicsdev/D3D11.cpp # lib/graphicsdev/D3D11.cpp
lib/inputdev/HIDListenerWinUSB.cpp lib/inputdev/HIDListenerWinUSB.cpp
lib/inputdev/HIDDeviceWinUSB.cpp lib/inputdev/HIDDeviceWinUSB.cpp
lib/win/ApplicationWin32.cpp lib/win/ApplicationWin32.cpp
@ -260,7 +260,7 @@ elseif(WIN32)
lib/win/WinCommon.hpp lib/win/WinCommon.hpp
lib/win/Win32Common.hpp lib/win/Win32Common.hpp
include/boo/graphicsdev/D3D.hpp # include/boo/graphicsdev/D3D.hpp
) )
target_compile_definitions(boo PUBLIC target_compile_definitions(boo PUBLIC
@ -283,20 +283,20 @@ elseif(APPLE)
${AudioMatrix_SRC} ${AudioMatrix_SRC}
lib/inputdev/HIDListenerIOKit.cpp lib/inputdev/HIDListenerIOKit.cpp
lib/inputdev/HIDDeviceIOKit.cpp lib/inputdev/HIDDeviceIOKit.cpp
lib/mac/ApplicationCocoa.mm # lib/mac/ApplicationCocoa.mm
lib/mac/WindowCocoa.mm # lib/mac/WindowCocoa.mm
lib/mac/CocoaCommon.hpp # lib/mac/CocoaCommon.hpp
lib/graphicsdev/Metal.mm # lib/graphicsdev/Metal.mm
lib/CFPointer.hpp lib/CFPointer.hpp
lib/inputdev/IOKitPointer.hpp lib/inputdev/IOKitPointer.hpp
include/boo/graphicsdev/Metal.hpp # include/boo/graphicsdev/Metal.hpp
) )
set_source_files_properties( set_source_files_properties(
lib/mac/ApplicationCocoa.mm # lib/mac/ApplicationCocoa.mm
lib/mac/WindowCocoa.mm # lib/mac/WindowCocoa.mm
lib/graphicsdev/Metal.mm # lib/graphicsdev/Metal.mm
PROPERTIES COMPILE_FLAGS -fobjc-arc PROPERTIES COMPILE_FLAGS -fobjc-arc
) )
@ -329,14 +329,14 @@ elseif(APPLE)
else(NOT GEKKO) else(NOT GEKKO)
target_sources(boo PRIVATE target_sources(boo PRIVATE
lib/audiodev/LinuxMidi.hpp lib/audiodev/LinuxMidi.hpp
lib/graphicsdev/GL.cpp # lib/graphicsdev/GL.cpp
lib/graphicsdev/GLX.cpp # lib/graphicsdev/GLX.cpp
lib/x11/XlibCommon.hpp # lib/x11/XlibCommon.hpp
lib/x11/ApplicationUnix.cpp # lib/x11/ApplicationUnix.cpp
lib/x11/ApplicationWayland.hpp # lib/x11/ApplicationWayland.hpp
lib/x11/ApplicationXlib.hpp # lib/x11/ApplicationXlib.hpp
lib/x11/WindowWayland.cpp # lib/x11/WindowWayland.cpp
lib/x11/WindowXlib.cpp # lib/x11/WindowXlib.cpp
) )
find_package(PkgConfig) find_package(PkgConfig)
@ -420,22 +420,22 @@ else(NOT GEKKO)
) )
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
find_path(VULKAN_INCLUDE_DIR # find_path(VULKAN_INCLUDE_DIR
NAMES vulkan/vulkan.h # NAMES vulkan/vulkan.h
) # )
if(VULKAN_INCLUDE_DIR) # if(VULKAN_INCLUDE_DIR)
message(STATUS "Enabling Vulkan support") # message(STATUS "Enabling Vulkan support")
target_sources(boo PRIVATE # target_sources(boo PRIVATE
lib/graphicsdev/Vulkan.cpp # lib/graphicsdev/Vulkan.cpp
lib/graphicsdev/VulkanDispatchTable.cpp # lib/graphicsdev/VulkanDispatchTable.cpp
) # )
target_compile_definitions(boo # target_compile_definitions(boo
PUBLIC # PUBLIC
-DBOO_HAS_VULKAN=1 # -DBOO_HAS_VULKAN=1
-DVK_USE_PLATFORM_XCB_KHR=1 # -DVK_USE_PLATFORM_XCB_KHR=1
) # )
set(BOO_ENABLE_VULKAN_IN_OPTICK TRUE) # set(BOO_ENABLE_VULKAN_IN_OPTICK TRUE)
endif() # endif()
target_sources(boo PRIVATE target_sources(boo PRIVATE
${AudioMatrix_SRC} ${AudioMatrix_SRC}
lib/inputdev/HIDDeviceUdev.cpp lib/inputdev/HIDDeviceUdev.cpp

View File

@ -5,24 +5,24 @@
** Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org> ** Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
** Copyright (C) 2002, Lev Povalahev ** Copyright (C) 2002, Lev Povalahev
** All rights reserved. ** All rights reserved.
** **
** Redistribution and use in source and binary forms, with or without ** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are met: ** modification, are permitted provided that the following conditions are met:
** **
** * Redistributions of source code must retain the above copyright notice, ** * Redistributions of source code must retain the above copyright notice,
** this list of conditions and the following disclaimer. ** this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright notice, ** * Redistributions in binary form must reproduce the above copyright notice,
** this list of conditions and the following disclaimer in the documentation ** this list of conditions and the following disclaimer in the documentation
** and/or other materials provided with the distribution. ** and/or other materials provided with the distribution.
** * The name of the author may be used to endorse or promote products ** * The name of the author may be used to endorse or promote products
** derived from this software without specific prior written permission. ** derived from this software without specific prior written permission.
** **
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE ** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR ** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS ** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN ** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
@ -56,7 +56,7 @@
/* /*
** Copyright (c) 2007 The Khronos Group Inc. ** Copyright (c) 2007 The Khronos Group Inc.
** **
** Permission is hereby granted, free of charge, to any person obtaining a ** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the ** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including ** "Materials"), to deal in the Materials without restriction, including
@ -64,10 +64,10 @@
** distribute, sublicense, and/or sell copies of the Materials, and to ** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are furnished to do so, subject to ** permit persons to whom the Materials are furnished to do so, subject to
** the following conditions: ** the following conditions:
** **
** The above copyright notice and this permission notice shall be included ** The above copyright notice and this permission notice shall be included
** in all copies or substantial portions of the Materials. ** in all copies or substantial portions of the Materials.
** **
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.

View File

@ -103,7 +103,7 @@ struct IAudioVoiceEngine {
}; };
/** Construct host platform's voice engine */ /** Construct host platform's voice engine */
std::unique_ptr<IAudioVoiceEngine> NewAudioVoiceEngine(); std::unique_ptr<IAudioVoiceEngine> NewAudioVoiceEngine(const char* uniqueName, const char* friendlyName);
/** Construct WAV-rendering voice engine */ /** Construct WAV-rendering voice engine */
std::unique_ptr<IAudioVoiceEngine> NewWAVAudioVoiceEngine(const char* path, double sampleRate, int numChans); std::unique_ptr<IAudioVoiceEngine> NewWAVAudioVoiceEngine(const char* path, double sampleRate, int numChans);

View File

@ -1,12 +1,12 @@
#pragma once #pragma once
#include "DeferredWindowEvents.hpp" //#include "DeferredWindowEvents.hpp"
#include "IApplication.hpp" //#include "IApplication.hpp"
#include "IWindow.hpp" //#include "IWindow.hpp"
#include "inputdev/DeviceFinder.hpp" #include "inputdev/DeviceFinder.hpp"
#include "inputdev/DolphinSmashAdapter.hpp" #include "inputdev/DolphinSmashAdapter.hpp"
#include "inputdev/DualshockPad.hpp" #include "inputdev/DualshockPad.hpp"
#include "inputdev/GenericPad.hpp" #include "inputdev/GenericPad.hpp"
#include "inputdev/NintendoPowerA.hpp" #include "inputdev/NintendoPowerA.hpp"
#include "graphicsdev/IGraphicsCommandQueue.hpp" //#include "graphicsdev/IGraphicsCommandQueue.hpp"
#include "graphicsdev/IGraphicsDataFactory.hpp" //#include "graphicsdev/IGraphicsDataFactory.hpp"

View File

@ -856,7 +856,7 @@ struct AQSAudioVoiceEngine : BaseAudioVoiceEngine {
} }
}; };
std::unique_ptr<IAudioVoiceEngine> NewAudioVoiceEngine() { std::unique_ptr<IAudioVoiceEngine> NewAudioVoiceEngine(const char* uniqueName, const char* friendlyName) {
std::unique_ptr<IAudioVoiceEngine> ret = std::make_unique<AQSAudioVoiceEngine>(); std::unique_ptr<IAudioVoiceEngine> ret = std::make_unique<AQSAudioVoiceEngine>();
if (!static_cast<AQSAudioVoiceEngine&>(*ret).m_queue) if (!static_cast<AQSAudioVoiceEngine&>(*ret).m_queue)
return {}; return {};

View File

@ -113,7 +113,7 @@ struct PulseAudioVoiceEngine : LinuxMidi {
return false; return false;
} }
PulseAudioVoiceEngine() { PulseAudioVoiceEngine(const char* uniqueName, const char* friendlyName) {
if (!(m_mainloop = pa_mainloop_new())) { if (!(m_mainloop = pa_mainloop_new())) {
Log.report(logvisor::Error, FMT_STRING("Unable to pa_mainloop_new()")); Log.report(logvisor::Error, FMT_STRING("Unable to pa_mainloop_new()"));
return; return;
@ -121,9 +121,9 @@ struct PulseAudioVoiceEngine : LinuxMidi {
pa_mainloop_api* mlApi = pa_mainloop_get_api(m_mainloop); pa_mainloop_api* mlApi = pa_mainloop_get_api(m_mainloop);
pa_proplist* propList = pa_proplist_new(); pa_proplist* propList = pa_proplist_new();
pa_proplist_sets(propList, PA_PROP_APPLICATION_ICON_NAME, APP->getUniqueName().data()); pa_proplist_sets(propList, PA_PROP_APPLICATION_ICON_NAME, uniqueName);
pa_proplist_sets(propList, PA_PROP_APPLICATION_PROCESS_ID, fmt::format(FMT_STRING("{}"), int(getpid())).c_str()); pa_proplist_sets(propList, PA_PROP_APPLICATION_PROCESS_ID, fmt::format(FMT_STRING("{}"), int(getpid())).c_str());
if (!(m_ctx = pa_context_new_with_proplist(mlApi, APP->getFriendlyName().data(), propList))) { if (!(m_ctx = pa_context_new_with_proplist(mlApi, friendlyName, propList))) {
Log.report(logvisor::Error, FMT_STRING("Unable to pa_context_new_with_proplist()")); Log.report(logvisor::Error, FMT_STRING("Unable to pa_context_new_with_proplist()"));
pa_mainloop_free(m_mainloop); pa_mainloop_free(m_mainloop);
m_mainloop = nullptr; m_mainloop = nullptr;
@ -341,7 +341,8 @@ struct PulseAudioVoiceEngine : LinuxMidi {
size_t nbytes = writablePeriods * periodSz; size_t nbytes = writablePeriods * periodSz;
if (pa_stream_begin_write(m_stream, &data, &nbytes)) { if (pa_stream_begin_write(m_stream, &data, &nbytes)) {
pa_stream_state_t st = pa_stream_get_state(m_stream); pa_stream_state_t st = pa_stream_get_state(m_stream);
Log.report(logvisor::Error, FMT_STRING("Unable to pa_stream_begin_write(): {} {}"), pa_strerror(pa_context_errno(m_ctx)), st); Log.report(logvisor::Error, FMT_STRING("Unable to pa_stream_begin_write(): {} {}"),
pa_strerror(pa_context_errno(m_ctx)), st);
_doIterate(); _doIterate();
return; return;
} }
@ -356,6 +357,8 @@ struct PulseAudioVoiceEngine : LinuxMidi {
} }
}; };
std::unique_ptr<IAudioVoiceEngine> NewAudioVoiceEngine() { return std::make_unique<PulseAudioVoiceEngine>(); } std::unique_ptr<IAudioVoiceEngine> NewAudioVoiceEngine(const char* uniqueName, const char* friendlyName) {
return std::make_unique<PulseAudioVoiceEngine>(uniqueName, friendlyName);
}
} // namespace boo } // namespace boo

View File

@ -876,6 +876,8 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine {
#endif #endif
}; };
std::unique_ptr<IAudioVoiceEngine> NewAudioVoiceEngine() { return std::make_unique<WASAPIAudioVoiceEngine>(); } std::unique_ptr<IAudioVoiceEngine> NewAudioVoiceEngine(const char* uniqueName, const char* friendlyName) {
return std::make_unique<WASAPIAudioVoiceEngine>();
}
} // namespace boo } // namespace boo