Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赤子奈落
ygopro
Commits
82f1e003
Commit
82f1e003
authored
Mar 31, 2025
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rev
parent
493bccfb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
11 deletions
+17
-11
gframe/duelclient.cpp
gframe/duelclient.cpp
+9
-3
gframe/sound_manager.cpp
gframe/sound_manager.cpp
+4
-6
gframe/sound_manager.h
gframe/sound_manager.h
+4
-2
No files found.
gframe/duelclient.cpp
View file @
82f1e003
...
@@ -1313,8 +1313,10 @@ bool DuelClient::ClientAnalyze(unsigned char* msg, int len) {
...
@@ -1313,8 +1313,10 @@ bool DuelClient::ClientAnalyze(unsigned char* msg, int len) {
//playing custom bgm
//playing custom bgm
case
21
:
{
//HINT_MUSIC
case
21
:
{
//HINT_MUSIC
if
(
data
)
{
if
(
data
)
{
char
textBufferU
[
1024
];
myswprintf
(
textBuffer
,
L"./sound/BGM/custom/%ls.mp3"
,
dataManager
.
GetDesc
(
data
));
myswprintf
(
textBuffer
,
L"./sound/BGM/custom/%ls.mp3"
,
dataManager
.
GetDesc
(
data
));
soundManager
.
PlayCustomBGM
(
textBuffer
);
BufferIO
::
EncodeUTF8
(
textBuffer
,
textBufferU
);
soundManager
.
PlayCustomBGM
(
textBufferU
);
}
else
{
}
else
{
soundManager
.
StopBGM
();
soundManager
.
StopBGM
();
}
}
...
@@ -1323,8 +1325,10 @@ bool DuelClient::ClientAnalyze(unsigned char* msg, int len) {
...
@@ -1323,8 +1325,10 @@ bool DuelClient::ClientAnalyze(unsigned char* msg, int len) {
//playing custom sound effect
//playing custom sound effect
case
22
:
{
//HINT_SOUND
case
22
:
{
//HINT_SOUND
if
(
data
)
{
if
(
data
)
{
char
textBufferU
[
1024
];
myswprintf
(
textBuffer
,
L"./sound/custom/%ls.wav"
,
dataManager
.
GetDesc
(
data
));
myswprintf
(
textBuffer
,
L"./sound/custom/%ls.wav"
,
dataManager
.
GetDesc
(
data
));
soundManager
.
PlayCustomSound
(
textBuffer
);
BufferIO
::
EncodeUTF8
(
textBuffer
,
textBufferU
);
soundManager
.
PlayCustomSound
(
textBufferU
);
}
else
{
}
else
{
soundManager
.
StopSound
();
soundManager
.
StopSound
();
}
}
...
@@ -1333,8 +1337,10 @@ bool DuelClient::ClientAnalyze(unsigned char* msg, int len) {
...
@@ -1333,8 +1337,10 @@ bool DuelClient::ClientAnalyze(unsigned char* msg, int len) {
//playing custom bgm in ogg format
//playing custom bgm in ogg format
case
23
:
{
//HINT_MUSIC_OGG
case
23
:
{
//HINT_MUSIC_OGG
if
(
data
)
{
if
(
data
)
{
char
textBufferU
[
1024
];
myswprintf
(
textBuffer
,
L"./sound/BGM/custom/%ls.ogg"
,
dataManager
.
GetDesc
(
data
));
myswprintf
(
textBuffer
,
L"./sound/BGM/custom/%ls.ogg"
,
dataManager
.
GetDesc
(
data
));
soundManager
.
PlayCustomBGM
(
textBuffer
);
BufferIO
::
EncodeUTF8
(
textBuffer
,
textBufferU
);
soundManager
.
PlayCustomBGM
(
textBufferU
);
}
else
{
}
else
{
soundManager
.
StopBGM
();
soundManager
.
StopBGM
();
}
}
...
...
gframe/sound_manager.cpp
View file @
82f1e003
...
@@ -313,7 +313,7 @@ void SoundManager::PlayBGM(int scene) {
...
@@ -313,7 +313,7 @@ void SoundManager::PlayBGM(int scene) {
}
}
#endif
#endif
}
}
void
SoundManager
::
PlayCustomBGM
(
wchar_t
*
BGMName
)
{
void
SoundManager
::
PlayCustomBGM
(
char
*
BGMName
)
{
#ifdef YGOPRO_USE_AUDIO
#ifdef YGOPRO_USE_AUDIO
if
(
!
mainGame
->
chkEnableMusic
->
isChecked
()
||
!
mainGame
->
chkMusicMode
->
isChecked
()
||
bgm_process
||
IsCurrentlyPlaying
(
BGMName
))
if
(
!
mainGame
->
chkEnableMusic
->
isChecked
()
||
!
mainGame
->
chkMusicMode
->
isChecked
()
||
bgm_process
||
IsCurrentlyPlaying
(
BGMName
))
return
;
return
;
...
@@ -326,19 +326,17 @@ void SoundManager::PlayCustomBGM(wchar_t* BGMName) {
...
@@ -326,19 +326,17 @@ void SoundManager::PlayCustomBGM(wchar_t* BGMName) {
bgm_process
=
false
;
bgm_process
=
false
;
#endif
#endif
}
}
void
SoundManager
::
PlayCustomSound
(
wchar_t
*
SoundName
)
{
void
SoundManager
::
PlayCustomSound
(
char
*
SoundName
)
{
#ifdef YGOPRO_USE_AUDIO
#ifdef YGOPRO_USE_AUDIO
if
(
!
mainGame
->
chkEnableSound
->
isChecked
())
if
(
!
mainGame
->
chkEnableSound
->
isChecked
())
return
;
return
;
char
soundNameU
[
1024
];
BufferIO
::
EncodeUTF8
(
SoundName
,
soundNameU
);
#ifdef YGOPRO_USE_MINIAUDIO
#ifdef YGOPRO_USE_MINIAUDIO
ma_engine_set_volume
(
&
engineSound
,
mainGame
->
gameConf
.
sound_volume
);
ma_engine_set_volume
(
&
engineSound
,
mainGame
->
gameConf
.
sound_volume
);
ma_engine_play_sound
(
&
engineSound
,
soundNameU
,
nullptr
);
ma_engine_play_sound
(
&
engineSound
,
SoundName
,
nullptr
);
#endif
#endif
#ifdef YGOPRO_USE_IRRKLANG
#ifdef YGOPRO_USE_IRRKLANG
engineSound
->
setSoundVolume
(
mainGame
->
gameConf
.
sound_volume
);
engineSound
->
setSoundVolume
(
mainGame
->
gameConf
.
sound_volume
);
engineSound
->
play2D
(
soundNameU
);
engineSound
->
play2D
(
SoundName
);
#endif
#endif
#endif
#endif
}
}
...
...
gframe/sound_manager.h
View file @
82f1e003
...
@@ -29,6 +29,7 @@ private:
...
@@ -29,6 +29,7 @@ private:
ma_engine
engineMusic
;
ma_engine
engineMusic
;
ma_sound
soundBGM
;
ma_sound
soundBGM
;
char
currentPlayingMusic
[
1024
]{};
char
currentPlayingMusic
[
1024
]{};
ma_sound
soundEffect
;
#endif
#endif
#ifdef YGOPRO_USE_IRRKLANG
#ifdef YGOPRO_USE_IRRKLANG
irrklang
::
ISoundEngine
*
engineSound
;
irrklang
::
ISoundEngine
*
engineSound
;
...
@@ -40,13 +41,14 @@ private:
...
@@ -40,13 +41,14 @@ private:
public:
public:
bool
Init
();
bool
Init
();
void
RefreshBGMList
();
void
RefreshBGMList
();
void
PlaySound
(
char
*
sound
);
void
PlaySoundEffect
(
int
sound
);
void
PlaySoundEffect
(
int
sound
);
void
PlayDialogSound
(
irr
::
gui
::
IGUIElement
*
element
);
void
PlayDialogSound
(
irr
::
gui
::
IGUIElement
*
element
);
bool
IsCurrentlyPlaying
(
char
*
song
);
bool
IsCurrentlyPlaying
(
char
*
song
);
void
PlayMusic
(
char
*
song
,
bool
loop
);
void
PlayMusic
(
char
*
song
,
bool
loop
);
void
PlayBGM
(
int
scene
);
void
PlayBGM
(
int
scene
);
void
PlayCustomBGM
(
wchar_t
*
BGMName
);
void
PlayCustomBGM
(
char
*
BGMName
);
void
PlayCustomSound
(
wchar_t
*
SoundName
);
void
PlayCustomSound
(
char
*
SoundName
);
void
StopBGM
();
void
StopBGM
();
void
StopSound
();
void
StopSound
();
void
SetSoundVolume
(
double
volume
);
void
SetSoundVolume
(
double
volume
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment