Closed filiph closed 6 months ago
Hey @alnitak, this will evidently need some thinking, but a first, relatively straightforward thing to answer would be:
Is SoLoud (the underlying C library) capable of being instanced?
If that's not the case, then we can clearly close this issue.
Is SoLoud (the underlying C library) capable of being instanced?
I was thinking about this. Is not possible to have for example 2 SoLoud
instances because there can be only one player instance on C side.
But, yes, you can implement final engine = SoLoud(sampleRate: 44100);
easily, but this engine
will have that sampleRate for its entire life cycle.
So I think we can close this.
Ok, this is really helpful. If it's not possible to have two instances on the C side, it shouldn't be possible to have two instances on the Dart side. This simplifies things. Thanks for the quick reply!
Description
SoLoud
is currently always a singleton. There's a single SoLoud underlying engine, and the Dart API exposes it viaSoLoud()
. We could go that way but I wonder if it's possible (even easy?) to make SoLoud instanced.This would mean that every time you call
SoLoud()
, you'd get a new instance of the engine. You could have multiple running at the same time.PROs:
final engine = SoLoud(sampleRate: 44100);
.SoLoud()
from anywhere. There is no way a controller/facade can "hide" SoLoud() from you via encapsulation.CONs:
SoLoud()
to access the same instance).Requirements