Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Institute of Technical Acoustics (ITA)
VAUnity
Commits
ee8b7dcf
Commit
ee8b7dcf
authored
Dec 05, 2016
by
Maurice Tayeb Andreas
Browse files
SetSignalSourcePlaying added
parent
a4f4ddf4
Changes
1
Hide whitespace changes
Inline
Side-by-side
VAUSoundSource.cs
View file @
ee8b7dcf
...
...
@@ -16,6 +16,7 @@ public class VAUSoundSource : MonoBehaviour {
private
Transform
t
;
private
bool
islooping
;
private
bool
ismuted
;
private
bool
isplaying
;
public
int
ID
{
...
...
@@ -38,11 +39,16 @@ public class VAUSoundSource : MonoBehaviour {
_VA
=
VAUAdapter
.
VA
;
SoundSource
=
_VA
.
CreateSoundSource
(
this
.
name
,
0
,
Gain
);
_VA
.
SetSoundSourceAuralizationMode
(
SoundSource
,
"all"
);
islooping
=
GetComponent
<
AudioSource
>().
loop
;
ismuted
=
GetComponent
<
AudioSource
>().
mute
;
isplaying
=
GetComponent
<
AudioSource
>().
isPlaying
;
if
(
directivitypath
==
""
)
directivity
=
VAUAdapter
.
DefaultDirectivity
;
else
directivity
=
_VA
.
LoadDirectivity
(
directivitypath
,
"SoundSource "
+
SoundSource
+
" Directivity"
);
if
(
GetComponent
<
AudioSource
>()
!=
null
)
{
if
(
GetComponent
<
AudioSource
>().
clip
!=
null
)
...
...
@@ -70,7 +76,8 @@ public class VAUSoundSource : MonoBehaviour {
{
SetSoundSourcePositionOrientation
();
SetSoundSourcePlaybackState
();
SetSoundSourceMuted
();
SetSignalSourcePlaying
();
//_VA.SetSoundSourceVolume(SoundSource, Volume); <- flaot ändern
}
...
...
@@ -87,7 +94,18 @@ public class VAUSoundSource : MonoBehaviour {
_VA
.
SetSoundSourcePositionOrientationVU
(
SoundSource
,
t
.
transform
.
position
.
x
,
t
.
transform
.
position
.
y
,
-
t
.
transform
.
position
.
z
,
view_ogl
.
x
,
view_ogl
.
y
,
view_ogl
.
z
,
up_ogl
.
x
,
up_ogl
.
y
,
up_ogl
.
z
);
}
void
SetSoundSourcePlaybackState
()
void
SetSignalSourcePlaying
()
{
if
(
GetComponent
<
AudioSource
>().
isPlaying
!=
isplaying
)
{
isplaying
=
GetComponent
<
AudioSource
>().
isPlaying
;
if
(
isplaying
)
_VA
.
SetAudiofileSignalSourcePlaybackAction
(
SignalSource
,
"PLAYING"
);
else
_VA
.
SetAudiofileSignalSourcePlaybackAction
(
SignalSource
,
"PAUSED"
);
}
}
void
SetSoundSourceMuted
()
{
if
(
ismuted
!=
GetComponent
<
AudioSource
>().
mute
)
{
...
...
@@ -100,11 +118,13 @@ public class VAUSoundSource : MonoBehaviour {
{
_VA
.
SetSoundSourceAuralizationMode
(
SoundSource
,
AuraMode
);
}
public
void
OnDisable
()
{
if
(
GetComponent
<
VAUAuralizationMode
>()
!=
null
)
GetComponent
<
VAUAuralizationMode
>().
AuraStringChanged
-=
OnSoundSourceAuralizationModeChanged
;
}
void
OnDestroy
()
{
if
(
_VA
.
IsConnected
())
...
...
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