Safe to use a single CoreAudioMBS object in the whole app?

Hi,

I’m using the CoreAudioMBS class in various places in an application, and wondered if this is time/resources consuming (I’m calling methods around once per second, in one place).

My though is to have a property in the app class, which would be instantiated only once (at app start), so I don’t instantiate a new one each time I need to query some values (volume, mute state), but I don’t know whether it’s safe nor if the class uses internal caching.

On the other hand, I’m not sure if the current way (instantiating a new object each time) is unsafe.

Advices welcomes.

Yes. CoreAudioMBS is from the time, where we had no modules in Xojo.

So this class is basically a module with a LastError property.
You can have one or several, if you need to have separate LastError values.

Thanks for your answer.

So it’s a module, but without any caches system? Because I guess it can have caches (like it can have none) and keep its initial values (or not, and refresh automatically).