Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

something #1115

Merged
merged 17 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
...
  • Loading branch information
test123456654321 committed Oct 18, 2024
commit f843000d94a2ec1290302ceeaf86405b31b88087
44 changes: 44 additions & 0 deletions src/plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
cmake_minimum_required(VERSION 3.16)

project(LunaPlugins)

set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

add_compile_options(
/std:c++17
/MP
/wd4018
/DUNICODE
/D_UNICODE
)

if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
set(CMAKE_FINAL_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/builds/${CMAKE_BUILD_TYPE}_x64)
else()
set(CMAKE_FINAL_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/builds/${CMAKE_BUILD_TYPE}_x86)
endif()
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY $<1:${CMAKE_FINAL_OUTPUT_DIRECTORY}>)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY $<1:${CMAKE_FINAL_OUTPUT_DIRECTORY}>)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY $<1:${CMAKE_FINAL_OUTPUT_DIRECTORY}>)

include(libs/libs.cmake)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/version)
include(generate_product_version)

set(VERSION_MAJOR 5)
set(VERSION_MINOR 43)
set(VERSION_PATCH 2)

add_library(pch pch.cpp)
target_precompile_headers(pch PUBLIC pch.h)


add_subdirectory(exec)
add_subdirectory(winrtutils)
add_subdirectory(winsharedutils)
add_subdirectory(hookmagpie)
add_subdirectory(shareddllproxy)
add_subdirectory(applicationloopbackaudio)
add_subdirectory(wcocr)
17 changes: 17 additions & 0 deletions src/plugins/applicationloopbackaudio/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

project(loopbackaudio)


generate_product_version(
versioninfo
NAME "LunaTranslator loopbackaudio"
COMPANY_COPYRIGHT "HIllya51 (C) 2024"
VERSION_MAJOR ${VERSION_MAJOR}
VERSION_MINOR ${VERSION_MINOR}
VERSION_PATCH ${VERSION_PATCH}
)


add_library(loopbackaudio MODULE runer.cpp LoopbackCapture.cpp ${versioninfo})
target_precompile_headers(loopbackaudio REUSE_FROM pch)
target_link_libraries(loopbackaudio Mfplat mfuuid )
58 changes: 58 additions & 0 deletions src/plugins/applicationloopbackaudio/Common.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#pragma once

#include <mfidl.h>
#include <mfapi.h>
#include <mfobjects.h>

#ifndef METHODASYNCCALLBACK
#define METHODASYNCCALLBACK(Parent, AsyncCallback, pfnCallback) \
class Callback##AsyncCallback :\
public IMFAsyncCallback \
{ \
public: \
Callback##AsyncCallback() : \
_parent(((Parent*)((BYTE*)this - offsetof(Parent, m_x##AsyncCallback)))), \
_dwQueueID( MFASYNC_CALLBACK_QUEUE_MULTITHREADED ) \
{ \
} \
\
STDMETHOD_( ULONG, AddRef )() \
{ \
return _parent->AddRef(); \
} \
STDMETHOD_( ULONG, Release )() \
{ \
return _parent->Release(); \
} \
STDMETHOD( QueryInterface )( REFIID riid, void **ppvObject ) \
{ \
if (riid == IID_IMFAsyncCallback || riid == IID_IUnknown) \
{ \
(*ppvObject) = this; \
AddRef(); \
return S_OK; \
} \
*ppvObject = NULL; \
return E_NOINTERFACE; \
} \
STDMETHOD( GetParameters )( \
/* [out] */ __RPC__out DWORD *pdwFlags, \
/* [out] */ __RPC__out DWORD *pdwQueue) \
{ \
*pdwFlags = 0; \
*pdwQueue = _dwQueueID; \
return S_OK; \
} \
STDMETHOD( Invoke )( /* [out] */ __RPC__out IMFAsyncResult * pResult ) \
{ \
_parent->pfnCallback( pResult ); \
return S_OK; \
} \
void SetQueueID( DWORD dwQueueID ) { _dwQueueID = dwQueueID; } \
\
protected: \
Parent* _parent; \
DWORD _dwQueueID; \
\
} m_x##AsyncCallback;
#endif
Loading