From 9f8035dbd86193c2a3505637a2269ffc0abe25fa Mon Sep 17 00:00:00 2001 From: Luke Street Date: Mon, 31 Jan 2022 19:00:38 -0500 Subject: [PATCH] Remove graphicsdev --- CMakeLists.txt | 168 +++++++++--------- .../boo/{graphicsdev => _graphicsdev}/D3D.hpp | 0 .../boo/{graphicsdev => _graphicsdev}/GL.hpp | 0 .../GLSLMacros.hpp | 0 .../IGraphicsCommandQueue.hpp | 0 .../IGraphicsDataFactory.hpp | 0 .../{graphicsdev => _graphicsdev}/Metal.hpp | 0 .../boo/{graphicsdev => _graphicsdev}/NX.hpp | 0 .../{graphicsdev => _graphicsdev}/Vulkan.hpp | 0 .../VulkanDispatchTable.hpp | 0 .../boo/{graphicsdev => _graphicsdev}/glew.h | 30 ++-- .../boo/{graphicsdev => _graphicsdev}/glxew.h | 0 .../nx_compiler.hpp | 0 .../boo/{graphicsdev => _graphicsdev}/wglew.h | 0 include/boo/audiodev/IAudioVoiceEngine.hpp | 2 +- include/boo/boo.hpp | 10 +- lib/audiodev/AQS.cpp | 2 +- lib/audiodev/PulseAudio.cpp | 13 +- lib/audiodev/WASAPI.cpp | 4 +- 19 files changed, 117 insertions(+), 112 deletions(-) rename include/boo/{graphicsdev => _graphicsdev}/D3D.hpp (100%) rename include/boo/{graphicsdev => _graphicsdev}/GL.hpp (100%) rename include/boo/{graphicsdev => _graphicsdev}/GLSLMacros.hpp (100%) rename include/boo/{graphicsdev => _graphicsdev}/IGraphicsCommandQueue.hpp (100%) rename include/boo/{graphicsdev => _graphicsdev}/IGraphicsDataFactory.hpp (100%) rename include/boo/{graphicsdev => _graphicsdev}/Metal.hpp (100%) rename include/boo/{graphicsdev => _graphicsdev}/NX.hpp (100%) rename include/boo/{graphicsdev => _graphicsdev}/Vulkan.hpp (100%) rename include/boo/{graphicsdev => _graphicsdev}/VulkanDispatchTable.hpp (100%) rename include/boo/{graphicsdev => _graphicsdev}/glew.h (99%) rename include/boo/{graphicsdev => _graphicsdev}/glxew.h (100%) rename include/boo/{graphicsdev => _graphicsdev}/nx_compiler.hpp (100%) rename include/boo/{graphicsdev => _graphicsdev}/wglew.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0fb9821..6558e5b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -94,8 +94,8 @@ add_library(boo lib/audiodev/MIDIEncoder.cpp lib/audiodev/WAVOut.cpp lib/Common.hpp - lib/graphicsdev/Common.cpp - lib/graphicsdev/Common.hpp +# lib/graphicsdev/Common.cpp +# lib/graphicsdev/Common.hpp lib/inputdev/DeviceBase.cpp include/boo/inputdev/DeviceBase.hpp lib/inputdev/CafeProPad.cpp include/boo/inputdev/CafeProPad.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/HIDParser.cpp include/boo/inputdev/HIDParser.hpp lib/inputdev/IHIDDevice.hpp - include/boo/IGraphicsContext.hpp +# include/boo/IGraphicsContext.hpp include/boo/audiodev/IAudioSubmix.hpp include/boo/audiodev/IAudioVoice.hpp include/boo/audiodev/IAudioVoiceEngine.hpp @@ -115,8 +115,8 @@ add_library(boo include/boo/audiodev/IMIDIReader.hpp include/boo/audiodev/MIDIDecoder.hpp include/boo/audiodev/MIDIEncoder.hpp - include/boo/graphicsdev/IGraphicsDataFactory.hpp - include/boo/graphicsdev/IGraphicsCommandQueue.hpp +# include/boo/graphicsdev/IGraphicsDataFactory.hpp +# include/boo/graphicsdev/IGraphicsCommandQueue.hpp include/boo/inputdev/IHIDListener.hpp include/boo/inputdev/XInputPad.hpp include/boo/boo.hpp @@ -155,28 +155,28 @@ target_include_directories(boo PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include ) -if(NOT GEKKO AND NOT CAFE AND NOT WINDOWS_STORE AND NOT NX) - add_library(glew lib/graphicsdev/glew.c) - # 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") - set_source_files_properties(lib/graphicsdev/glew.c PROPERTIES COMPILE_FLAGS -Os) - endif() - target_include_directories(glew PUBLIC include/boo/graphicsdev) - target_compile_definitions(glew PUBLIC -DGLEW_NO_GLU=1) -endif() - -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_compile_definitions(boo PUBLIC -DBOO_HAS_GL=1) - target_link_libraries(boo PUBLIC glew) - - target_sources(boo PRIVATE - include/boo/graphicsdev/GL.hpp - include/boo/graphicsdev/GLSLMacros.hpp - include/boo/graphicsdev/Vulkan.hpp - include/boo/graphicsdev/VulkanDispatchTable.hpp - ) -endif() +#if(NOT GEKKO AND NOT CAFE AND NOT WINDOWS_STORE AND NOT NX) +# add_library(glew lib/graphicsdev/glew.c) +# # 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") +# set_source_files_properties(lib/graphicsdev/glew.c PROPERTIES COMPILE_FLAGS -Os) +# endif() +# target_include_directories(glew PUBLIC include/boo/graphicsdev) +# target_compile_definitions(glew PUBLIC -DGLEW_NO_GLU=1) +#endif() +# +#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_compile_definitions(boo PUBLIC -DBOO_HAS_GL=1) +# target_link_libraries(boo PUBLIC glew) +# +# target_sources(boo PRIVATE +# include/boo/graphicsdev/GL.hpp +# include/boo/graphicsdev/GLSLMacros.hpp +# include/boo/graphicsdev/Vulkan.hpp +# include/boo/graphicsdev/VulkanDispatchTable.hpp +# ) +#endif() set(AudioMatrix_SRC lib/audiodev/AudioMatrix.cpp) if(CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64 @@ -192,15 +192,15 @@ if(WINDOWS_STORE) lib/audiodev/WASAPI.cpp lib/inputdev/HIDDeviceUWP.cpp lib/inputdev/HIDListenerUWP.cpp - lib/graphicsdev/D3D11.cpp - lib/graphicsdev/D3D12.cpp - lib/win/ApplicationUWP.cpp - lib/win/UWPCommon.hpp - lib/win/WinCommon.hpp - lib/win/WindowUWP.cpp +# lib/graphicsdev/D3D11.cpp +# lib/graphicsdev/D3D12.cpp +# lib/win/ApplicationUWP.cpp +# lib/win/UWPCommon.hpp +# lib/win/WinCommon.hpp +# lib/win/WindowUWP.cpp include/boo/UWPViewProvider.hpp - include/boo/graphicsdev/D3D.hpp +# include/boo/graphicsdev/D3D.hpp ) target_compile_definitions(boo PUBLIC @@ -219,22 +219,22 @@ if(WINDOWS_STORE) Xinput ) elseif(WIN32) - unset(VULKAN_SDK_DIRS 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") - message(STATUS "Enabling Vulkan support") - list(GET VULKAN_SDK_DIRS 0 VULKAN_SDK_DIR) - target_include_directories(boo PUBLIC "${VULKAN_SDK_DIR}/Include") - target_compile_definitions(boo PUBLIC - -DBOO_HAS_VULKAN=1 - -DVK_USE_PLATFORM_WIN32_KHR=1 - ) - target_sources(boo PRIVATE - lib/graphicsdev/Vulkan.cpp - lib/graphicsdev/VulkanDispatchTable.cpp - ) - set(BOO_ENABLE_VULKAN_IN_OPTICK TRUE) - endif() +# unset(VULKAN_SDK_DIRS 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") +# message(STATUS "Enabling Vulkan support") +# list(GET VULKAN_SDK_DIRS 0 VULKAN_SDK_DIR) +# target_include_directories(boo PUBLIC "${VULKAN_SDK_DIR}/Include") +# target_compile_definitions(boo PUBLIC +# -DBOO_HAS_VULKAN=1 +# -DVK_USE_PLATFORM_WIN32_KHR=1 +# ) +# target_sources(boo PRIVATE +# lib/graphicsdev/Vulkan.cpp +# lib/graphicsdev/VulkanDispatchTable.cpp +# ) +# set(BOO_ENABLE_VULKAN_IN_OPTICK TRUE) +# endif() find_file(TE_VIRTUAL_MIDI_H teVirtualMIDI.h PATHS "$ENV{PROGRAMFILES\(X86\)}/Tobias Erichsen/teVirtualMIDISDK/C-Binding") @@ -252,7 +252,7 @@ elseif(WIN32) target_sources(boo PRIVATE ${AudioMatrix_SRC} lib/audiodev/WASAPI.cpp - lib/graphicsdev/D3D11.cpp +# lib/graphicsdev/D3D11.cpp lib/inputdev/HIDListenerWinUSB.cpp lib/inputdev/HIDDeviceWinUSB.cpp lib/win/ApplicationWin32.cpp @@ -260,7 +260,7 @@ elseif(WIN32) lib/win/WinCommon.hpp lib/win/Win32Common.hpp - include/boo/graphicsdev/D3D.hpp +# include/boo/graphicsdev/D3D.hpp ) target_compile_definitions(boo PUBLIC @@ -283,20 +283,20 @@ elseif(APPLE) ${AudioMatrix_SRC} lib/inputdev/HIDListenerIOKit.cpp lib/inputdev/HIDDeviceIOKit.cpp - lib/mac/ApplicationCocoa.mm - lib/mac/WindowCocoa.mm - lib/mac/CocoaCommon.hpp - lib/graphicsdev/Metal.mm +# lib/mac/ApplicationCocoa.mm +# lib/mac/WindowCocoa.mm +# lib/mac/CocoaCommon.hpp +# lib/graphicsdev/Metal.mm lib/CFPointer.hpp lib/inputdev/IOKitPointer.hpp - include/boo/graphicsdev/Metal.hpp +# include/boo/graphicsdev/Metal.hpp ) set_source_files_properties( - lib/mac/ApplicationCocoa.mm - lib/mac/WindowCocoa.mm - lib/graphicsdev/Metal.mm +# lib/mac/ApplicationCocoa.mm +# lib/mac/WindowCocoa.mm +# lib/graphicsdev/Metal.mm PROPERTIES COMPILE_FLAGS -fobjc-arc ) @@ -329,14 +329,14 @@ elseif(APPLE) else(NOT GEKKO) target_sources(boo PRIVATE lib/audiodev/LinuxMidi.hpp - lib/graphicsdev/GL.cpp - lib/graphicsdev/GLX.cpp - lib/x11/XlibCommon.hpp - lib/x11/ApplicationUnix.cpp - lib/x11/ApplicationWayland.hpp - lib/x11/ApplicationXlib.hpp - lib/x11/WindowWayland.cpp - lib/x11/WindowXlib.cpp +# lib/graphicsdev/GL.cpp +# lib/graphicsdev/GLX.cpp +# lib/x11/XlibCommon.hpp +# lib/x11/ApplicationUnix.cpp +# lib/x11/ApplicationWayland.hpp +# lib/x11/ApplicationXlib.hpp +# lib/x11/WindowWayland.cpp +# lib/x11/WindowXlib.cpp ) find_package(PkgConfig) @@ -420,22 +420,22 @@ else(NOT GEKKO) ) if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") - find_path(VULKAN_INCLUDE_DIR - NAMES vulkan/vulkan.h - ) - if(VULKAN_INCLUDE_DIR) - message(STATUS "Enabling Vulkan support") - target_sources(boo PRIVATE - lib/graphicsdev/Vulkan.cpp - lib/graphicsdev/VulkanDispatchTable.cpp - ) - target_compile_definitions(boo - PUBLIC - -DBOO_HAS_VULKAN=1 - -DVK_USE_PLATFORM_XCB_KHR=1 - ) - set(BOO_ENABLE_VULKAN_IN_OPTICK TRUE) - endif() +# find_path(VULKAN_INCLUDE_DIR +# NAMES vulkan/vulkan.h +# ) +# if(VULKAN_INCLUDE_DIR) +# message(STATUS "Enabling Vulkan support") +# target_sources(boo PRIVATE +# lib/graphicsdev/Vulkan.cpp +# lib/graphicsdev/VulkanDispatchTable.cpp +# ) +# target_compile_definitions(boo +# PUBLIC +# -DBOO_HAS_VULKAN=1 +# -DVK_USE_PLATFORM_XCB_KHR=1 +# ) +# set(BOO_ENABLE_VULKAN_IN_OPTICK TRUE) +# endif() target_sources(boo PRIVATE ${AudioMatrix_SRC} lib/inputdev/HIDDeviceUdev.cpp diff --git a/include/boo/graphicsdev/D3D.hpp b/include/boo/_graphicsdev/D3D.hpp similarity index 100% rename from include/boo/graphicsdev/D3D.hpp rename to include/boo/_graphicsdev/D3D.hpp diff --git a/include/boo/graphicsdev/GL.hpp b/include/boo/_graphicsdev/GL.hpp similarity index 100% rename from include/boo/graphicsdev/GL.hpp rename to include/boo/_graphicsdev/GL.hpp diff --git a/include/boo/graphicsdev/GLSLMacros.hpp b/include/boo/_graphicsdev/GLSLMacros.hpp similarity index 100% rename from include/boo/graphicsdev/GLSLMacros.hpp rename to include/boo/_graphicsdev/GLSLMacros.hpp diff --git a/include/boo/graphicsdev/IGraphicsCommandQueue.hpp b/include/boo/_graphicsdev/IGraphicsCommandQueue.hpp similarity index 100% rename from include/boo/graphicsdev/IGraphicsCommandQueue.hpp rename to include/boo/_graphicsdev/IGraphicsCommandQueue.hpp diff --git a/include/boo/graphicsdev/IGraphicsDataFactory.hpp b/include/boo/_graphicsdev/IGraphicsDataFactory.hpp similarity index 100% rename from include/boo/graphicsdev/IGraphicsDataFactory.hpp rename to include/boo/_graphicsdev/IGraphicsDataFactory.hpp diff --git a/include/boo/graphicsdev/Metal.hpp b/include/boo/_graphicsdev/Metal.hpp similarity index 100% rename from include/boo/graphicsdev/Metal.hpp rename to include/boo/_graphicsdev/Metal.hpp diff --git a/include/boo/graphicsdev/NX.hpp b/include/boo/_graphicsdev/NX.hpp similarity index 100% rename from include/boo/graphicsdev/NX.hpp rename to include/boo/_graphicsdev/NX.hpp diff --git a/include/boo/graphicsdev/Vulkan.hpp b/include/boo/_graphicsdev/Vulkan.hpp similarity index 100% rename from include/boo/graphicsdev/Vulkan.hpp rename to include/boo/_graphicsdev/Vulkan.hpp diff --git a/include/boo/graphicsdev/VulkanDispatchTable.hpp b/include/boo/_graphicsdev/VulkanDispatchTable.hpp similarity index 100% rename from include/boo/graphicsdev/VulkanDispatchTable.hpp rename to include/boo/_graphicsdev/VulkanDispatchTable.hpp diff --git a/include/boo/graphicsdev/glew.h b/include/boo/_graphicsdev/glew.h similarity index 99% rename from include/boo/graphicsdev/glew.h rename to include/boo/_graphicsdev/glew.h index 2c4e841..54063cc 100644 --- a/include/boo/graphicsdev/glew.h +++ b/include/boo/_graphicsdev/glew.h @@ -5,24 +5,24 @@ ** Copyright (C) 2002-2008, Marcelo E. Magallon ** Copyright (C) 2002, Lev Povalahev ** 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: -** -** * 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. -** * Redistributions in binary form must reproduce the above copyright notice, -** this list of conditions and the following disclaimer in the documentation +** * Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation ** 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. ** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS ** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN ** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) @@ -56,7 +56,7 @@ /* ** Copyright (c) 2007 The Khronos Group Inc. -** +** ** Permission is hereby granted, free of charge, to any person obtaining a ** copy of this software and/or associated documentation files (the ** "Materials"), to deal in the Materials without restriction, including @@ -64,10 +64,10 @@ ** distribute, sublicense, and/or sell copies of the Materials, and to ** permit persons to whom the Materials are furnished to do so, subject to ** the following conditions: -** +** ** The above copyright notice and this permission notice shall be included ** in all copies or substantial portions of the Materials. -** +** ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/include/boo/graphicsdev/glxew.h b/include/boo/_graphicsdev/glxew.h similarity index 100% rename from include/boo/graphicsdev/glxew.h rename to include/boo/_graphicsdev/glxew.h diff --git a/include/boo/graphicsdev/nx_compiler.hpp b/include/boo/_graphicsdev/nx_compiler.hpp similarity index 100% rename from include/boo/graphicsdev/nx_compiler.hpp rename to include/boo/_graphicsdev/nx_compiler.hpp diff --git a/include/boo/graphicsdev/wglew.h b/include/boo/_graphicsdev/wglew.h similarity index 100% rename from include/boo/graphicsdev/wglew.h rename to include/boo/_graphicsdev/wglew.h diff --git a/include/boo/audiodev/IAudioVoiceEngine.hpp b/include/boo/audiodev/IAudioVoiceEngine.hpp index 8353f96..b0b69c7 100644 --- a/include/boo/audiodev/IAudioVoiceEngine.hpp +++ b/include/boo/audiodev/IAudioVoiceEngine.hpp @@ -103,7 +103,7 @@ struct IAudioVoiceEngine { }; /** Construct host platform's voice engine */ -std::unique_ptr NewAudioVoiceEngine(); +std::unique_ptr NewAudioVoiceEngine(const char* uniqueName, const char* friendlyName); /** Construct WAV-rendering voice engine */ std::unique_ptr NewWAVAudioVoiceEngine(const char* path, double sampleRate, int numChans); diff --git a/include/boo/boo.hpp b/include/boo/boo.hpp index bce6b07..def3b53 100644 --- a/include/boo/boo.hpp +++ b/include/boo/boo.hpp @@ -1,12 +1,12 @@ #pragma once -#include "DeferredWindowEvents.hpp" -#include "IApplication.hpp" -#include "IWindow.hpp" +//#include "DeferredWindowEvents.hpp" +//#include "IApplication.hpp" +//#include "IWindow.hpp" #include "inputdev/DeviceFinder.hpp" #include "inputdev/DolphinSmashAdapter.hpp" #include "inputdev/DualshockPad.hpp" #include "inputdev/GenericPad.hpp" #include "inputdev/NintendoPowerA.hpp" -#include "graphicsdev/IGraphicsCommandQueue.hpp" -#include "graphicsdev/IGraphicsDataFactory.hpp" +//#include "graphicsdev/IGraphicsCommandQueue.hpp" +//#include "graphicsdev/IGraphicsDataFactory.hpp" diff --git a/lib/audiodev/AQS.cpp b/lib/audiodev/AQS.cpp index 8e535a6..d2e936b 100644 --- a/lib/audiodev/AQS.cpp +++ b/lib/audiodev/AQS.cpp @@ -856,7 +856,7 @@ struct AQSAudioVoiceEngine : BaseAudioVoiceEngine { } }; -std::unique_ptr NewAudioVoiceEngine() { +std::unique_ptr NewAudioVoiceEngine(const char* uniqueName, const char* friendlyName) { std::unique_ptr ret = std::make_unique(); if (!static_cast(*ret).m_queue) return {}; diff --git a/lib/audiodev/PulseAudio.cpp b/lib/audiodev/PulseAudio.cpp index be46495..88b4da4 100644 --- a/lib/audiodev/PulseAudio.cpp +++ b/lib/audiodev/PulseAudio.cpp @@ -113,7 +113,7 @@ struct PulseAudioVoiceEngine : LinuxMidi { return false; } - PulseAudioVoiceEngine() { + PulseAudioVoiceEngine(const char* uniqueName, const char* friendlyName) { if (!(m_mainloop = pa_mainloop_new())) { Log.report(logvisor::Error, FMT_STRING("Unable to pa_mainloop_new()")); return; @@ -121,9 +121,9 @@ struct PulseAudioVoiceEngine : LinuxMidi { pa_mainloop_api* mlApi = pa_mainloop_get_api(m_mainloop); 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()); - 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()")); pa_mainloop_free(m_mainloop); m_mainloop = nullptr; @@ -341,7 +341,8 @@ struct PulseAudioVoiceEngine : LinuxMidi { size_t nbytes = writablePeriods * periodSz; if (pa_stream_begin_write(m_stream, &data, &nbytes)) { 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(); return; } @@ -356,6 +357,8 @@ struct PulseAudioVoiceEngine : LinuxMidi { } }; -std::unique_ptr NewAudioVoiceEngine() { return std::make_unique(); } +std::unique_ptr NewAudioVoiceEngine(const char* uniqueName, const char* friendlyName) { + return std::make_unique(uniqueName, friendlyName); +} } // namespace boo diff --git a/lib/audiodev/WASAPI.cpp b/lib/audiodev/WASAPI.cpp index dce6f6f..7e9f2b4 100644 --- a/lib/audiodev/WASAPI.cpp +++ b/lib/audiodev/WASAPI.cpp @@ -876,6 +876,8 @@ struct WASAPIAudioVoiceEngine : BaseAudioVoiceEngine { #endif }; -std::unique_ptr NewAudioVoiceEngine() { return std::make_unique(); } +std::unique_ptr NewAudioVoiceEngine(const char* uniqueName, const char* friendlyName) { + return std::make_unique(); +} } // namespace boo