Skip to content

Commit

Permalink
Use listener state
Browse files Browse the repository at this point in the history
  • Loading branch information
Nytra committed Dec 27, 2024
1 parent 970b5ee commit 1f0fde9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion ProjectObsidian/ProtoFlux/Audio/AudioAdder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ public class AudioAdderProxy : ProtoFluxEngineProxy, IAudioSource

public IAudioSource AudioInput2;

public bool IsActive => true;
public bool Active;

public bool IsActive => Active;

public int ChannelCount => 1;

Expand Down Expand Up @@ -118,6 +120,7 @@ protected void UpdateListenerState(FrooxEngineContext context)
{
ValueListensToChanges = shouldListen;
context.Group.MarkChangeTrackingDirty();
proxy.Active = shouldListen;
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion ProjectObsidian/ProtoFlux/Audio/AudioSubtractor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ public class AudioSubtractorProxy : ProtoFluxEngineProxy, IAudioSource

public IAudioSource AudioInput2;

public bool IsActive => true;
public bool Active;

public bool IsActive => Active;

public int ChannelCount => 1;

Expand Down Expand Up @@ -118,6 +120,7 @@ protected void UpdateListenerState(FrooxEngineContext context)
{
ValueListensToChanges = shouldListen;
context.Group.MarkChangeTrackingDirty();
proxy.Active = shouldListen;
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion ProjectObsidian/ProtoFlux/Audio/SineGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ public class SineGeneratorProxy : ProtoFluxEngineProxy, IAudioSource

private float[] tempBuffer;

public bool IsActive => true;
public bool Active;

public bool IsActive => Active;

public int ChannelCount => 1;

Expand Down Expand Up @@ -130,6 +132,7 @@ protected void UpdateListenerState(FrooxEngineContext context)
{
ValueListensToChanges = shouldListen;
context.Group.MarkChangeTrackingDirty();
proxy.Active = shouldListen;
}
}
}
Expand Down

0 comments on commit 1f0fde9

Please sign in to comment.