generated from vvvv/VL.NewLibrary.Template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release native dll when shutting down a VST plugin to ensure resource…
…s get released on right thread - fixes AV on vvvv shutdown Also fixes a ref count leak when passing parameter changes to the audio processor
- Loading branch information
Showing
12 changed files
with
108 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using Microsoft.Extensions.ObjectPool; | ||
using VL.Lib.Reactive; | ||
using VST3.Hosting; | ||
|
||
namespace VL.Audio.VST; | ||
|
||
sealed class ParameterChangesPool : DefaultObjectPool<ParameterChanges> | ||
{ | ||
public static readonly ParameterChangesPool Default = new(); | ||
|
||
public ParameterChangesPool() : base(new Policy()) | ||
{ | ||
} | ||
|
||
sealed class Policy : PooledObjectPolicy<ParameterChanges> | ||
{ | ||
public override ParameterChanges Create() => new ParameterChanges(); | ||
|
||
public override bool Return(ParameterChanges obj) | ||
{ | ||
obj.Clear(); | ||
return true; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using VL.Audio.VST; | ||
|
||
namespace VST3.Hosting; | ||
|
||
internal abstract class VstObject<TComInterface> | ||
{ | ||
private static readonly Guid comInterfaceGuid = typeof(TComInterface).GUID; | ||
private readonly nint comInterfacePtr; | ||
|
||
public VstObject() | ||
{ | ||
comInterfacePtr = this.GetComPtr(comInterfaceGuid); | ||
} | ||
|
||
public nint ComInterfacePtr => comInterfacePtr; | ||
|
||
public static implicit operator nint(VstObject<TComInterface> obj) => obj.ComInterfacePtr; | ||
} |