This commit is contained in:
恍兮惚兮 2025-01-04 07:28:06 +08:00
parent e8c6aa1d56
commit 4d9840ae68
13 changed files with 28 additions and 96 deletions

View File

@ -53,18 +53,9 @@ set(texthook_src
add_subdirectory(util)
add_subdirectory(engines)
generate_product_version(
versioninfohook
NAME "LunaHook"
COMPANY_COPYRIGHT "HIllya51 (C) 2024"
ICON ${PATH_TO_APPLICATION_ICON}
VERSION_MAJOR ${VERSION_MAJOR}
VERSION_MINOR ${VERSION_MINOR}
VERSION_PATCH ${VERSION_PATCH}
VERSION_REVISION ${VERSION_REVISION}
)
add_library(LunaHook MODULE ${texthook_src} resource.rc ${versioninfohook})
add_library(LunaHook MODULE ${texthook_src} resource.rc ${versioninfo})
target_precompile_headers(LunaHook REUSE_FROM pchhook)

View File

@ -1,14 +1,4 @@
generate_product_version(
versioninfohost
NAME "LunaHost"
COMPANY_COPYRIGHT "HIllya51 (C) 2024"
ICON ${PATH_TO_APPLICATION_ICON}
VERSION_MAJOR ${VERSION_MAJOR}
VERSION_MINOR ${VERSION_MINOR}
VERSION_PATCH ${VERSION_PATCH}
VERSION_REVISION ${VERSION_REVISION}
)
add_library(host
host.cpp
@ -18,13 +8,13 @@ target_precompile_headers(host REUSE_FROM pch)
target_include_directories(host PUBLIC .)
target_link_libraries(host VERSION_DEF)
add_library(LunaHostDll MODULE LunaHostDll.cpp ${versioninfohost})
add_library(LunaHostDll MODULE LunaHostDll.cpp ${versioninfo})
target_precompile_headers(LunaHostDll REUSE_FROM pch)
set_target_properties(LunaHostDll PROPERTIES OUTPUT_NAME "LunaHost${bitappendix}")
target_link_libraries(LunaHostDll pch host ${YY_Thunks_for_WinXP} lang_host)
if(BUILD_CLI)
add_executable(LunaHostCLI LunaHostCLI.cpp injector.cpp ${versioninfohost})
add_executable(LunaHostCLI LunaHostCLI.cpp injector.cpp ${versioninfo})
target_precompile_headers(LunaHostCLI REUSE_FROM pch)
set_target_properties(LunaHostCLI PROPERTIES OUTPUT_NAME "LunaHostCLI${bitappendix}")
target_link_libraries(LunaHostCLI pch host ${YY_Thunks_for_WinXP} lang_host)

View File

@ -1,6 +1,6 @@
if(BUILD_GUI)
add_executable(LunaHost WIN32 ../injector.cpp confighelper.cpp controls.cpp main.cpp processlistwindow.cpp LunaHost.cpp window.cpp ../../../exec/luna.rc pluginmanager.cpp Plugin/extensionimpl.cpp Plugin/copyclipboard.cpp QtLoader_inline.cpp app.manifest ${versioninfohost})
add_executable(LunaHost WIN32 ../injector.cpp confighelper.cpp controls.cpp main.cpp processlistwindow.cpp LunaHost.cpp window.cpp ../../../exec/luna.rc pluginmanager.cpp Plugin/extensionimpl.cpp Plugin/copyclipboard.cpp QtLoader_inline.cpp app.manifest ${versioninfo})
target_precompile_headers(LunaHost REUSE_FROM pch)
set_target_properties(LunaHost PROPERTIES OUTPUT_NAME "LunaHost${bitappendix}")
target_link_libraries(LunaHost comctl32 winhttp pch host nlohmann ${YY_Thunks_for_WinXP} lang_ui)

View File

@ -1,14 +1,5 @@
project(LunaOCR)
generate_product_version(
versioninfo
NAME "LunaTranslator OCR"
COMPANY_COPYRIGHT "HIllya51 (C) 2024"
VERSION_MAJOR ${VERSION_MAJOR}
VERSION_MINOR ${VERSION_MINOR}
VERSION_PATCH ${VERSION_PATCH}
)
find_package(OnnxRuntime REQUIRED)
set(OpenCV_STATIC ON)
find_package(OpenCV REQUIRED)

View File

@ -4,15 +4,6 @@ project(LUNA)
option(PYSTAND_CONSOLE "Build PyStand as a console application." OFF)
generate_product_version(
versioninfo
NAME "LunaTranslator"
COMPANY_COPYRIGHT "HIllya51 (C) 2024"
VERSION_MAJOR ${VERSION_MAJOR}
VERSION_MINOR ${VERSION_MINOR}
VERSION_PATCH ${VERSION_PATCH}
)
set(sources PyStand.cpp luna.rc ${versioninfo})
add_executable(LunaTranslator_debug ${sources})

View File

@ -2,4 +2,4 @@ python fetchwebview2.py
cmake ..\CMakeLists.txt -G "Visual Studio 17 2022" -A win32 -T host=x86 -B ..\build\x86
cmake --build ..\build\x86 --config Release --target ALL_BUILD -j 14
copy ..\builds\_x86\shareddllproxy32.exe ..\..\py\files\plugins
robocopy ..\builds\_x86 ..\..\py\files\plugins\DLL32
robocopy ..\builds\_x86 ..\..\py\files\plugins\DLL32 *.pyd *.dll

View File

@ -4,4 +4,4 @@ cmake --build ..\build\x64 --config Release --target ALL_BUILD -j 14
copy ..\builds\_x64\shareddllproxy64.exe ..\..\py\files\plugins
copy ..\builds\_x64\hookmagpie.dll ..\..\py\files\plugins
robocopy ..\builds\_x64 ..\..\py\files\plugins\DLL64
robocopy ..\builds\_x64 ..\..\py\files\plugins\DLL64 *.pyd *.dll

View File

@ -2,15 +2,6 @@
project(shareddllproxy)
generate_product_version(
versioninfo
NAME "LunaTranslator shareddllproxy"
COMPANY_COPYRIGHT "HIllya51 (C) 2024"
VERSION_MAJOR ${VERSION_MAJOR}
VERSION_MINOR ${VERSION_MINOR}
VERSION_PATCH ${VERSION_PATCH}
)
set(shareddllproxy_common shareddllproxy.cpp dllinject.cpp aspatch.cpp update.cpp ${versioninfo})
if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)

View File

@ -1,10 +1,21 @@
set(VERSION_MAJOR 6)
set(VERSION_MINOR 16)
set(VERSION_PATCH 18)
set(VERSION_PATCH 19)
set(VERSION_REVISION 0)
set(LUNA_VERSION "{${VERSION_MAJOR},${VERSION_MINOR},${VERSION_PATCH},${VERSION_REVISION}}")
add_library(VERSION_DEF ${CMAKE_CURRENT_LIST_DIR}/version_def.cpp)
target_compile_definitions(VERSION_DEF PRIVATE
LUNA_VERSION_=${LUNA_VERSION})
include(${CMAKE_CURRENT_LIST_DIR}/version/generate_product_version.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/version/generate_product_version.cmake)
generate_product_version(
versioninfo
NAME "LunaTranslator"
COMPANY_COPYRIGHT "HIllya51 (C) 2025"
ICON ${PATH_TO_APPLICATION_ICON}
VERSION_MAJOR ${VERSION_MAJOR}
VERSION_MINOR ${VERSION_MINOR}
VERSION_PATCH ${VERSION_PATCH}
VERSION_REVISION ${VERSION_REVISION}
)

View File

@ -4,7 +4,7 @@ project(wcocr)
set(wcocr_src wechat-ocr/src/mojocall.cpp wechat-ocr/src/ocr_common.pb.cc wechat-ocr/src/ocr_wx3.pb.cc wechat-ocr/src/ocr_wx4.pb.cc wechat-ocr/src/wechatocr.cpp)
add_library(wcocr MODULE wcocr.cpp ${wcocr_src})
add_library(wcocr MODULE wcocr.cpp ${wcocr_src} ${versioninfo})
target_include_directories(wcocr PUBLIC wechat-ocr/vs.proj PUBLIC wechat-ocr/src PRIVATE wechat-ocr/spt)
target_compile_options(wcocr

View File

@ -1,14 +1,6 @@
project(winrtutils)
generate_product_version(
versioninfo
NAME "LunaTranslator winrtutils"
COMPANY_COPYRIGHT "HIllya51 (C) 2024"
VERSION_MAJOR ${VERSION_MAJOR}
VERSION_MINOR ${VERSION_MINOR}
VERSION_PATCH ${VERSION_PATCH}
)
add_library(winrtutils MODULE winrtsnapshot.cpp winrtocr.cpp ${versioninfo})
target_precompile_headers(winrtutils REUSE_FROM pch)

View File

@ -2,14 +2,6 @@
project(winsharedutils)
generate_product_version(
versioninfo
NAME "LunaTranslator winsharedutils"
COMPANY_COPYRIGHT "HIllya51 (C) 2024"
VERSION_MAJOR ${VERSION_MAJOR}
VERSION_MINOR ${VERSION_MINOR}
VERSION_PATCH ${VERSION_PATCH}
)
add_library(winsharedutils MODULE webview2_extra.cpp AreoAcrylic.cpp screenshot.cpp ../implsapi.cpp hwnd.cpp globalmessagelistener.cpp theme.cpp version.cpp lnk.cpp levenshtein.cpp muteprocess.cpp sapi_dll.cpp simplemecab.cpp
applicationloopbackaudio/runer.cpp applicationloopbackaudio/LoopbackCapture.cpp
SimpleBrowser.cpp MWebBrowser.cpp icon.cpp ${versioninfo})

View File

@ -3,36 +3,19 @@ from tts.basettsclass import TTSbase
class TTS(TTSbase):
def makemap(self, lsit):
_ = {}
for i in range(len(lsit)):
_[lsit[i]] = i
return _
def getvoicelist(self):
self._7 = winsharedutils.SAPI_List(7)
self._7m = self.makemap(self._7)
self._10 = winsharedutils.SAPI_List(10)
self._10m = self.makemap(self._10)
if len(self._10):
needremove = []
for _ in self._7:
for _1 in self._10:
_s = _1.split("-")
if len(_s) and _s[0] == _[: len(_s[0])]:
needremove.append(_)
for _ in needremove:
self._7.remove(_)
return (self._7 + self._10), (self._7 + self._10)
__ = []
for _ in range(len(self._7)):
__.append((7, _))
for _ in range(len(self._10)):
__.append((7, _))
return __, (self._7 + self._10)
def speak(self, content, rate, voice):
if voice in self._10m:
version = 10
voice_idx = self._10m[voice]
else:
version = 7
voice_idx = self._7m[voice]
version, voice_idx = voice
data = winsharedutils.SAPI_Speak(content, version, voice_idx, rate, 100)
return data