Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
3cfb9df3
Unverified
Commit
3cfb9df3
authored
May 13, 2018
by
Hein-Pieter van Braam
Committed by
GitHub
May 13, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Use fake audio playing property in editor"
parent
24dbe5e3
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
3 additions
and
44 deletions
+3
-44
audio_stream_player_2d.cpp
scene/2d/audio_stream_player_2d.cpp
+1
-10
audio_stream_player_2d.h
scene/2d/audio_stream_player_2d.h
+0
-4
audio_stream_player_3d.cpp
scene/3d/audio_stream_player_3d.cpp
+1
-10
audio_stream_player_3d.h
scene/3d/audio_stream_player_3d.h
+0
-4
audio_player.cpp
scene/audio/audio_player.cpp
+1
-12
audio_player.h
scene/audio/audio_player.h
+0
-4
No files found.
scene/2d/audio_stream_player_2d.cpp
View file @
3cfb9df3
...
...
@@ -233,6 +233,7 @@ void AudioStreamPlayer2D::_notification(int p_what) {
//stop playing if no longer active
if
(
!
active
)
{
set_physics_process_internal
(
false
);
//do not update, this makes it easier to animate (will shut off otherwise)
//_change_notify("playing"); //update property in editor
emit_signal
(
"finished"
);
}
...
...
@@ -312,11 +313,6 @@ void AudioStreamPlayer2D::stop() {
bool
AudioStreamPlayer2D
::
is_playing
()
const
{
#ifdef TOOLS_ENABLED
if
(
Engine
::
get_singleton
()
->
is_editor_hint
())
return
fake_active
;
#endif
if
(
stream_playback
.
is_valid
())
{
return
active
;
// && stream_playback->is_playing();
}
...
...
@@ -361,16 +357,11 @@ bool AudioStreamPlayer2D::is_autoplay_enabled() {
void
AudioStreamPlayer2D
::
_set_playing
(
bool
p_enable
)
{
#ifdef TOOLS_ENABLED
fake_active
=
p_enable
;
#endif
if
(
p_enable
)
play
();
else
stop
();
}
bool
AudioStreamPlayer2D
::
_is_active
()
const
{
return
active
;
...
...
scene/2d/audio_stream_player_2d.h
View file @
3cfb9df3
...
...
@@ -69,10 +69,6 @@ private:
volatile
bool
active
;
volatile
float
setplay
;
#ifdef TOOLS_ENABLED
volatile
bool
fake_active
;
#endif
float
volume_db
;
float
pitch_scale
;
bool
autoplay
;
...
...
scene/3d/audio_stream_player_3d.cpp
View file @
3cfb9df3
...
...
@@ -543,6 +543,7 @@ void AudioStreamPlayer3D::_notification(int p_what) {
//stop playing if no longer active
if
(
!
active
)
{
set_physics_process_internal
(
false
);
//do not update, this makes it easier to animate (will shut off otherwise)
//_change_notify("playing"); //update property in editor
emit_signal
(
"finished"
);
}
...
...
@@ -640,11 +641,6 @@ void AudioStreamPlayer3D::stop() {
bool
AudioStreamPlayer3D
::
is_playing
()
const
{
#ifdef TOOLS_ENABLED
if
(
Engine
::
get_singleton
()
->
is_editor_hint
())
return
fake_active
;
#endif
if
(
stream_playback
.
is_valid
())
{
return
active
;
// && stream_playback->is_playing();
}
...
...
@@ -689,16 +685,11 @@ bool AudioStreamPlayer3D::is_autoplay_enabled() {
void
AudioStreamPlayer3D
::
_set_playing
(
bool
p_enable
)
{
#ifdef TOOLS_ENABLED
fake_active
=
p_enable
;
#endif
if
(
p_enable
)
play
();
else
stop
();
}
bool
AudioStreamPlayer3D
::
_is_active
()
const
{
return
active
;
...
...
scene/3d/audio_stream_player_3d.h
View file @
3cfb9df3
...
...
@@ -102,10 +102,6 @@ private:
volatile
bool
active
;
volatile
float
setplay
;
#ifdef TOOLS_ENABLED
volatile
bool
fake_active
;
#endif
AttenuationModel
attenuation_model
;
float
unit_db
;
float
unit_size
;
...
...
scene/audio/audio_player.cpp
View file @
3cfb9df3
...
...
@@ -127,7 +127,6 @@ void AudioStreamPlayer::_notification(int p_what) {
if
(
!
active
||
(
setseek
<
0
&&
!
stream_playback
->
is_playing
()))
{
active
=
false
;
set_process_internal
(
false
);
//_change_notify("playing"); //update property in editor
emit_signal
(
"finished"
);
}
}
...
...
@@ -212,13 +211,8 @@ void AudioStreamPlayer::stop() {
bool
AudioStreamPlayer
::
is_playing
()
const
{
#ifdef TOOLS_ENABLED
if
(
Engine
::
get_singleton
()
->
is_editor_hint
())
return
fake_active
;
#endif
if
(
stream_playback
.
is_valid
())
{
return
active
;
//
&& stream_playback->is_playing();
return
active
;
//&& stream_playback->is_playing();
}
return
false
;
...
...
@@ -271,16 +265,11 @@ AudioStreamPlayer::MixTarget AudioStreamPlayer::get_mix_target() const {
void
AudioStreamPlayer
::
_set_playing
(
bool
p_enable
)
{
#ifdef TOOLS_ENABLED
fake_active
=
p_enable
;
#endif
if
(
p_enable
)
play
();
else
stop
();
}
bool
AudioStreamPlayer
::
_is_active
()
const
{
return
active
;
...
...
scene/audio/audio_player.h
View file @
3cfb9df3
...
...
@@ -53,10 +53,6 @@ private:
volatile
float
setseek
;
volatile
bool
active
;
#ifdef TOOLS_ENABLED
volatile
bool
fake_active
;
#endif
float
mix_volume_db
;
float
pitch_scale
;
float
volume_db
;
...
...
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