1
0
mirror of synced 2024-11-23 23:21:06 +01:00

x64に対応 (#289)

* x64に対応 x64のビルドではDirectSoundには非対応

* 少し修正

* 不具合の修正
This commit is contained in:
Takkkom 2022-08-15 20:54:04 +09:00 committed by GitHub
parent 9a0b7deffb
commit f6d8f78331
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 103 additions and 18 deletions

8
.gitignore vendored
View File

@ -34,6 +34,14 @@
/Test/bassenc.dll
/Test/bassmix.dll
/Test/basswasapi.dll
/Test/dll/bass_fx.dll
/Test/dll/bass.dll
/Test/dll/bassasio.dll
/Test/dll/bassenc.dll
/Test/dll/bassmix.dll
/Test/dll/basswasapi.dll
/Test/System/0.JpnNijiiro
/Test/System/BasicStyle
/Test/System/OpenSkin

View File

@ -2532,7 +2532,7 @@ namespace TJAPlayer3
#region [ WASAPI/ASIO関係 ]
else if ( str3.Equals( "SoundDeviceType" ) )
{
this.nSoundDeviceType = C変換.n値を文字列から取得して範囲内に丸めて返す( str4, 0, 3, this.nSoundDeviceType );
this.nSoundDeviceType = C変換.n値を文字列から取得して範囲内に丸めて返す( str4, Environment.Is64BitProcess ? 1 : 0, 3, this.nSoundDeviceType );
}
else if ( str3.Equals( "WASAPIBufferSizeMs" ) )
{

View File

@ -47,17 +47,26 @@ namespace TJAPlayer3
[DllImport("discord-rpc", EntryPoint = "Discord_Initialize", CallingConvention = CallingConvention.Cdecl)]
public static extern void Initialize(string applicationId, ref EventHandlers handlers, bool autoRegister, string optionalSteamId);
[DllImport("discord-rpc-x64", EntryPoint = "Discord_Initialize", CallingConvention = CallingConvention.Cdecl)]
public static extern void Initialize_x64(string applicationId, ref EventHandlers handlers, bool autoRegister, string optionalSteamId);
[DllImport("discord-rpc", EntryPoint = "Discord_Shutdown", CallingConvention = CallingConvention.Cdecl)]
public static extern void Shutdown();
[DllImport("discord-rpc-x64", EntryPoint = "Discord_Shutdown", CallingConvention = CallingConvention.Cdecl)]
public static extern void Shutdown_x64();
/*
[DllImport("discord-rpc", EntryPoint = "Discord_RunCallbacks", CallingConvention = CallingConvention.Cdecl)]
public static extern void RunCallbacks();
*/
*/
[DllImport("discord-rpc", EntryPoint = "Discord_UpdatePresence", CallingConvention = CallingConvention.Cdecl)]
public static extern void UpdatePresence(ref RichPresence presence);
[DllImport("discord-rpc-x64", EntryPoint = "Discord_UpdatePresence", CallingConvention = CallingConvention.Cdecl)]
public static extern void UpdatePresence_x64(ref RichPresence presence);
/*
[DllImport("discord-rpc", EntryPoint = "Discord_ClearPresence", CallingConvention = CallingConvention.Cdecl)]
public static extern void ClearPresence();
@ -101,7 +110,14 @@ namespace TJAPlayer3
handlers.disconnectedCallback += DisconnectedCallback;
handlers.errorCallback += ErrorCallback;
DiscordRpc.Initialize(clientId, ref handlers, true, null);
if (Environment.Is64BitProcess)
{
DiscordRpc.Initialize_x64(clientId, ref handlers, true, null);
}
else
{
DiscordRpc.Initialize(clientId, ref handlers, true, null);
}
}
@ -125,9 +141,16 @@ namespace TJAPlayer3
presence.largeImageKey = StrToPtr("logo".ToLowerInvariant());
presence.largeImageText = StrToPtr(TJAPlayer3.AppDisplayThreePartVersion);
if (!string.IsNullOrEmpty(smallImageKey)) presence.smallImageKey = StrToPtr(smallImageKey);
if (!string.IsNullOrEmpty(smallImageText)) presence.smallImageText = StrToPtr(smallImageText);
DiscordRpc.UpdatePresence(ref presence);
if (!string.IsNullOrEmpty(smallImageText)) presence.smallImageText = StrToPtr(smallImageText);
if (Environment.Is64BitProcess)
{
DiscordRpc.UpdatePresence_x64(ref presence);
}
else
{
DiscordRpc.UpdatePresence(ref presence);
}
FreeMem();
}
@ -136,8 +159,15 @@ namespace TJAPlayer3
/// 終了時に必ず呼び出す必要があります。
/// </summary>
public static void Shutdown()
{
DiscordRpc.Shutdown();
{
if (Environment.Is64BitProcess)
{
DiscordRpc.Shutdown_x64();
}
else
{
DiscordRpc.Shutdown();
}
Trace.TraceInformation("[Discord] Shutdowned.");
}

View File

@ -2437,7 +2437,8 @@ for (int i = 0; i < 3; i++) {
try
{
ESoundDeviceType soundDeviceType;
switch ( TJAPlayer3.ConfigIni.nSoundDeviceType )
switch (Environment.Is64BitProcess ? TJAPlayer3.ConfigIni.nSoundDeviceType + 1 :
TJAPlayer3.ConfigIni.nSoundDeviceType)
{
case 0:
soundDeviceType = ESoundDeviceType.DirectSound;

View File

@ -200,12 +200,22 @@ namespace TJAPlayer3
this.list項目リスト.Add( this.iSystemBufferedInput );
this.iLogOutputLog = new CItemToggle(CLangManager.LangInstance.GetString(10042), TJAPlayer3.ConfigIni.bログ出力,
CLangManager.LangInstance.GetString(42));
this.list項目リスト.Add( this.iLogOutputLog );
// #24820 2013.1.3 yyagi
this.iSystemSoundType = new CItemList(CLangManager.LangInstance.GetString(10043), CItemList.Eパネル種別., TJAPlayer3.ConfigIni.nSoundDeviceType,
this.list項目リスト.Add( this.iLogOutputLog );
// #24820 2013.1.3 yyagi
if (Environment.Is64BitProcess)
{
this.iSystemSoundType = new CItemList(CLangManager.LangInstance.GetString(10043), CItemList.Eパネル種別., TJAPlayer3.ConfigIni.nSoundDeviceType,
CLangManager.LangInstance.GetString(43),
new string[] { "DSound", "ASIO", "WASAPI Exclusive", "WASAPI Shared" });
new string[] { "ASIO", "WASAPI Exclusive", "WASAPI Shared" });
}
else
{
this.iSystemSoundType = new CItemList(CLangManager.LangInstance.GetString(10043), CItemList.Eパネル種別., TJAPlayer3.ConfigIni.nSoundDeviceType,
CLangManager.LangInstance.GetString(43),
new string[] { "DSound", "ASIO", "WASAPI Exclusive", "WASAPI Shared" });
}
this.list項目リスト.Add(this.iSystemSoundType);
// #24820 2013.1.15 yyagi
@ -834,7 +844,8 @@ namespace TJAPlayer3
this.iSystemSoundTimerType_initial != this.iSystemSoundTimerType.GetIndex() )
{
ESoundDeviceType soundDeviceType;
switch ( this.iSystemSoundType.n現在選択されている項目番号 )
switch (Environment.Is64BitProcess ? this.iSystemSoundType.n現在選択されている項目番号 + 1 :
this.iSystemSoundType.n現在選択されている項目番号)
{
case 0:
soundDeviceType = ESoundDeviceType.DirectSound;

View File

@ -73,7 +73,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<OutputPath>..\Test\</OutputPath>
<DefineConstants>TRACE;DEBUG;_TEST_ENGLISH TEST_Direct3D9Ex_ _WindowedFullscreen MemoryRenderer</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<NoWarn>0219</NoWarn>
@ -84,7 +84,7 @@
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<OutputPath>..\Test\</OutputPath>
<DefineConstants>TRACE;TEST_ENGLISH_ TEST_Direct3D9Ex_ _WindowedFullscreen</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<NoWarn>0219</NoWarn>
@ -454,10 +454,21 @@ move /y "$(TargetDir)KeraLua.dll" "$(SolutionDir)Test\dll\"
move /y "$(TargetDir)liblua54.dylib" "$(SolutionDir)Test\dll\"
move /y "$(TargetDir)liblua54.so" "$(SolutionDir)Test\dll\"
move /y "$(TargetDir)CSharpTest.Net.Collections.*" "$(SolutionDir)Test\dll\"
move /y "$(TargetDir)System.*" "$(SolutionDir)Test\dll\"
if "$(PlatformName)" == "x86" (
copy /y "$(TargetDir)dll\x86\*.dll" "$(SolutionDir)Test\dll\"
) else (
copy /y "$(TargetDir)dll\x64\*.dll" "$(SolutionDir)Test\dll\"
)
copy /y "$(SolutionDir)Readme.txt" "$(SolutionDir)Test\"</PostBuildEvent>
</PropertyGroup>

BIN
Test/discord-rpc-x64.dll Normal file

Binary file not shown.

BIN
Test/dll/liblua54.so Normal file

Binary file not shown.

Binary file not shown.

BIN
Test/dll/x64/bass.dll Normal file

Binary file not shown.

BIN
Test/dll/x64/bass_fx.dll Normal file

Binary file not shown.

BIN
Test/dll/x64/bassasio.dll Normal file

Binary file not shown.

BIN
Test/dll/x64/bassenc.dll Normal file

Binary file not shown.

BIN
Test/dll/x64/bassmix.dll Normal file

Binary file not shown.

BIN
Test/dll/x64/basswasapi.dll Normal file

Binary file not shown.

24
build-x64.bat Normal file
View File

@ -0,0 +1,24 @@
@echo off
setlocal enabledelayedexpansion
if defined ProgramFiles(x86) (
set VSWHERE="!ProgramFiles(x86)!\Microsoft Visual Studio\Installer\vswhere.exe"
) else (
set VSWHERE="!ProgramFiles!\Microsoft Visual Studio\Installer\vswhere.exe"
)
if exist !VSWHERE! (
for /f "usebackq delims=" %%i in (`!VSWHERE! -latest -prerelease -products * -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe`) do (
set MSBUILD="%%i"
)
if exist !MSBUILD! (
!MSBUILD! TJAPlayer3.sln /t:build -restore /p:configuration=release /p:platform=x64
) else (
echo MSBuild is not installed. Please read: https://github.com/l1m0n3/OpenTaiko/wiki/How-to-build-OpenTaiko-without-using-Visual-Studio-^(on-Windows^)
)
) else (
echo Visual Studio Installer is not installed. Please read: https://github.com/l1m0n3/OpenTaiko/wiki/How-to-build-OpenTaiko-without-using-Visual-Studio-^(on-Windows^)
)
pause