Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
43c9f4e1
Commit
43c9f4e1
authored
May 22, 2015
by
poixen
Browse files
Merge pull request #1100 from poixen/new_sounds
Updated sounds
parents
3532c31d
4c1e24c2
Changes
4
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/messagelogwidget.cpp
View file @
43c9f4e1
...
@@ -803,8 +803,8 @@ void MessageLogWidget::logSetActivePhase(int phase)
...
@@ -803,8 +803,8 @@ void MessageLogWidget::logSetActivePhase(int phase)
case
1
:
phaseName
=
tr
(
"upkeep step"
);
break
;
case
1
:
phaseName
=
tr
(
"upkeep step"
);
break
;
case
2
:
phaseName
=
tr
(
"draw step"
);
break
;
case
2
:
phaseName
=
tr
(
"draw step"
);
break
;
case
3
:
phaseName
=
tr
(
"first main phase"
);
break
;
case
3
:
phaseName
=
tr
(
"first main phase"
);
break
;
case
4
:
phaseName
=
tr
(
"beginning of combat step"
);
soundEngine
->
startCombat
();
break
;
case
4
:
phaseName
=
tr
(
"beginning of combat step"
);
break
;
case
5
:
phaseName
=
tr
(
"declare attackers step"
);
break
;
case
5
:
phaseName
=
tr
(
"declare attackers step"
);
soundEngine
->
attack
();
break
;
case
6
:
phaseName
=
tr
(
"declare blockers step"
);
break
;
case
6
:
phaseName
=
tr
(
"declare blockers step"
);
break
;
case
7
:
phaseName
=
tr
(
"combat damage step"
);
break
;
case
7
:
phaseName
=
tr
(
"combat damage step"
);
break
;
case
8
:
phaseName
=
tr
(
"end of combat step"
);
break
;
case
8
:
phaseName
=
tr
(
"end of combat step"
);
break
;
...
...
cockatrice/src/soundengine.cpp
View file @
43c9f4e1
...
@@ -17,13 +17,13 @@ SoundEngine::SoundEngine(QObject *parent)
...
@@ -17,13 +17,13 @@ SoundEngine::SoundEngine(QObject *parent)
lastTapPlayed
=
QDateTime
::
currentDateTime
();
lastTapPlayed
=
QDateTime
::
currentDateTime
();
lastEndStepPlayed
=
QDateTime
::
currentDateTime
();
lastEndStepPlayed
=
QDateTime
::
currentDateTime
();
last
StartCombat
Played
=
QDateTime
::
currentDateTime
();
last
AttackStep
Played
=
QDateTime
::
currentDateTime
();
}
}
void
SoundEngine
::
cacheData
()
void
SoundEngine
::
cacheData
()
{
{
static
const
QStringList
fileNames
=
QStringList
()
static
const
QStringList
fileNames
=
QStringList
()
<<
"end_step"
<<
"tap"
<<
"player_joined"
<<
"
start_combat
"
;
<<
"end_step"
<<
"tap"
<<
"player_joined"
<<
"
attack
"
;
for
(
int
i
=
0
;
i
<
fileNames
.
size
();
++
i
)
{
for
(
int
i
=
0
;
i
<
fileNames
.
size
();
++
i
)
{
QFile
file
(
settingsCache
->
getSoundPath
()
+
"/"
+
fileNames
[
i
]
+
".raw"
);
QFile
file
(
settingsCache
->
getSoundPath
()
+
"/"
+
fileNames
[
i
]
+
".raw"
);
if
(
!
file
.
exists
())
if
(
!
file
.
exists
())
...
@@ -95,8 +95,8 @@ void SoundEngine::playerJoined()
...
@@ -95,8 +95,8 @@ void SoundEngine::playerJoined()
}
}
void
SoundEngine
::
startCombat
()
{
void
SoundEngine
::
attack
()
{
if
(
last
StartCombat
Played
.
secsTo
(
QDateTime
::
currentDateTime
())
>=
1
)
if
(
last
AttackStep
Played
.
secsTo
(
QDateTime
::
currentDateTime
())
>=
1
)
playSound
(
"
start_combat
"
);
playSound
(
"
attack
"
);
last
StartCombat
Played
=
QDateTime
::
currentDateTime
();
last
AttackStep
Played
=
QDateTime
::
currentDateTime
();
}
}
cockatrice/src/soundengine.h
View file @
43c9f4e1
...
@@ -17,7 +17,7 @@ private:
...
@@ -17,7 +17,7 @@ private:
QAudioOutput
*
audio
;
QAudioOutput
*
audio
;
QDateTime
lastTapPlayed
;
QDateTime
lastTapPlayed
;
QDateTime
lastEndStepPlayed
;
QDateTime
lastEndStepPlayed
;
QDateTime
last
StartCombat
Played
;
QDateTime
last
AttackStep
Played
;
private
slots
:
private
slots
:
void
cacheData
();
void
cacheData
();
void
soundEnabledChanged
();
void
soundEnabledChanged
();
...
@@ -27,7 +27,7 @@ public slots:
...
@@ -27,7 +27,7 @@ public slots:
void
endStep
();
void
endStep
();
void
tap
();
void
tap
();
void
playerJoined
();
void
playerJoined
();
void
startCombat
();
void
attack
();
};
};
extern
SoundEngine
*
soundEngine
;
extern
SoundEngine
*
soundEngine
;
...
...
sounds/attack.raw
0 → 100644
View file @
43c9f4e1
File added
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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